From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753533AbcD0SJG (ORCPT ); Wed, 27 Apr 2016 14:09:06 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:63614 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753867AbcD0SJB (ORCPT ); Wed, 27 Apr 2016 14:09:01 -0400 From: Arnd Bergmann To: Alan Stern Cc: linux-arm-kernel@lists.infradead.org, Felipe Balbi , Grygorii Strashko , Catalin Marinas , Yoshihiro Shimoda , linux-usb@vger.kernel.org, Sekhar Nori , linux-kernel@vger.kernel.org, David Fisher , "Thang Q. Nguyen" , Greg Kroah-Hartman Subject: Re: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev Date: Wed, 27 Apr 2016 20:08:16 +0200 Message-ID: <13248156.8VXoeOzRlg@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:UR7hAZPzZKsi2xEak9sBZlon3y2WTtCTiFxuyVYvaRUiWB3Qlh9 YKEsM9fLcgc4w+if+YEH0l4lVzB2nmyDXjQjyoP1stn/KLiMVMUvyXzfHg9gV9WPwpM2ohs BEhN+objxec3iV+rDgAdPUsk1//zdPY2dk7Z2eYR2AhZrFZ+JsC4qaKlK+gNmIZjyI/T5Uo ED9MVaTN3pPQO/gUqRz7A== X-UI-Out-Filterresults: notjunk:1;V01:K0:k6H9W4kaCxI=:E8plDIK37Qw89zMz9GfjBy LqQasCFBNYL4nJmPtYgllLyw5AetSvFCKKMZrFrhqA929VCG+IQiNQAjcEeTUWwOEs7yOs6X7 9VIh4ItTYoCSP1eXS1HlSmJuU2/8deaW2oqdvO/lJb1MgFp1F8AXE83sTYeECfA/L1UAnhrTM SukR+dpyTj5k0JLuK4TsDOMUpVOT13yb3DDy0uEAycucf3/DOCK7HybDaUTzb93ZJm84hRcCm As2BCl8rF6mTvzFoAZ8ubVypR3hRrrsoy8hJMdvMzDlTSpLXAg6xkhmIfIK9BRdbviId7bj60 XT8iUJuDkewC/6ISRt55DhUFunrFvMxwv4FjGKr50j3AtR4k9E0UU8sebUuIlXVq/fKwqoLap iMgTMVzAr34Qt3mrUlccIq7ECkvZQ34noAXBUQlpZIBVDkre0OvWjeCQEn/a1Qwc5zC10gEM0 5MTH9BA+kzkCbc+Z3C8NwFg98XuVYVlWSpe64Ro1Iay92phq2xi9fh1JPfEWHUmS8svSsiHm/ CqXvyC0RYA7YChpwdo62RsHA7HPiNtEDYpcpxzOF3UL8wdeptdBeEqFLLB2XKt4eQ6D/mkHYW 0emrsiv4M5hyfPM6Yw0WxZPKyYL2k39F4izHC1MykTXzKzzAQ9c2VZRqPGe3E1DkMls23TUCo l0TUyRBEJ20hhyxph9DIiy3wiTtOJrDfJUFOnKUCkq79U0mevgOkfKSTJ6aJH5J/DVvva7tSl spzzKwZKEeXVcfYA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 27 April 2016 13:59:13 Alan Stern wrote: > On Wed, 27 Apr 2016, Arnd Bergmann wrote: > > > I've looked at the usb HCD code now and see this: > > > > struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver, > > struct device *dev, const char *bus_name, > > struct usb_hcd *primary_hcd) > > { > > ... > > hcd->self.controller = dev; > > hcd->self.uses_dma = (dev->dma_mask != NULL); > > ... > > } > > > > What I think we need to do here is ensure that the device that gets > > passed here and assigned to hcd->self.controller is the actual DMA > > master device, i.e. the pci_device or platform_device that was created > > from outside of the xhci stack. This is after all the pointer that > > gets passed into all the dma_map_*/dma_sync_*/dma_alloc_*/... > > functions. > > It would be better to add a new field, since self.controller is also > used for lots of other purposes. Something like hcd->self.dma_dev. > Ok, fair enough. I only took a brief look and all uses I found were either for the DMA mapping API or some printk logging. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Wed, 27 Apr 2016 20:08:16 +0200 Subject: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev In-Reply-To: References: Message-ID: <13248156.8VXoeOzRlg@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wednesday 27 April 2016 13:59:13 Alan Stern wrote: > On Wed, 27 Apr 2016, Arnd Bergmann wrote: > > > I've looked at the usb HCD code now and see this: > > > > struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver, > > struct device *dev, const char *bus_name, > > struct usb_hcd *primary_hcd) > > { > > ... > > hcd->self.controller = dev; > > hcd->self.uses_dma = (dev->dma_mask != NULL); > > ... > > } > > > > What I think we need to do here is ensure that the device that gets > > passed here and assigned to hcd->self.controller is the actual DMA > > master device, i.e. the pci_device or platform_device that was created > > from outside of the xhci stack. This is after all the pointer that > > gets passed into all the dma_map_*/dma_sync_*/dma_alloc_*/... > > functions. > > It would be better to add a new field, since self.controller is also > used for lots of other purposes. Something like hcd->self.dma_dev. > Ok, fair enough. I only took a brief look and all uses I found were either for the DMA mapping API or some printk logging. Arnd