staging: dwc2: remove use of bus_to_virt()
Remove the use of bus_to_virt() and just fail the transfer if an unaligned buffer with no virtual address is found. AFAIK that can't happen anyway. Also change setting of coherent DMA mask to the normal 32 bits. 31 bits was only needed when calling bus_to_virt() AFAICR. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Tested-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0cf31f8629
commit
25a494457c
|
@ -1,7 +1,6 @@
|
||||||
config USB_DWC2
|
config USB_DWC2
|
||||||
tristate "DesignWare USB2 DRD Core Support"
|
tristate "DesignWare USB2 DRD Core Support"
|
||||||
depends on USB
|
depends on USB
|
||||||
depends on VIRT_TO_BUS
|
|
||||||
help
|
help
|
||||||
Say Y or M here if your system has a Dual Role HighSpeed
|
Say Y or M here if your system has a Dual Role HighSpeed
|
||||||
USB controller based on the DesignWare HSOTG IP Core.
|
USB controller based on the DesignWare HSOTG IP Core.
|
||||||
|
|
|
@ -2396,14 +2396,15 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
|
||||||
!(usb_pipein(urb->pipe))));
|
!(usb_pipein(urb->pipe))));
|
||||||
|
|
||||||
buf = urb->transfer_buffer;
|
buf = urb->transfer_buffer;
|
||||||
|
|
||||||
if (hcd->self.uses_dma) {
|
if (hcd->self.uses_dma) {
|
||||||
/*
|
if (!buf && (urb->transfer_dma & 3)) {
|
||||||
* Calculate virtual address from physical address, because
|
dev_err(hsotg->dev,
|
||||||
* some class driver may not fill transfer_buffer.
|
"%s: unaligned transfer with no transfer_buffer",
|
||||||
* In Buffer DMA mode virtual address is used, when handling
|
__func__);
|
||||||
* non-DWORD aligned buffers.
|
retval = -EINVAL;
|
||||||
*/
|
goto fail1;
|
||||||
buf = bus_to_virt(urb->transfer_dma);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(urb->transfer_flags & URB_NO_INTERRUPT))
|
if (!(urb->transfer_flags & URB_NO_INTERRUPT))
|
||||||
|
@ -2833,9 +2834,8 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
|
||||||
if (hsotg->core_params->dma_enable > 0) {
|
if (hsotg->core_params->dma_enable > 0) {
|
||||||
if (dma_set_mask(hsotg->dev, DMA_BIT_MASK(32)) < 0)
|
if (dma_set_mask(hsotg->dev, DMA_BIT_MASK(32)) < 0)
|
||||||
dev_warn(hsotg->dev, "can't set DMA mask\n");
|
dev_warn(hsotg->dev, "can't set DMA mask\n");
|
||||||
if (dma_set_coherent_mask(hsotg->dev, DMA_BIT_MASK(31)) < 0)
|
if (dma_set_coherent_mask(hsotg->dev, DMA_BIT_MASK(32)) < 0)
|
||||||
dev_warn(hsotg->dev,
|
dev_warn(hsotg->dev, "can't set coherent DMA mask\n");
|
||||||
"can't enable workaround for >2GB RAM\n");
|
|
||||||
} else {
|
} else {
|
||||||
dma_set_mask(hsotg->dev, 0);
|
dma_set_mask(hsotg->dev, 0);
|
||||||
dma_set_coherent_mask(hsotg->dev, 0);
|
dma_set_coherent_mask(hsotg->dev, 0);
|
||||||
|
|
Loading…
Reference in a new issue