]> git.baikalelectronics.ru Git - kernel.git/commit
usb: xhci: xhci-ring: Use sysdev for mapping bounce buffer
authorWesley Cheng <quic_wcheng@quicinc.com>
Fri, 15 Sep 2023 14:31:05 +0000 (17:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Oct 2023 21:08:54 +0000 (23:08 +0200)
commitc5bfe67d9fa19415ab3ffe9bd836bb7129d072e2
tree45dda1330ec2fc19abf7e97456499309a94d4402
parentf049b10affc5aea48ba300a926df1b527e297686
usb: xhci: xhci-ring: Use sysdev for mapping bounce buffer

commit 41a43013d2366db5b88b42bbcd8e8f040b6ccf21 upstream.

As mentioned in:
  commit 474ed23a6257 ("xhci: align the last trb before link if it is
easily splittable.")

A bounce buffer is utilized for ensuring that transfers that span across
ring segments are aligned to the EP's max packet size.  However, the device
that is used to map the DMA buffer to is currently using the XHCI HCD,
which does not carry any DMA operations in certain configrations.
Migration to using the sysdev entry was introduced for DWC3 based
implementations where the IOMMU operations are present.

Replace the reference to the controller device to sysdev instead.  This
allows the bounce buffer to be properly mapped to any implementations that
have an IOMMU involved.

cc: stable@vger.kernel.org
Fixes: 4c39d4b949d3 ("usb: xhci: use bus->sysdev for DMA configuration")
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20230915143108.1532163-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c