1. Jan 15, 2024
    • Randy Dunlap's avatar
      dma-debug: fix kernel-doc warnings · 7c65aa3c
      Randy Dunlap authored
      Update the kernel-doc comments to catch up with the code changes and
      fix the kernel-doc warnings:
      
      debug.c:83: warning: Excess struct member 'stacktrace' description in 'dma_debug_entry'
      debug.c:83: warning: Function parameter or struct member 'stack_len' not described in 'dma_debug_entry'
      debug.c:83: warning: Function parameter or struct member 'stack_entries' not described in 'dma_debug_entry'
      
      Fixes: 746017ed
      
       ("dma/debug: Simplify stracktrace retrieval")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: iommu@lists.linux.dev
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      7c65aa3c
  2. Jan 09, 2024
  3. Dec 15, 2023
    • Joakim Zhang's avatar
      dma-mapping: clear dev->dma_mem to NULL after freeing it · b07bc234
      Joakim Zhang authored
      Reproduced with below sequence:
      dma_declare_coherent_memory()->dma_release_coherent_memory()
      ->dma_declare_coherent_memory()->"return -EBUSY" error
      
      It will return -EBUSY from the dma_assign_coherent_memory()
      in dma_declare_coherent_memory(), the reason is that dev->dma_mem
      pointer has not been set to NULL after it's freed.
      
      Fixes: cf65a0f6
      
       ("dma-mapping: move all DMA mapping code to kernel/dma")
      Signed-off-by: default avatarJoakim Zhang <joakim.zhang@cixtech.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      b07bc234
    • Petr Tesarik's avatar
      swiotlb: reduce area lock contention for non-primary IO TLB pools · 55c54386
      Petr Tesarik authored
      
      
      If multiple areas and multiple IO TLB pools exist, first iterate the
      current CPU specific area in all pools. Then move to the next area index.
      
      This is best illustrated by a diagram:
      
              area 0 |  area 1 | ... | area M |
      pool 0    A         B              C
      pool 1    D         E
      ...
      pool N    F         G              H
      
      Currently, each pool is searched before moving on to the next pool,
      i.e. the search order is A, B ... C, D, E ... F, G ... H. With this patch,
      each area is searched in all pools before moving on to the next area,
      i.e. the search order is A, D ... F, B, E ... G ... C ... H.
      
      Note that preemption is not disabled, and raw_smp_processor_id() may not
      return a stable result, but it is called only once to determine the initial
      area index. The search will iterate over all areas eventually, even if the
      current task is preempted.
      
      Next, some pools may have less (but not more) areas than default_nareas.
      Skip such pools if the distance from the initial area index is greater than
      pool->nareas. This logic ensures that for every pool the search starts in
      the initial CPU's own area and never tries any area twice.
      
      To verify performance impact, I booted the kernel with a minimum pool
      size ("swiotlb=512,4,force"), so multiple pools get allocated, and I ran
      these benchmarks:
      
      - small: single-threaded I/O of 4 KiB blocks,
      - big: single-threaded I/O of 64 KiB blocks,
      - 4way: 4-way parallel I/O of 4 KiB blocks.
      
      The "var" column in the tables below is the coefficient of variance over 5
      runs of the test, the "diff" column is the relative difference against base
      in read-write I/O bandwidth (MiB/s).
      
      Tested on an x86 VM against a QEMU virtio SATA driver backed by a RAM-based
      block device on the host:
      
      	base	   patched
      	var	var	diff
      small	0.69%	0.62%	+25.4%
      big	2.14%	2.27%	+25.7%
      4way	2.65%	1.70%	+23.6%
      
      Tested on a Raspberry Pi against a class-10 A1 microSD card:
      
      	base	   patched
      	var	var	diff
      small	0.53%	1.96%	-0.3%
      big	0.02%	0.57%	+0.8%
      4way	6.17%	0.40%	+0.3%
      
      These results confirm that there is significant performance boost in the
      software IO TLB slot allocation itself. Where performance is dominated by
      actual hardware, there is no measurable change.
      
      Signed-off-by: default avatarPetr Tesarik <petr.tesarik1@huawei-partners.com>
      Reviewed-by: default avatarMirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      55c54386
    • Robin Murphy's avatar
      dma-mapping: don't store redundant offsets · 4ad4c1f3
      Robin Murphy authored
      
      
      A bus_dma_region necessarily stores both CPU and DMA base addresses for
      a range, so there's no need to also store the difference between them.
      
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      4ad4c1f3
    • Linus Torvalds's avatar
      Merge tag '6.7-rc5-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 3f716859
      Linus Torvalds authored
      Pull smb client fixes from Steve French:
       "Address OOBs and NULL dereference found by Dr. Morris's recent
        analysis and fuzzing.
      
        All marked for stable as well"
      
      * tag '6.7-rc5-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        smb: client: fix OOB in smb2_query_reparse_point()
        smb: client: fix NULL deref in asn1_ber_decoder()
        smb: client: fix potential OOBs in smb2_parse_contexts()
        smb: client: fix OOB in receive_encrypted_standard()
      3f716859
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v6.7-4' of... · 976600c6
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Ilpo Järvinen:
      
       - tablet-mode-switch events fix
      
       - kernel-doc warning fixes
      
      * tag 'platform-drivers-x86-v6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/x86: intel_ips: fix kernel-doc formatting
        platform/x86: thinkpad_acpi: fix kernel-doc warnings
        platform/x86: intel-vbtn: Fix missing tablet-mode-switch events
      976600c6
    • Linus Torvalds's avatar
      Merge tag 'net-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · c7402612
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
      "Current release - regressions:
      
         - tcp: fix tcp_disordered_ack() vs usec TS resolution
      
        Current release - new code bugs:
      
         - dpll: sanitize possible null pointer dereference in
           dpll_pin_parent_pin_set()
      
         - eth: octeon_ep: initialise control mbox tasks before using APIs
      
        Previous releases - regressions:
      
         - io_uring/af_unix: disable sending io_uring over sockets
      
         - eth: mlx5e:
             - TC, don't offload post action rule if not supported
             - fix possible deadlock on mlx5e_tx_timeout_work
      
         - eth: iavf: fix iavf_shutdown to call iavf_remove instead iavf_close
      
         - eth: bnxt_en: fix skb recycling logic in bnxt_deliver_skb()
      
         - eth: ena: fix DMA syncing in XDP path when SWIOTLB is on
      
         - eth: team: fix use-after-free when an option instance allocation
           fails
      
        Previous releases - always broken:
      
         - neighbour: don't let neigh_forced_gc() disable preemption for long
      
         - net: prevent mss overflow in skb_segment()
      
         - ipv6: support reporting otherwise unknown prefix flags in
           RTM_NEWPREFIX
      
         - tcp: remove acked SYN flag from packet in the transmit queue
           correctly
      
         - eth: octeontx2-af:
             - fix a use-after-free in rvu_nix_register_reporters
             - fix promisc mcam entry action
      
         - eth: dwmac-loongson: make sure MDIO is initialized before use
      
         - eth: atlantic: fix double free in ring reinit logic"
      
      * tag 'net-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (62 commits)
        net: atlantic: fix double free in ring reinit logic
        appletalk: Fix Use-After-Free in atalk_ioctl
        net: stmmac: Handle disabled MDIO busses from devicetree
        net: stmmac: dwmac-qcom-ethqos: Fix drops in 10M SGMII RX
        dpaa2-switch: do not ask for MDB, VLAN and FDB replay
        dpaa2-switch: fix size of the dma_unmap
        net: prevent mss overflow in skb_segment()
        vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space()
        Revert "tcp: disable tcp_autocorking for socket when TCP_NODELAY flag is set"
        MIPS: dts: loongson: drop incorrect dwmac fallback compatible
        stmmac: dwmac-loongson: drop useless check for compatible fallback
        stmmac: dwmac-loongson: Make sure MDIO is initialized before use
        tcp: disable tcp_autocorking for socket when TCP_NODELAY flag is set
        dpll: sanitize possible null pointer dereference in dpll_pin_parent_pin_set()
        net: ena: Fix XDP redirection error
        net: ena: Fix DMA syncing in XDP path when SWIOTLB is on
        net: ena: Fix xdp drops handling due to multibuf packets
        net: ena: Destroy correct number of xdp queues upon failure
        net: Remove acked SYN flag from packet in the transmit queue correctly
        qed: Fix a potential use-after-free in qed_cxt_tables_alloc
        ...
      c7402612
    • Linus Torvalds's avatar
      Merge tag 'for-6.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · bdb2701f
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
        "Some fixes to quota accounting code, mostly around error handling and
         correctness:
      
         - free reserves on various error paths, after IO errors or
           transaction abort
      
         - don't clear reserved range at the folio release time, it'll be
           properly cleared after final write
      
         - fix integer overflow due to int used when passing around size of
           freed reservations
      
         - fix a regression in squota accounting that missed some cases with
           delayed refs"
      
      * tag 'for-6.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: ensure releasing squota reserve on head refs
        btrfs: don't clear qgroup reserved bit in release_folio
        btrfs: free qgroup pertrans reserve on transaction abort
        btrfs: fix qgroup_free_reserved_data int overflow
        btrfs: free qgroup reserve when ORDERED_IOERR is set
      bdb2701f
  4. Dec 14, 2023
  5. Dec 13, 2023