Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1556518

Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration

From Mathias Nyman <mathias.nyman@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration
Date 2017-01-11 15:30 +0100
Message-ID <sYs4y-7ZN-29@gated-at.bofh.it> (permalink)
References <sMs0h-2MT-5@gated-at.bofh.it> <sMs0h-2MT-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 17.11.2016 13:43, Sriram Dash wrote:
> From: Arnd Bergmann <arnd@arndb.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@arndb.de>
> Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
> Tested-by: Baolin Wang <baolin.wang@linaro.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 haven't tested that it won't break anything on PCI XHCI controllers though

-Mathias  

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration Mathias Nyman <mathias.nyman@linux.intel.com> - 2017-01-11 15:30 +0100
  Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration Alan Stern <stern@rowland.harvard.edu> - 2017-01-11 16:10 +0100
    Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration Roger Quadros <rogerq@ti.com> - 2017-01-12 09:40 +0100

csiph-web