Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759595AbcKCRtg (ORCPT ); Thu, 3 Nov 2016 13:49:36 -0400 Received: from bear.ext.ti.com ([198.47.19.11]:56432 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759184AbcKCRte (ORCPT ); Thu, 3 Nov 2016 13:49:34 -0400 From: Grygorii Strashko Subject: Re: [PATCH v2 1/6] usb: separate out sysdev pointer from usb_bus To: Sriram Dash , , References: <1478065093-6923-1-git-send-email-sriram.dash@nxp.com> <1478065093-6923-2-git-send-email-sriram.dash@nxp.com> CC: , , , , , , Arnd Bergmann , Sinjan Kumar , David Fisher , Catalin Marinas , "Thang Q. Nguyen" , Yoshihiro Shimoda , Stephen Boyd , Bjorn Andersson , Ming Lei , Jon Masters , Dann Frazier , Peter Chen Message-ID: Date: Thu, 3 Nov 2016 12:49:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1478065093-6923-2-git-send-email-sriram.dash@nxp.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [128.247.83.173] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2883 Lines: 79 On 11/02/2016 12:38 AM, 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 > 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 v2: > - Split the patch wrt driver > > 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(-) > > diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c > index 98e39f9..1e41ef7 100644 > --- a/drivers/usb/core/buffer.c > +++ b/drivers/usb/core/buffer.c > @@ -63,7 +63,7 @@ int hcd_buffer_create(struct usb_hcd *hcd) > int i, size; > > if (!IS_ENABLED(CONFIG_HAS_DMA) || > - (!hcd->self.controller->dma_mask && > + (!hcd->self.sysdev->dma_mask && I think code shouldn't access DMA props directly, so may be is_device_dma_capable() is right API to use here (and other places). > !(hcd->driver->flags & HCD_LOCAL_MEM))) > return 0; > > @@ -72,7 +72,7 @@ int hcd_buffer_create(struct usb_hcd *hcd) > if (!size) > continue; > snprintf(name, sizeof(name), "buffer-%d", size); > - hcd->pool[i] = dma_pool_create(name, hcd->self.controller, > + hcd->pool[i] = dma_pool_create(name, hcd->self.sysdev, > size, size, 0); > if (!hcd->pool[i]) { > hcd_buffer_destroy(hcd); > @@ -127,7 +127,7 @@ void *hcd_buffer_alloc( > -- regards, -grygorii