summaryrefslogtreecommitdiff
path: root/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c')
-rw-r--r--drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
index 1d28459d5b0e..6aad9c437998 100644
--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
@@ -766,16 +766,17 @@ static int dwc_otg_urb_enqueue(struct usb_hcd *hcd,
!(usb_pipein(urb->pipe))));
buf = urb->transfer_buffer;
- if (hcd->self.uses_dma) {
+ if (hcd->self.uses_dma && !buf && urb->transfer_buffer_length) {
/*
* Calculate virtual address from physical address,
* because some class driver may not fill transfer_buffer.
* In Buffer DMA mode virual address is used,
* when handling non DWORD aligned buffers.
*/
- //buf = phys_to_virt(urb->transfer_dma);
- // DMA addresses are bus addresses not physical addresses!
- buf = dma_to_virt(&urb->dev->dev, urb->transfer_dma);
+ buf = (void *)__bus_to_virt((unsigned long)urb->transfer_dma);
+ dev_warn_once(&urb->dev->dev,
+ "USB transfer_buffer was NULL, will use __bus_to_virt(%pad)=%p\n",
+ &urb->transfer_dma, buf);
}
if (!(urb->transfer_flags & URB_NO_INTERRUPT))