From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756963AbcIGI3v (ORCPT ); Wed, 7 Sep 2016 04:29:51 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:58183 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754265AbcIGI3s (ORCPT ); Wed, 7 Sep 2016 04:29:48 -0400 From: Arnd Bergmann To: Roger Quadros Cc: linux-arm-kernel@lists.infradead.org, Alan Stern , Felipe Balbi , Grygorii Strashko , Stuart Yoder , Catalin Marinas , Yoshihiro Shimoda , "linux-usb@vger.kernel.org" , Sekhar Nori , Russell King - ARM Linux , lkml , Scott Wood , David Fisher , "Thang Q. Nguyen" , Leo Li , Greg Kroah-Hartman Subject: Re: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev Date: Wed, 07 Sep 2016 10:29:25 +0200 Message-ID: <8802454.xFheq55hVP@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <340685cd-7f06-21db-94cb-a87d0df36286@ti.com> References: <5147808.apZTAZ3VPE@wuerfel> <340685cd-7f06-21db-94cb-a87d0df36286@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:PG9NmBLnKI+/lYwJnDlJwUXwJtRuCywZfun7b7szazm767lYZt2 2SCtq7hC1w4Lef2wCrPClRjNN/4whJtuGQHTnu89Ub+Z7xS6aateDFfthq8eUjBw8ZNrL/V OR2Klgqp0uNwYaPgDvsxs5pdnOXmFeUv/ovkTm6tSPqIIbGY+QKfkIExn10uhy+ngWj6v9V GJSP30Uxm2TB5/x/XVn4A== X-UI-Out-Filterresults: notjunk:1;V01:K0:c40sWIbmRBE=:HgN6tOhbm6a+JZCuoE2ok+ F++J979tsqq7wPXRVfaEdrNeBT9hsA3tcX7gyOcLJTqDKrvMBVrDllXdOdAJT+fgOf137/PxO 7v8SthCN9t+fvocGyCYSIWy+xFsHbQDUmPVomIUofhewrNRsAeX91k3PJAJyGOQ+g8Q5JTGpc BXzK9blr+Bk+ciMkPnbmSyH6eo1uqPmHqRb+vTvCEUHyXd1LOR1+MrZwKjAhCqrZEVHSwGgEV N0Rk3x95L8V5WxxsTOZFak7Rim7EboYNmmKjaEJVV1ZzTCGyJlS4ukI9eio3XGLOx7ZvyYFIs Zixaa1y2N68p7KEA/YpI5zRUtwkFmkfOyd2m/9Uy8JIHUMKEAwWDE9421kcBb2/IQcD5hLbnT XFirVtwXnqyKPTYEMiOWEhRDgFsakZQR4TS7Fb7MJpKfQAtvp5lL0Np2Ov9LUrRXD9sbhNIdL GlfHdpe3CuCvpGs8jduylomT1PT1TrgIHmvMr3c46Agr69HbPCuJQvjCPATP6+rEDUH/CJ7Ul i2/EvcTzKa28GCTYEEynuzEBc36ZSV2CCnBYlQJhtwldnqHnKML7CBMdJIVssZvIgVsVus+7h UhP/wEKdeLQarcG6J62Vmb4ybzbasdXzaRbfKs8yMlbSX7KA5SDvH8dqAG3jxxv9sSeibXloN MJXC+RcWS6UjtmkUUxw72PhK381Wu+sJdGS/pXT/UgOuRNUHuSzeRJa+t57/7FE1lDOIHLnAA r6fn9orvBTP3sA1J Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, September 7, 2016 10:17:31 AM CEST Roger Quadros wrote: > > > > Speaking of that flag, I suppose we need the same logic to know where > > to look for USB devices attached to a dwc3 host when we need to describe > > them in DT. By default we look for child device nodes under the > > node of the HCD device node, but that would be wrong here too. > > I didn't get this part. Information about USB devices attached to a USB host > is never provided in DT because they are always dynamically created via > usb_new_device(), whether they are hard-wired on the board or hot-plugged. > > These USB devices inherit their DMA masks in the usb_alloc_dev() routine > whereas each interface within the USB device inherits its DMA mask in > usb_set_configuration(). We had talked about adding support for this for at least six years (probably much more), but Peter Chen finally added it this year in commit 69bec72598 ("USB: core: let USB device know device node"). The main use for it is to let you specify a MAC address for on-board ethernet devices that lack an EPROM, but any other information can be added that way too. > There is a bug in the USB core because of which the ISB device and interfaces > do not inherit dma_pfn_offset correctly for which I've sent a patch > https://lkml.org/lkml/2016/8/17/275 I'm a bit skeptical about this. Clearly if we set the dma_mask, we should also set the dma_pfn_offset, but what exactly is this used for in USB devices? As I understand it, the dma_mask/dma_pfn_offset etc is used for the DMA mapping interface, but that can't really be used on USB devices, which I assume use usb_alloc_coherent() and the URB interfaces for passing data between a USB driver and the HCD. My knowledge of USB device drivers is a bit lacking, so it's possible I'm misunderstanding things here. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Wed, 07 Sep 2016 10:29:25 +0200 Subject: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev In-Reply-To: <340685cd-7f06-21db-94cb-a87d0df36286@ti.com> References: <5147808.apZTAZ3VPE@wuerfel> <340685cd-7f06-21db-94cb-a87d0df36286@ti.com> Message-ID: <8802454.xFheq55hVP@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wednesday, September 7, 2016 10:17:31 AM CEST Roger Quadros wrote: > > > > Speaking of that flag, I suppose we need the same logic to know where > > to look for USB devices attached to a dwc3 host when we need to describe > > them in DT. By default we look for child device nodes under the > > node of the HCD device node, but that would be wrong here too. > > I didn't get this part. Information about USB devices attached to a USB host > is never provided in DT because they are always dynamically created via > usb_new_device(), whether they are hard-wired on the board or hot-plugged. > > These USB devices inherit their DMA masks in the usb_alloc_dev() routine > whereas each interface within the USB device inherits its DMA mask in > usb_set_configuration(). We had talked about adding support for this for at least six years (probably much more), but Peter Chen finally added it this year in commit 69bec72598 ("USB: core: let USB device know device node"). The main use for it is to let you specify a MAC address for on-board ethernet devices that lack an EPROM, but any other information can be added that way too. > There is a bug in the USB core because of which the ISB device and interfaces > do not inherit dma_pfn_offset correctly for which I've sent a patch > https://lkml.org/lkml/2016/8/17/275 I'm a bit skeptical about this. Clearly if we set the dma_mask, we should also set the dma_pfn_offset, but what exactly is this used for in USB devices? As I understand it, the dma_mask/dma_pfn_offset etc is used for the DMA mapping interface, but that can't really be used on USB devices, which I assume use usb_alloc_coherent() and the URB interfaces for passing data between a USB driver and the HCD. My knowledge of USB device drivers is a bit lacking, so it's possible I'm misunderstanding things here. Arnd