[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFp+6iGJxWqyingm0oszWCfyw1fkhCMFKHwe5uhRGpcYWX-XOA@mail.gmail.com>
Date: Thu, 9 Feb 2017 11:50:32 +0530
From: Vivek Gautam <vivek.gautam@...eaurora.org>
To: Peter Chen <peter.chen@....com>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Alan Stern <stern@...land.harvard.edu>,
Ulf Hansson <ulf.hansson@...aro.org>, broonie@...nel.org,
sre@...nel.org, "robh+dt" <robh+dt@...nel.org>,
shawnguo@...nel.org, rjw@...ysocki.net,
Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
Heiko Stübner <heiko@...ech.de>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, p.zabel@...gutronix.de,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
Linux USB Mailing List <linux-usb@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>, s.hauer@...gutronix.de,
mail@...iej.szmigiero.name, troy.kisky@...ndarydevices.com,
Fabio Estevam <festevam@...il.com>, oscar@...andei.net,
Stephen Boyd <stephen.boyd@...aro.org>,
linux-pm@...r.kernel.org,
Joshua Clayton <stillcompiling@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
mka@...omium.org, Vaibhav Hiremath <vaibhav.hiremath@...aro.org>,
Gary Bisson <gary.bisson@...ndarydevices.com>,
Hans Verkuil <hverkuil@...all.nl>, krzk@...nel.org,
Sriram Dash <sriram.dash@....com>,
Mathias Nyman <mathias.nyman@...ux.intel.com>,
Felipe Balbi <felipe.balbi@...ux.intel.com>,
Grygorii Strashko <grygorii.strashko@...com>,
Sinjan Kumar <sinjank@...eaurora.org>,
David Fisher <david.fisher1@...opsys.com>,
Catalin Marinas <catalin.marinas@....com>,
"Thang Q. Nguyen" <tqnguyen@....com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Stephen Boyd <sboyd@...eaurora.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Ming Lei <tom.leiming@...il.com>, Jon Masters <jcm@...hat.com>,
Dann Frazier <dann.frazier@...onical.com>,
Leo Li <pku.leo@...il.com>
Subject: Re: [PATCH v12 3/9] usb: separate out sysdev pointer from usb_bus
Hi,
On Mon, Feb 6, 2017 at 2:43 PM, Peter Chen <peter.chen@....com> 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.
>
> 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 <arnd@...db.de>
> Signed-off-by: Sriram Dash <sriram.dash@....com>
> Tested-by: Baolin Wang <baolin.wang@...aro.org>
> Tested-by: Brian Norris <briannorris@...omium.org>
> Tested-by: Alexander Sverdlin <alexander.sverdlin@...ia.com>
> Tested-by: Vivek Gautam <vivek.gautam@...eaurora.org>
> Signed-off-by: Mathias Nyman <mathias.nyman@...ux.intel.com>
> Cc: Felipe Balbi <felipe.balbi@...ux.intel.com>
> Cc: Grygorii Strashko <grygorii.strashko@...com>
> Cc: Sinjan Kumar <sinjank@...eaurora.org>
> Cc: David Fisher <david.fisher1@...opsys.com>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: "Thang Q. Nguyen" <tqnguyen@....com>
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
> Cc: Stephen Boyd <sboyd@...eaurora.org>
> Cc: Bjorn Andersson <bjorn.andersson@...aro.org>
> Cc: Ming Lei <tom.leiming@...il.com>
> Cc: Jon Masters <jcm@...hat.com>
> Cc: Dann Frazier <dann.frazier@...onical.com>
> Cc: Peter Chen <peter.chen@....com>
> Cc: Leo Li <pku.leo@...il.com>
> ---
> drivers/usb/core/buffer.c | 12 ++++++------
> drivers/usb/core/hcd.c | 48 ++++++++++++++++++++++++++++-------------------
> drivers/usb/core/usb.c | 18 +++++++++---------
> include/linux/usb.h | 1 +
> include/linux/usb/hcd.h | 3 +++
> 5 files changed, 48 insertions(+), 34 deletions(-)
[snip]
> @@ -2511,8 +2512,8 @@ static void init_giveback_urb_bh(struct giveback_urb_bh *bh)
> * Return: On success, a pointer to the created and initialized HCD structure.
> * On failure (e.g. if memory is unavailable), %NULL.
> */
sorry for the noise, but a minor nit here.
The comments section above explains usb_create_shared_hcd() method
and so should be moved down to its place.
> -struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
> - struct device *dev, const char *bus_name,
> +struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver,
> + struct device *sysdev, struct device *dev, const char *bus_name,
> struct usb_hcd *primary_hcd)
> {
> struct usb_hcd *hcd;
> @@ -2553,8 +2554,9 @@ struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
>
> usb_bus_init(&hcd->self);
> hcd->self.controller = dev;
> + hcd->self.sysdev = sysdev;
> hcd->self.bus_name = bus_name;
> - hcd->self.uses_dma = (dev->dma_mask != NULL);
> + hcd->self.uses_dma = (sysdev->dma_mask != NULL);
>
> init_timer(&hcd->rh_timer);
> hcd->rh_timer.function = rh_timer_func;
> @@ -2569,6 +2571,14 @@ struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
> "USB Host Controller";
> return hcd;
> }
> +EXPORT_SYMBOL_GPL(__usb_create_hcd);
> +
> +struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
> + struct device *dev, const char *bus_name,
> + struct usb_hcd *primary_hcd)
> +{
> + return __usb_create_hcd(driver, dev, dev, bus_name, primary_hcd);
> +}
> EXPORT_SYMBOL_GPL(usb_create_shared_hcd);
Regards
Vivek
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
Powered by blists - more mailing lists