public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] usb:xhci: update condition to select bus->sysdev from parent device
@ 2017-08-19  3:43 Thang Q. Nguyen
  2017-08-24  2:53 ` Thang Q. Nguyen
  0 siblings, 1 reply; 4+ messages in thread
From: Thang Q. Nguyen @ 2017-08-19  3:43 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman, linux-usb, linux-kernel
  Cc: Thang Nguyen, Tung Nguyen, Phong Vo, Loc Ho, patches

From: "Thang Q. Nguyen" <tqnguyen@apm.com>

For commit 4c39d4b949d3 ("usb: xhci: use bus->sysdev for DMA
configuration"), sysdev points to devices known to the system firmware
or hardware for DMA parameters.
However, the parent of the system firmware/hardware device checking
logic does not work in ACPI boot mode. This patch updates the formulation
to check this case in both DT and ACPI.

Signed-off-by: Tung Nguyen <tunguyen@apm.com>
Signed-off-by: Thang Q. Nguyen <tqnguyen@apm.com>
---
Change since v1:
 - Update codes to work with kernel 4.13-rc5
---
 drivers/usb/host/xhci-plat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index c04144b..1bb9729 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -187,7 +187,10 @@ static int xhci_plat_probe(struct platform_device *pdev)
 	 * 3. xhci_plat is grandchild of a pci device (dwc3-pci)
 	 */
 	sysdev = &pdev->dev;
-	if (sysdev->parent && !sysdev->of_node && sysdev->parent->of_node)
+	if (sysdev->parent && !is_of_node(sysdev->fwnode) &&
+			!is_acpi_device_node(sysdev->fwnode) &&
+			(is_of_node(sysdev->parent->fwnode) ||
+			 is_acpi_device_node(sysdev->parent->fwnode)))
 		sysdev = sysdev->parent;
 #ifdef CONFIG_PCI
 	else if (sysdev->parent && sysdev->parent->parent &&
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-06  6:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-19  3:43 [PATCH v2 1/1] usb:xhci: update condition to select bus->sysdev from parent device Thang Q. Nguyen
2017-08-24  2:53 ` Thang Q. Nguyen
2017-09-05 11:14   ` Mathias Nyman
     [not found]     ` <CAKrQpSvP9nwCM7C4cxiwbvOqk-s=CxaoOJ8tCaYBCJvZ=rcUrw@mail.gmail.com>
2017-09-06  6:32       ` Mathias Nyman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox