[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1701111008240.1900-100000@iolanthe.rowland.org>
Date: Wed, 11 Jan 2017 10:08:42 -0500 (EST)
From: Alan Stern <stern@...land.harvard.edu>
To: Mathias Nyman <mathias.nyman@...ux.intel.com>
cc: Sriram Dash <sriram.dash@....com>, <linux-kernel@...r.kernel.org>,
<linux-usb@...r.kernel.org>, <mathias.nyman@...el.com>,
<gregkh@...uxfoundation.org>, <suresh.gupta@....com>,
<felipe.balbi@...ux.intel.com>, <pku.leo@...il.com>,
Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration
On Wed, 11 Jan 2017, Mathias Nyman wrote:
> On 17.11.2016 13:43, Sriram Dash wrote:
> > From: Arnd Bergmann <arnd@...db.de>
> >
> > For xhci-hcd platform device, all the DMA parameters are not
> > configured properly, notably dma ops for dwc3 devices. So, set
> > the dma for xhci from sysdev. sysdev is pointing to device that
> > is known to the system firmware or hardware.
> >
> > Signed-off-by: Arnd Bergmann <arnd@...db.de>
> > Signed-off-by: Sriram Dash <sriram.dash@....com>
> > Tested-by: Baolin Wang <baolin.wang@...aro.org>
> > ---
>
> ...
>
> > + /*
> > + * sysdev must point to a device that is known to the system firmware
> > + * or PCI hardware. We handle these three cases here:
> > + * 1. xhci_plat comes from firmware
> > + * 2. xhci_plat is child of a device from firmware (dwc3-plat)
> > + * 3. xhci_plat is grandchild of a pci device (dwc3-pci)
> > + */
> > + sysdev = &pdev->dev;
> > + if (sysdev->parent && !sysdev->of_node && sysdev->parent->of_node)
> > + sysdev = sysdev->parent;
> > +#ifdef CONFIG_PCI
> > + else if (sysdev->parent && sysdev->parent->parent &&
> > + sysdev->parent->parent->bus == &pci_bus_type)
> > + sysdev = sysdev->parent->parent;
> > +#endif
> > +
>
> Not maybe the the ideal situation here, and looks really tailored to make PCI dwc3
> controllers with xhci support work.
>
> Was there some reason child devices can't automatically inherit the dma mask from the parents,
> forcing us to dig it from grandparents?
>
> Anyway, looks like the dwc3 part is already in 4.10-rc,
> If Greg and Alan want to take this series that's fine by me
I have no objections.
Alan Stern
> I haven't tested that it won't break anything on PCI XHCI controllers though
>
> -Mathias
Powered by blists - more mailing lists