From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753105AbcDQNPZ (ORCPT ); Sun, 17 Apr 2016 09:15:25 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:49699 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753026AbcDQNPX (ORCPT ); Sun, 17 Apr 2016 09:15:23 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Rob Herring , Nava kishore Manne , mark.rutland@arm.com, devicetree@vger.kernel.org, navam@xilinx.com, hyun.kwon@xilinx.com, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, gregkh@linuxfoundation.org, radhey.shyam.pandey@xilinx.com, michal.simek@xilinx.com, balbi@ti.com, linux-kernel@vger.kernel.org, galak@codeaurora.org, soren.brinkmann@xilinx.com Subject: Re: [PATCH] Axi-usb: Add support for 64-bit addressing. Date: Sun, 17 Apr 2016 15:14:34 +0200 Message-ID: <4542055.HvdgVkDRYK@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20160412140338.GA19311@rob-hp-laptop> References: <1460360506-14692-1-git-send-email-navam@xilinx.com> <20160412140338.GA19311@rob-hp-laptop> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:kz7GU/u6Ods0u95LpehCCjXwzS6A8jcnQQp1UdVq82G71fsg6gy hcnY3ldu5Bdyo7QY1fzxhMsmljGSkBvmUgIasiKtbyt0m+dGPC4V9vfw6GLAXFQZGdgi0aA 4Taf1RkDGy6pENCQmNxUzgbnxK1r0WVEzi5t80Rv34WY5py5CSNQh5SJN+Jqqq6S0Vyiray Gh06Fdf044zGJ1HOencNw== X-UI-Out-Filterresults: notjunk:1;V01:K0:kLJf7KOMaF4=:5jriRx/AGXrBvVw2ZNpnlf 6QLIHJGXo5lXRFsLMKsrSqs01aDT7o2yrK3HRlAjd8TYtH69v0lZkGKhhIIkpojlgyH86IIM/ 1NKnt1bjbsps++EoTbsZ/+t2D3X2NTnSn3U4KZpIsIX/OyyJdey7UL1i/8adrUkEYnRW7V/se vu2DEuPMyEBFJoWL/esJP0Ihp1Jo/LEkDoECzm71sAql4/SgyfM/6RFGbZl+C0zAg2Of2FZLO T3SiAdq7hIhazzz9oHzQqwUpa4ntnIrKdSqLmvSKGHW9pla+ZVWxN7zmwkbtIVPpG8KV10rIw 23N8SSOfd7A44StWU+9b7ZqddK/Aua8hl7TqCt+/pNyB6UCPJmDR2wDyCpA8E/ZlrS6KA4lhe gUwWDSOTjweBYsO+WgnC9Xd82+Vkxj2E/4U8WoK9+e87KDSCfjHjmHmGFlBwxmN4JXL69yfXk QBXz/zXbriUA1Mvj+OFz4CzPYzK6p1WX4OXU/ux8ONF6SfrsYObY6sdrjvEPMxPGM4gU9h3lh Xackw/QSoVFIezHJYR+akqamdtx71U5849jEAu4Zi6soj+G695+dbkC5NIGwBeaCv4U7kWXWQ 5DA92A/jKITEP0vP+TpagAUp0AVkkIXDVd90BobUZbXbri37JUgabPnqOr76UhaTsZQ6hBMui dlR3kbgfNVro8cmQ3WosPkSu968B0T143daEWkEuZOnaYWE+Zf4inQxYRj1iXDtWI6GgkRcoH VQ64ZuNs3fJptlQe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 12 April 2016 09:03:38 Rob Herring wrote: > On Mon, Apr 11, 2016 at 01:11:46PM +0530, Nava kishore Manne wrote: > > This patch updates the driver to support 64-bit DMA > > addressing. > > > > Signed-off-by: Nava kishore Manne > > --- > > .../devicetree/bindings/usb/udc-xilinx.txt | 3 +- > > drivers/usb/gadget/udc/udc-xilinx.c | 38 ++++++++++++++++++++-- > > 2 files changed, 37 insertions(+), 4 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/usb/udc-xilinx.txt b/Documentation/devicetree/bindings/usb/udc-xilinx.txt > > index 47b4e39..d417872 100644 > > --- a/Documentation/devicetree/bindings/usb/udc-xilinx.txt > > +++ b/Documentation/devicetree/bindings/usb/udc-xilinx.txt > > @@ -7,12 +7,13 @@ Required properties: > > - interrupts : Should contain single irq line of USB2 device > > controller > > - xlnx,has-builtin-dma : if DMA is included > > - > > +- xlnx,addrwidth : Should be the dma addressing size in bits(ex: 40 bits). > > Now this property shows up in a 2nd device. Now I'm more convinced this > is the wrong approach and should use dma-ranges. Not necessarily: We need to be careful not to mix up two different things here: * dma-ranges describes the address width of a bus, along with possible offsets. In order to do wider than 32-bit addressing, all upstream busses must be capable of supporting this, and AXI can have either 64-bit or 32-bit addressing. * A device may have a register set that allows wider DMA. This is normally identified through the 'compatible' property, and you can have all combinations with bus addressing: a device with 32-bit DMA can be connected to a 64-bit AXI bus, and a device with 64-bit DMA can have an upstream parent or grandparent that is limited to 32 bits (or any other width really). The patch here is almost certainly wrong. For one thing, it never sets the DMA mask to the correct value, and it also infers the presence of the 0x308..0x317 register range from an arbitrary DT property that describes something else (the supported width of the DMA). Someone with access to the data sheet of the hardware should look up what the device capabilities actually are, and add the necessary properties accordingly. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Sun, 17 Apr 2016 15:14:34 +0200 Subject: [PATCH] Axi-usb: Add support for 64-bit addressing. In-Reply-To: <20160412140338.GA19311@rob-hp-laptop> References: <1460360506-14692-1-git-send-email-navam@xilinx.com> <20160412140338.GA19311@rob-hp-laptop> Message-ID: <4542055.HvdgVkDRYK@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tuesday 12 April 2016 09:03:38 Rob Herring wrote: > On Mon, Apr 11, 2016 at 01:11:46PM +0530, Nava kishore Manne wrote: > > This patch updates the driver to support 64-bit DMA > > addressing. > > > > Signed-off-by: Nava kishore Manne > > --- > > .../devicetree/bindings/usb/udc-xilinx.txt | 3 +- > > drivers/usb/gadget/udc/udc-xilinx.c | 38 ++++++++++++++++++++-- > > 2 files changed, 37 insertions(+), 4 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/usb/udc-xilinx.txt b/Documentation/devicetree/bindings/usb/udc-xilinx.txt > > index 47b4e39..d417872 100644 > > --- a/Documentation/devicetree/bindings/usb/udc-xilinx.txt > > +++ b/Documentation/devicetree/bindings/usb/udc-xilinx.txt > > @@ -7,12 +7,13 @@ Required properties: > > - interrupts : Should contain single irq line of USB2 device > > controller > > - xlnx,has-builtin-dma : if DMA is included > > - > > +- xlnx,addrwidth : Should be the dma addressing size in bits(ex: 40 bits). > > Now this property shows up in a 2nd device. Now I'm more convinced this > is the wrong approach and should use dma-ranges. Not necessarily: We need to be careful not to mix up two different things here: * dma-ranges describes the address width of a bus, along with possible offsets. In order to do wider than 32-bit addressing, all upstream busses must be capable of supporting this, and AXI can have either 64-bit or 32-bit addressing. * A device may have a register set that allows wider DMA. This is normally identified through the 'compatible' property, and you can have all combinations with bus addressing: a device with 32-bit DMA can be connected to a 64-bit AXI bus, and a device with 64-bit DMA can have an upstream parent or grandparent that is limited to 32 bits (or any other width really). The patch here is almost certainly wrong. For one thing, it never sets the DMA mask to the correct value, and it also infers the presence of the 0x308..0x317 register range from an arbitrary DT property that describes something else (the supported width of the DMA). Someone with access to the data sheet of the hardware should look up what the device capabilities actually are, and add the necessary properties accordingly. Arnd