Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751626AbdHSDo1 (ORCPT ); Fri, 18 Aug 2017 23:44:27 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:35113 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751243AbdHSDo0 (ORCPT ); Fri, 18 Aug 2017 23:44:26 -0400 From: "Thang Q. Nguyen" To: Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Thang Nguyen , Tung Nguyen , Phong Vo , Loc Ho , patches@apm.com Subject: [PATCH v2 1/1] usb:xhci: update condition to select bus->sysdev from parent device Date: Sat, 19 Aug 2017 10:43:40 +0700 Message-Id: <1503114220-30971-1-git-send-email-tqnguyen@apm.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1361 Lines: 36 From: "Thang Q. Nguyen" 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 Signed-off-by: Thang Q. Nguyen --- 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