From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751773AbdBIGUx (ORCPT ); Thu, 9 Feb 2017 01:20:53 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:43294 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751420AbdBIGUu (ORCPT ); Thu, 9 Feb 2017 01:20:50 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AB760609FF Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vivek.gautam@codeaurora.org MIME-Version: 1.0 In-Reply-To: <1486372421-29073-4-git-send-email-peter.chen@nxp.com> References: <1486372421-29073-1-git-send-email-peter.chen@nxp.com> <1486372421-29073-4-git-send-email-peter.chen@nxp.com> From: Vivek Gautam Date: Thu, 9 Feb 2017 11:50:32 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v12 3/9] usb: separate out sysdev pointer from usb_bus To: Peter Chen Cc: Greg KH , Alan Stern , Ulf Hansson , broonie@kernel.org, sre@kernel.org, "robh+dt" , shawnguo@kernel.org, rjw@rjwysocki.net, Dmitry Eremin-Solenikov , =?UTF-8?Q?Heiko_St=C3=BCbner?= , "linux-arm-kernel@lists.infradead.org" , p.zabel@pengutronix.de, "devicetree@vger.kernel.org" , Pawel Moll , Mark Rutland , Linux USB Mailing List , Arnd Bergmann , s.hauer@pengutronix.de, mail@maciej.szmigiero.name, troy.kisky@boundarydevices.com, Fabio Estevam , oscar@naiandei.net, Stephen Boyd , linux-pm@vger.kernel.org, Joshua Clayton , "linux-kernel@vger.kernel.org" , mka@chromium.org, Vaibhav Hiremath , Gary Bisson , Hans Verkuil , krzk@kernel.org, Sriram Dash , Mathias Nyman , Felipe Balbi , Grygorii Strashko , Sinjan Kumar , David Fisher , Catalin Marinas , "Thang Q. Nguyen" , Yoshihiro Shimoda , Stephen Boyd , Bjorn Andersson , Ming Lei , Jon Masters , Dann Frazier , Leo Li Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Feb 6, 2017 at 2:43 PM, Peter Chen 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 > Tested-by: Brian Norris > Tested-by: Alexander Sverdlin > Tested-by: Vivek Gautam > Signed-off-by: Mathias Nyman > 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 > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vivek Gautam Subject: Re: [PATCH v12 3/9] usb: separate out sysdev pointer from usb_bus Date: Thu, 9 Feb 2017 11:50:32 +0530 Message-ID: References: <1486372421-29073-1-git-send-email-peter.chen@nxp.com> <1486372421-29073-4-git-send-email-peter.chen@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <1486372421-29073-4-git-send-email-peter.chen@nxp.com> Sender: linux-pm-owner@vger.kernel.org To: Peter Chen Cc: Greg KH , Alan Stern , Ulf Hansson , broonie@kernel.org, sre@kernel.org, robh+dt , shawnguo@kernel.org, rjw@rjwysocki.net, Dmitry Eremin-Solenikov , =?UTF-8?Q?Heiko_St=C3=BCbner?= , "linux-arm-kernel@lists.infradead.org" , p.zabel@pengutronix.de, "devicetree@vger.kernel.org" , Pawel Moll , Mark Rutland , Linux USB Mailing List , Arnd Bergmann , s.hauer@pengutronix.de, mail@maciej.szmigiero.name, troy.kisky@boundarydevices.com, Fabio Estevam , oscar@naiandei.net List-Id: devicetree@vger.kernel.org Hi, On Mon, Feb 6, 2017 at 2:43 PM, Peter Chen 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 > Tested-by: Brian Norris > Tested-by: Alexander Sverdlin > Tested-by: Vivek Gautam > Signed-off-by: Mathias Nyman > 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 > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: vivek.gautam@codeaurora.org (Vivek Gautam) Date: Thu, 9 Feb 2017 11:50:32 +0530 Subject: [PATCH v12 3/9] usb: separate out sysdev pointer from usb_bus In-Reply-To: <1486372421-29073-4-git-send-email-peter.chen@nxp.com> References: <1486372421-29073-1-git-send-email-peter.chen@nxp.com> <1486372421-29073-4-git-send-email-peter.chen@nxp.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, On Mon, Feb 6, 2017 at 2:43 PM, Peter Chen 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 > Tested-by: Brian Norris > Tested-by: Alexander Sverdlin > Tested-by: Vivek Gautam > Signed-off-by: Mathias Nyman > 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 > --- > 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