All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Oliver Neukum' <oneukum@suse.com>,
	"gregKH@linuxfoundation.org" <gregKH@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: UAS: fix alignment of scatter/gather segments
Date: Mon, 29 Apr 2019 14:19:17 +0000	[thread overview]
Message-ID: <e22543f3d87b4867aefdf9c71e2ec4a2@AcuMS.aculab.com> (raw)

From: Oliver Neukum
> Sent: 29 April 2019 14:38
> On Mo, 2019-04-29 at 13:31 +0000, David Laight wrote:
> > From: Oliver Neukum
> > >
> > > +	 * USB has unusual scatter-gather requirements: the length of each
> > > +	 * scatterlist element except the last must be divisible by the
> > > +	 * Bulk maxpacket value.  Fortunately this value is always a
> > > +	 * power of 2.  Inform the block layer about this requirement.
> > > +	 */
> >
> > That isn't the correct restriction for XHCI.
> > It has its own perverse restrictions.
> > I think they are all handled within the xhci driver.
> 
> Yes, but that does not matter. You just cannot assume that only
> XHCI will be used with UAS. In particular virtual drivers will
> be used.

True, but there is no need to enforce a 2k (IIRC) alignment for XHCI.
Perhaps you need a different property from the controller.

Even if you decide the code is 'good enough' (I don't know what the
cost is of enforcing a 2k alignment instead of 512 bytes)
the comment is just plain wrong.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

WARNING: multiple messages have this Message-ID (diff)
From: David Laight <David.Laight@ACULAB.COM>
To: 'Oliver Neukum' <oneukum@suse.com>,
	"gregKH@linuxfoundation.org" <gregKH@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: RE: [PATCH] UAS: fix alignment of scatter/gather segments
Date: Mon, 29 Apr 2019 14:19:17 +0000	[thread overview]
Message-ID: <e22543f3d87b4867aefdf9c71e2ec4a2@AcuMS.aculab.com> (raw)
Message-ID: <20190429141917._jcVEEy-QQNQLP_wImeyOzPlPL2OJlyr6B0ssuGMFqc@z> (raw)
In-Reply-To: <1556545099.20085.14.camel@suse.com>

From: Oliver Neukum
> Sent: 29 April 2019 14:38
> On Mo, 2019-04-29 at 13:31 +0000, David Laight wrote:
> > From: Oliver Neukum
> > >
> > > +	 * USB has unusual scatter-gather requirements: the length of each
> > > +	 * scatterlist element except the last must be divisible by the
> > > +	 * Bulk maxpacket value.  Fortunately this value is always a
> > > +	 * power of 2.  Inform the block layer about this requirement.
> > > +	 */
> >
> > That isn't the correct restriction for XHCI.
> > It has its own perverse restrictions.
> > I think they are all handled within the xhci driver.
> 
> Yes, but that does not matter. You just cannot assume that only
> XHCI will be used with UAS. In particular virtual drivers will
> be used.

True, but there is no need to enforce a 2k (IIRC) alignment for XHCI.
Perhaps you need a different property from the controller.

Even if you decide the code is 'good enough' (I don't know what the
cost is of enforcing a 2k alignment instead of 512 bytes)
the comment is just plain wrong.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

             reply	other threads:[~2019-04-29 14:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 14:19 David Laight [this message]
2019-04-29 14:19 ` [PATCH] UAS: fix alignment of scatter/gather segments David Laight
  -- strict thread matches above, loose matches on Subject: below --
2019-04-30 14:39 Alan Stern
2019-04-30 14:39 ` [PATCH] " Alan Stern
2019-04-30  9:16 David Laight
2019-04-30  9:16 ` [PATCH] " David Laight
2019-04-29 19:42 Alan Stern
2019-04-29 19:42 ` [PATCH] " Alan Stern
2019-04-29 18:42 Oliver Neukum
2019-04-29 18:42 ` [PATCH] " Oliver Neukum
2019-04-29 17:55 Alan Stern
2019-04-29 17:55 ` [PATCH] " Alan Stern
2019-04-29 16:58 Oliver Neukum
2019-04-29 16:58 ` [PATCH] " Oliver Neukum
2019-04-29 16:08 Alan Stern
2019-04-29 16:08 ` [PATCH] " Alan Stern
2019-04-29 15:57 Oliver Neukum
2019-04-29 15:57 ` [PATCH] " Oliver Neukum
2019-04-29 15:06 David Laight
2019-04-29 15:06 ` [PATCH] " David Laight
2019-04-29 14:32 Oliver Neukum
2019-04-29 14:32 ` [PATCH] " Oliver Neukum
2019-04-29 13:38 Oliver Neukum
2019-04-29 13:38 ` [PATCH] " Oliver Neukum
2019-04-29 13:31 David Laight
2019-04-29 13:31 ` [PATCH] " David Laight
2019-04-29 12:20 Oliver Neukum
2019-04-29 12:20 ` [PATCH] " Oliver Neukum

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=e22543f3d87b4867aefdf9c71e2ec4a2@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=gregKH@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.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.