From: Grygorii Strashko Subject: Re: [PATCH v5 1/6] usb: separate out sysdev pointer from usb_bus Date: Fri, 6 Jan 2017 13:33:14 -0600 Message-ID: <9db2c3f1-aa70-97c2-830c-6ec5454903d9@ti.com> References: <1479383028-27701-2-git-send-email-sriram.dash@nxp.com> <20161203001953.GA123997@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20161203001953.GA123997-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+glpar-linux-rockchip=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Brian Norris , Sriram Dash Cc: Peter Chen , Catalin Marinas , mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Dann Frazier , gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, Yoshihiro Shimoda , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Stephen Boyd , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Bjorn Andersson , David Fisher , "Thang Q. Nguyen" , stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org, Ming Lei , suresh.gupta-3arQi8VN3Tc@public.gmane.org, Sinjan Kumar , pku.leo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Jon Masters , Arnd Bergmann List-Id: linux-rockchip.vger.kernel.org On 12/02/2016 06:19 PM, Brian Norris wrote: > Hi all, > > On Thu, Nov 17, 2016 at 05:13:43PM +0530, Sriram Dash wrote: >> From: Arnd Bergmann >> >> For xhci-hcd platform device, all the DMA parameters are not >> configured properly, notably dma ops for dwc3 devices. >> >> The idea here is that you pass in the parent of_node along with >> the child device pointer, so it would behave exactly like the >> parent already does. The difference is that it also handles all >> the other attributes besides the mask. >> >> sysdev will represent the physical device, as seen from firmware >> or bus.Splitting the usb_bus->controller field into the >> Linux-internal device (used for the sysfs hierarchy, for printks >> and for power management) and a new pointer (used for DMA, >> DT enumeration and phy lookup) probably covers all that we really >> need. >> >> Signed-off-by: Arnd Bergmann >> Signed-off-by: Sriram Dash >> Tested-by: Baolin Wang >> Cc: Felipe Balbi >> Cc: Grygorii Strashko >> Cc: Sinjan Kumar >> Cc: David Fisher >> Cc: Catalin Marinas >> Cc: "Thang Q. Nguyen" >> Cc: Yoshihiro Shimoda >> Cc: Stephen Boyd >> Cc: Bjorn Andersson >> Cc: Ming Lei >> Cc: Jon Masters >> Cc: Dann Frazier >> Cc: Peter Chen >> Cc: Leo Li >> --- >> Changes in v5: >> - No update >> >> Changes in v4: >> - No update >> >> Changes in v3: >> - usb is_device_dma_capable instead of directly accessing >> dma props. >> >> Changes in v2: >> - Split the patch wrt driver > > I didn't notice this series had been reposted a few times. For some > reason, this wasn't that easy to find in search engines... Anyway, when > the whole series is applied, this fixes my XHCI probe issues for DWC3 > host mode. Thanks! > > Tested-by: Brian Norris > > But I noticed that Felipe has applied patches 5 and 6 in -next, while > the rest are still outstanding. That means I hit the dma_mask WARN_ON() > in xhci-plat.c, and it eventually fails to probe with -EIO still: > > [ 2.060272] ------------[ cut here ]------------ > [ 2.064908] WARNING: CPU: 5 PID: 1 at drivers/usb/host/xhci-plat.c:159 xhci_plat_probe+0x5c/0x444 > ... > [ 2.288885] [] xhci_plat_probe+0x5c/0x444 > [ 2.294456] [] platform_drv_probe+0x60/0xac > [ 2.300200] [] driver_probe_device+0x12c/0x2a0 > [ 2.306204] [] __driver_attach+0x84/0xb0 > [ 2.311687] [] bus_for_each_dev+0x9c/0xcc > [ 2.317256] [] driver_attach+0x2c/0x34 > [ 2.322566] [] bus_add_driver+0xf0/0x1f4 > [ 2.328049] [] driver_register+0x9c/0xe8 > [ 2.333530] [] __platform_driver_register+0x60/0x6c > [ 2.339968] [] xhci_plat_init+0x2c/0x34 > [ 2.345366] [] do_one_initcall+0xa4/0x13c > [ 2.350936] [] kernel_init_freeable+0x1bc/0x274 > [ 2.357026] [] kernel_init+0x18/0x104 > [ 2.362247] [] ret_from_fork+0x10/0x50 > [ 2.374615] xhci-hcd: probe of xhci-hcd.1.auto failed with error -5 > [ 2.380962] ------------[ cut here ]------------ > [ 2.385588] WARNING: CPU: 4 PID: 1 at drivers/usb/host/xhci-plat.c:159 xhci_plat_probe+0x5c/0x444 > ... > [ 2.637372] [] xhci_plat_probe+0x5c/0x444 > [ 2.642941] [] platform_drv_probe+0x60/0xac > [ 2.648685] [] driver_probe_device+0x12c/0x2a0 > [ 2.654688] [] __driver_attach+0x84/0xb0 > [ 2.660170] [] bus_for_each_dev+0x9c/0xcc > [ 2.665739] [] driver_attach+0x2c/0x34 > [ 2.671048] [] bus_add_driver+0xf0/0x1f4 > [ 2.676532] [] driver_register+0x9c/0xe8 > [ 2.682012] [] __platform_driver_register+0x60/0x6c > [ 2.688450] [] xhci_plat_init+0x2c/0x34 > [ 2.693845] [] do_one_initcall+0xa4/0x13c > [ 2.699415] [] kernel_init_freeable+0x1bc/0x274 > [ 2.705505] [] kernel_init+0x18/0x104 > [ 2.710726] [] ret_from_fork+0x10/0x50 > [ 2.716075] xhci-hcd: probe of xhci-hcd.2.auto failed with error -5 > > What's happening with patches 1-4? > I can observe this warning also with 4.10-rc2 11.709204] ------------[ cut here ]------------ [ 11.709218] WARNING: CPU: 0 PID: 163 at drivers/usb/host/xhci-plat.c:168 xhci_plat_probe+0x180/0x450 [xhci_plat_hcd] [ 11.709220] Modules linked in: xhci_plat_hcd(+) xhci_hcd usbcore dwc3 udc_core usb_common evdev snd_soc_simple_card snd_soc_simple_card_utils omapfb cfbfillrect cfbimgblt encoder_tpd12s015 connector_hdmi cfbcopyarea leds_gpi4 [ 11.709308] CPU: 0 PID: 163 Comm: systemd-udevd Not tainted 4.10.0-rc2-00328-g0eeded4-dirty #124 [ 11.709310] Hardware name: Generic DRA74X (Flattened Device Tree) [ 11.709326] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 11.709334] [] (show_stack) from [] (dump_stack+0xac/0xe0) [ 11.709345] [] (dump_stack) from [] (__warn+0xd8/0x104) [ 11.709354] [] (__warn) from [] (warn_slowpath_null+0x20/0x28) [ 11.709365] [] (warn_slowpath_null) from [] (xhci_plat_probe+0x180/0x450 [xhci_plat_hcd]) [ 11.709401] [] (xhci_plat_probe [xhci_plat_hcd]) from [] (platform_drv_probe+0x4c/0xb0) [ 11.709409] [] (platform_drv_probe) from [] (driver_probe_device+0x200/0x2d4) [ 11.709418] [] (driver_probe_device) from [] (__driver_attach+0xc0/0xc4) [ 11.709426] [] (__driver_attach) from [] (bus_for_each_dev+0x6c/0xa0) [ 11.709434] [] (bus_for_each_dev) from [] (bus_add_driver+0x18c/0x214) [ 11.709441] [] (bus_add_driver) from [] (driver_register+0x78/0xf8) [ 11.709447] [] (driver_register) from [] (do_one_initcall+0x3c/0x174) [ 11.709454] [] (do_one_initcall) from [] (do_init_module+0x5c/0x1d0) [ 11.709463] [] (do_init_module) from [] (load_module+0x1d48/0x23a8) [ 11.709472] [] (load_module) from [] (SyS_finit_module+0xa4/0xb8) [ 11.709481] [] (SyS_finit_module) from [] (__sys_trace_return+0x0/0x10) [ 11.709524] ---[ end trace 2744875bad6cd18f ]--- [ 11.709757] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller -- regards, -grygorii