All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Rob Herring <robh@kernel.org>,
	Nava kishore Manne <nava.manne@xilinx.com>,
	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	[thread overview]
Message-ID: <4542055.HvdgVkDRYK@wuerfel> (raw)
In-Reply-To: <20160412140338.GA19311@rob-hp-laptop>

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 <navam@xilinx.com>
> > ---
> >  .../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

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Axi-usb: Add support for 64-bit addressing.
Date: Sun, 17 Apr 2016 15:14:34 +0200	[thread overview]
Message-ID: <4542055.HvdgVkDRYK@wuerfel> (raw)
In-Reply-To: <20160412140338.GA19311@rob-hp-laptop>

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 <navam@xilinx.com>
> > ---
> >  .../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

  reply	other threads:[~2016-04-17 13:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11  7:41 [PATCH] Axi-usb: Add support for 64-bit addressing Nava kishore Manne
2016-04-11  7:41 ` Nava kishore Manne
2016-04-11  7:41 ` Nava kishore Manne
2016-04-11  8:08 ` kbuild test robot
2016-04-11  8:08   ` kbuild test robot
2016-04-11  8:08   ` kbuild test robot
2016-04-17 14:09   ` Arnd Bergmann
2016-04-17 14:09     ` Arnd Bergmann
2016-04-12 14:03 ` Rob Herring
2016-04-12 14:03   ` Rob Herring
2016-04-17 13:14   ` Arnd Bergmann [this message]
2016-04-17 13:14     ` Arnd Bergmann
2016-04-18 14:29     ` Rob Herring
2016-04-18 14:29       ` Rob Herring
2016-04-18 14:29       ` Rob Herring
2016-04-18 14:35       ` Arnd Bergmann
2016-04-18 14:35         ` Arnd Bergmann
2016-04-18 14:35         ` Arnd Bergmann
2016-04-19  9:15         ` Nava kishore Manne
2016-04-19  9:15           ` Nava kishore Manne
2016-04-19  9:15           ` Nava kishore Manne
2016-04-19 14:07           ` Arnd Bergmann
2016-04-19 14:07             ` Arnd Bergmann
2016-04-19 14:07             ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4542055.HvdgVkDRYK@wuerfel \
    --to=arnd@arndb.de \
    --cc=balbi@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hyun.kwon@xilinx.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=michal.simek@xilinx.com \
    --cc=nava.manne@xilinx.com \
    --cc=navam@xilinx.com \
    --cc=pawel.moll@arm.com \
    --cc=radhey.shyam.pandey@xilinx.com \
    --cc=robh@kernel.org \
    --cc=soren.brinkmann@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.