From 4c5b785727058dfb0d3df1e3062adfeefa1260ca Mon Sep 17 00:00:00 2001 From: Mayank Rana Date: Tue, 20 Mar 2018 10:47:43 -0700 Subject: [PATCH] xhci-plat: Use USB glue driver device as sysdev Currently xhci-plat's parent device is used as sysdev whereas USB driver related page mapping is crated using xhci-plat's parent device's parent device (i.e. USB glue driver device). This results into SMMU page fault when XHCI controller is trying to access queued URB. Fix this issue by checking sysdev is having property "linux,sysdev_is_parent" set, and if it is set, use sysdev->parent as sysdev. Change-Id: Iabf5b661b756c109663ad8b11a5a1dd9330c1171 Signed-off-by: Mayank Rana Signed-off-by: Hemant Kumar --- drivers/usb/host/xhci-plat.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 1d597f8d5c44..008f30234a71 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -193,6 +193,14 @@ static int xhci_plat_probe(struct platform_device *pdev) if (!sysdev) sysdev = &pdev->dev; + /* + * If sysdev dev is having parent i.e. "linux,sysdev_is_parent" is true, + * then use sysdev->parent device. + */ + if (sysdev->parent && sysdev->parent->of_node && + device_property_read_bool(sysdev, "linux,sysdev_is_parent")) + sysdev = sysdev->parent; + /* Try to set 64-bit DMA first */ if (WARN_ON(!sysdev->dma_mask)) /* Platform did not initialize dma_mask */