]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
usb: hcd: use correct device pointer for dma ops
authorSekhar Nori <nsekhar@ti.com>
Mon, 3 Apr 2017 08:26:52 +0000 (13:56 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 10:04:42 +0000 (12:04 +0200)
commit a8c06e407ef9 ("usb: separate out sysdev pointer from
usb_bus") converted to use hcd->self.sysdev for DMA
operations instead of hcd->self.controller but forgot to do
it for one instance.

This gets caught when DMA debugging is enabled since dma map
and unmap end up using different device pointers.

Fix it.

Fixes: a8c06e407ef9 ("usb: separate out sysdev pointer from usb_bus")
Reported-by: Carlos Hernandez <ceh@ti.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hcd.c

index da7ee5735c14e1e57ab33afc57f67bc98b0d27ad..49550790a3cba255df329dd73ca6e08e17a13af7 100644 (file)
@@ -1436,7 +1436,7 @@ void usb_hcd_unmap_urb_setup_for_dma(struct usb_hcd *hcd, struct urb *urb)
 {
        if (IS_ENABLED(CONFIG_HAS_DMA) &&
            (urb->transfer_flags & URB_SETUP_MAP_SINGLE))
-               dma_unmap_single(hcd->self.controller,
+               dma_unmap_single(hcd->self.sysdev,
                                urb->setup_dma,
                                sizeof(struct usb_ctrlrequest),
                                DMA_TO_DEVICE);