提交 eb21a74a 编写于 作者: P Pawel Laszczak 提交者: Greg Kroah-Hartman

usb: cdns3: Fix for incorrect DMA mask.

This patch restores the correct DMA mask after switching back to device
mode.
The issue occurred because Device part of controller use 32 bits DMA and
Host side use 64 bits DMA. During loading XHCI driver the DMA mask
used by driver is overwritten by XHCI driver so it must be restored
to 32 bits.
Reported-by: NPawel Laszczak <pawell@cadence.com>
Signed-off-by: NRoger Quadros <rogerq@ti.com>
Signed-off-by: NPawel Laszczak <pawell@cadence.com>
Fixes: 7733f6c3 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Reviewed-by: NPeter Chen <peter.chen@nxp.com>
Tested-by: NRoger Quadros <rogerq@ti.com>
Link: https://lore.kernel.org/r/1570449803-15299-1-git-send-email-pawell@cadence.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 02ffc26d
......@@ -2663,6 +2663,13 @@ static int __cdns3_gadget_init(struct cdns3 *cdns)
{
int ret = 0;
/* Ensure 32-bit DMA Mask in case we switched back from Host mode */
ret = dma_set_mask_and_coherent(cdns->dev, DMA_BIT_MASK(32));
if (ret) {
dev_err(cdns->dev, "Failed to set dma mask: %d\n", ret);
return ret;
}
cdns3_drd_switch_gadget(cdns, 1);
pm_runtime_get_sync(cdns->dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册