Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751190AbdHXCxi (ORCPT ); Wed, 23 Aug 2017 22:53:38 -0400 Received: from mail-it0-f53.google.com ([209.85.214.53]:37130 "EHLO mail-it0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751076AbdHXCxg (ORCPT ); Wed, 23 Aug 2017 22:53:36 -0400 MIME-Version: 1.0 In-Reply-To: <1503114220-30971-1-git-send-email-tqnguyen@apm.com> References: <1503114220-30971-1-git-send-email-tqnguyen@apm.com> From: "Thang Q. Nguyen" Date: Thu, 24 Aug 2017 09:53:34 +0700 Message-ID: Subject: Re: [PATCH v2 1/1] usb:xhci: update condition to select bus->sysdev from parent device 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8895 Lines: 177 On Sat, Aug 19, 2017 at 10:43 AM, Thang Q. Nguyen wrote: > 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 > Is there any comment about the patch? With current kernel (4.13.0-rc6), booting the Linux using ACPI boot, kernel is crashed right after probing the USB DWC3 driver with the following messages: [ 10.193176] WARNING: CPU: 0 PID: 1 at drivers/usb/host/xhci-plat.c:199 xhci_plat_probe+0x2f0/0x700 [ 10.193176] WARNING: CPU: 0 PID: 1 at drivers/usb/host/xhci-plat.c:199 xhci_plat_probe+0x2f0/0x700 [ 10.211272] Modules linked in: [ 10.211272] Modules linked in: [ 10.217457] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rc6-00066-g143c97c #4 [ 10.217457] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rc6-00066-g143c97c #4 [ 10.232727] Hardware name: AppliedMicro X-Gene Mustang Board/X-Gene Mustang Board, BIOS 3.07.09 Feb 28 2017 [ 10.232727] Hardware name: AppliedMicro X-Gene Mustang Board/X-Gene Mustang Board, BIOS 3.07.09 Feb 28 2017 [ 10.252464] task: ffff8001f3c78000 task.stack: ffff8001f3c74000 [ 10.252464] task: ffff8001f3c78000 task.stack: ffff8001f3c74000 [ 10.264383] PC is at xhci_plat_probe+0x2f0/0x700 [ 10.264383] PC is at xhci_plat_probe+0x2f0/0x700 [ 10.273727] LR is at xhci_plat_probe+0x34/0x700 [ 10.273727] LR is at xhci_plat_probe+0x34/0x700 [ 10.282906] pc : [] lr : [] pstate: 00000145 [ 10.282906] pc : [] lr : [] pstate: 00000145 [ 10.297909] sp : ffff8001f3c77c00 [ 10.297909] sp : ffff8001f3c77c00 [ 10.304608] x29: ffff8001f3c77c00 x28: 0000000000000000 [ 10.304608] x29: ffff8001f3c77c00 x28: 0000000000000000 [ 10.315360] x27: ffff000008eac808 x26: ffff000008db0454 [ 10.315360] x27: ffff000008eac808 x26: ffff000008db0454 [ 10.326113] x25: 000000000000001c x24: 0000000000000000 [ 10.326113] x25: 000000000000001c x24: 0000000000000000 [ 10.336814] x23: ffff000008fa32d0 x22: ffff8001f2bd1010 [ 10.336814] x23: ffff000008fa32d0 x22: ffff8001f2bd1010 [ 10.347532] x21: ffff8001f2bd1000 x20: ffff8001f2bd1010 [ 10.347532] x21: ffff8001f2bd1000 x20: ffff8001f2bd1010 [ 10.358215] x19: 00000000ffffffed x18: 0000000000000000 [ 10.358215] x19: 00000000ffffffed x18: 0000000000000000 [ 10.368950] x17: 0000000000030004 x16: 0000000000030000 [ 10.368950] x17: 0000000000030004 x16: 0000000000030000 [ 10.379642] x15: ffff8001f3f50400 x14: 0000000000000004 [ 10.379642] x15: ffff8001f3f50400 x14: 0000000000000004 [ 10.390403] x13: 0000000000000404 x12: 0000000000030000 [ 10.390403] x13: 0000000000000404 x12: 0000000000030000 [ 10.401173] x11: 0000000000030004 x10: ffff8001f3f50400 [ 10.401173] x11: 0000000000030004 x10: ffff8001f3f50400 [ 10.411864] x9 : 0000000000000000 x8 : 000000000000001c [ 10.411864] x9 : 0000000000000000 x8 : 000000000000001c [ 10.422616] x7 : ffff8001f3f50400 x6 : ffff8001f3f50400 [ 10.422616] x7 : ffff8001f3f50400 x6 : ffff8001f3f50400 [ 10.433360] x5 : 0000000000000000 x4 : 0000000000000000 [ 10.433360] x5 : 0000000000000000 x4 : 0000000000000000 [ 10.444103] x3 : ffff000008f245b8 x2 : ffff000008f24000 [ 10.444103] x3 : ffff000008f245b8 x2 : ffff000008f24000 [ 10.454864] x1 : 0000000000000000 x0 : 0000000000000000 [ 10.454864] x1 : 0000000000000000 x0 : 0000000000000000 [ 10.465600] Call trace: [ 10.465600] Call trace: [ 10.470546] Exception stack(0xffff8001f3c77a30 to 0xffff8001f3c77b60) [ 10.470546] Exception stack(0xffff8001f3c77a30 to 0xffff8001f3c77b60) [ 10.483561] 7a20: 00000000ffffffed 0001000000000000 [ 10.483561] 7a20: 00000000ffffffed 0001000000000000 [ 10.499386] 7a40: ffff8001f3c77c00 ffff00000874bf00 ffff8001f3c77a80 ffff00000896a3a0 [ 10.499386] 7a40: ffff8001f3c77c00 ffff00000874bf00 ffff8001f3c77a80 ffff00000896a3a0 [ 10.515312] 7a60: 0000000000000000 ffff8001f4c29758 000000000000000c 0000000000000000 [ 10.515312] 7a60: 0000000000000000 ffff8001f4c29758 000000000000000c 0000000000000000 [ 10.531110] 7a80: ffff8001f3c77a90 ffff000008964e6c ffff8001f3c77b20 ffff00000896510c [ 10.531110] 7a80: ffff8001f3c77a90 ffff000008964e6c ffff8001f3c77b20 ffff00000896510c [ 10.546908] 7aa0: 0000000000000001 ffff8001f4814a90 ffff8001f4814a80 ffff00000903efb0 [ 10.546908] 7aa0: 0000000000000001 ffff8001f4814a90 ffff8001f4814a80 ffff00000903efb0 [ 10.562714] 7ac0: 00000000014000c0 0000000080000000 0000000000000000 0000000000000000 [ 10.562714] 7ac0: 00000000014000c0 0000000080000000 0000000000000000 0000000000000000 [ 10.578564] 7ae0: ffff000008f24000 ffff000008f245b8 0000000000000000 0000000000000000 [ 10.578564] 7ae0: ffff000008f24000 ffff000008f245b8 0000000000000000 0000000000000000 [ 10.594336] 7b00: ffff8001f3f50400 ffff8001f3f50400 000000000000001c 0000000000000000 [ 10.594336] 7b00: ffff8001f3f50400 ffff8001f3f50400 000000000000001c 0000000000000000 [ 10.610228] 7b20: ffff8001f3f50400 0000000000030004 0000000000030000 0000000000000404 [ 10.610228] 7b20: ffff8001f3f50400 0000000000030004 0000000000030000 0000000000000404 [ 10.626095] 7b40: 0000000000000004 ffff8001f3f50400 0000000000030000 0000000000030004 [ 10.626095] 7b40: 0000000000000004 ffff8001f3f50400 0000000000030000 0000000000030004 [ 10.641866] [] xhci_plat_probe+0x2f0/0x700 [ 10.641866] [] xhci_plat_probe+0x2f0/0x700 [ 10.653277] [] platform_drv_probe+0x58/0xc0 [ 10.653277] [] platform_drv_probe+0x58/0xc0 [ 10.664894] [] driver_probe_device+0x214/0x2d0 [ 10.664894] [] driver_probe_device+0x214/0x2d0 [ 10.676986] [] __driver_attach+0xac/0xb0 [ 10.676986] [] __driver_attach+0xac/0xb0 [ 10.688093] [] bus_for_each_dev+0x60/0xa0 [ 10.688093] [] bus_for_each_dev+0x60/0xa0 [ 10.699355] [] driver_attach+0x20/0x28 [ 10.699355] [] driver_attach+0x20/0x28 [ 10.710073] [] bus_add_driver+0x110/0x230 [ 10.710073] [] bus_add_driver+0x110/0x230 [ 10.721447] [] driver_register+0x60/0xf8 [ 10.721447] [] driver_register+0x60/0xf8 [ 10.732606] [] __platform_driver_register+0x40/0x48 [ 10.732606] [] __platform_driver_register+0x40/0x48 [ 10.745642] [] xhci_plat_init+0x2c/0x34 [ 10.745642] [] xhci_plat_init+0x2c/0x34 [ 10.756610] [] do_one_initcall+0x38/0x120 [ 10.756610] [] do_one_initcall+0x38/0x120 [ 10.767892] [] kernel_init_freeable+0x188/0x228 [ 10.767892] [] kernel_init_freeable+0x188/0x228 [ 10.780244] [] kernel_init+0x10/0x100 [ 10.780244] [] kernel_init+0x10/0x100 [ 10.790805] [] ret_from_fork+0x10/0x50 [ 10.790805] [] ret_from_fork+0x10/0x50 [ 10.801532] ---[ end trace 505c859fb1949e61 ]--- [ 10.801532] ---[ end trace 505c859fb1949e61 ]--- [ 10.810886] ata3: SATA link down (SStatus 0 SControl 4300) [ 10.810886] ata3: SATA link down (SStatus 0 SControl 4300) [ 10.822079] xhci-hcd: probe of xhci-hcd.0.auto failed with error -5 [ 10.822079] xhci-hcd: probe of xhci-hcd.0.auto failed with error -5