linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Gilbert <dgilbert@interlog.com>
To: Alan Stern <stern@rowland.harvard.edu>, Christoph Hellwig <hch@lst.de>
Cc: "Kenneth R. Crudup" <kenny@panix.com>,
	linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
	linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net
Subject: Re: Issues with commit 34b48db6 ("block: remove artifical max_hw_sectors cap")
Date: Tue, 30 Dec 2014 11:19:07 -0500	[thread overview]
Message-ID: <54A2D07B.4040607@interlog.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1412301017060.30572-100000@netrider.rowland.org>

On 14-12-30 10:34 AM, Alan Stern wrote:
> On Tue, 30 Dec 2014, Christoph Hellwig wrote:
>
>>> The only limits usb-storage imposes on max_sectors are those needed to
>>> work around bugs in the devices' USB bridges.  (Okay, there's also
>>> something for tape drive devices, but it probably doesn't belong in
>>> usb-storage -- it should be handled by the SCSI tape driver.)
>>>
>>> If the ATA layer needs to set a limit on max_sectors, why doesn't it
>>> simply go ahead and do so?
>>
>> Because the ATA layer doesn't control the device, the bridge does.
>> And it seems like it doesn't communicate the maximum transfer size
>> properly.
>
> _Is_ there any way to communicate the maximum transfer size?  I'm not
> aware of any SCSI command for it.  It isn't part of the USB
> mass-storage spec.

In SCSI, the VPD page 0xb0 (Block limits) has a "Maximum transfer
length" field (32 bits long). Its units are logical blocks. Useful
if >0 as 0 means "unreported".

USB to SATA bridges should comply with SAT. However SAT and SAT-2
don't even mention that VPD page. SAT-3 and SAT-4 mention that page
but have "unspecified" next to that field. Basically useless.


IMO about the best SATL is in the MPT SAS-2 and SAS-3 HBAs and
here is that page for a SAS expander attached SATA disk:

# sg_vpd -p bl /dev/sg3
Block limits VPD page (SBC):
   Write same non-zero (WSNZ): 0
   Maximum compare and write length: 0 blocks
   Optimal transfer length granularity: 0 blocks
   Maximum transfer length: 0 blocks
   Optimal transfer length: 0 blocks
   Maximum prefetch length: 0 blocks
   Maximum unmap LBA count: 0
   Maximum unmap block descriptor count: 0
   Optimal unmap granularity: 0
   Unmap granularity alignment valid: 0
   Unmap granularity alignment: 0
   Maximum write same length: 0x0 blocks
   Maximum atomic transfer length: 0
   Atomic alignment: 0
   Atomic transfer length granularity: 0
   Maximum atomic transfer length with atomic boundary: 0
   Maximum atomic boundary size: 0

Not sure why LSI/Avago even bothered even implementing
that page ...

Doug Gilbert


BTW here is the output of that page from a SAS SSD:

# sg_vpd -p bl /dev/sg5
Block limits VPD page (SBC):
   Write same non-zero (WSNZ): 0
   Maximum compare and write length: 0 blocks
   Optimal transfer length granularity: 8 blocks
   Maximum transfer length: 65535 blocks
   Optimal transfer length: 0 blocks
   Maximum prefetch length: 0 blocks
   Maximum unmap LBA count: 393216
   Maximum unmap block descriptor count: 512
   Optimal unmap granularity: 8
   Unmap granularity alignment valid: 0
   Unmap granularity alignment: 0
   Maximum write same length: 0x0 blocks
   Maximum atomic transfer length: 0
   Atomic alignment: 0
   Atomic transfer length granularity: 0
   Maximum atomic transfer length with atomic boundary: 0
   Maximum atomic boundary size: 0





  parent reply	other threads:[~2014-12-30 16:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.2.10.1412211420560.4323@tosh-p75a>
2014-12-23  8:31 ` Issues with commit 34b48db6 ("block: remove artifical max_hw_sectors cap") Christoph Hellwig
2014-12-24  7:48   ` Kenneth R. Crudup
2014-12-24  8:18     ` Kenneth R. Crudup
2014-12-27 15:13     ` Christoph Hellwig
2014-12-29  3:10       ` Alan Stern
2014-12-30 11:28         ` Christoph Hellwig
2014-12-30 15:34           ` Alan Stern
2014-12-30 15:50             ` James Bottomley
2014-12-30 16:12               ` Alan Stern
     [not found]                 ` <Pine.LNX.4.44L0.1412301109050.32416-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-12-30 16:25                   ` James Bottomley
2014-12-30 16:45                     ` Alan Stern
2014-12-30 16:54                       ` James Bottomley
2014-12-30 16:19             ` Douglas Gilbert [this message]
2014-12-30 16:36               ` Kenneth R. Crudup
2015-01-05 17:19                 ` Christoph Hellwig
2015-01-05 20:07                   ` Alan Stern
2015-01-05 20:19                     ` Kenneth R. Crudup
2015-01-19  9:45                     ` Kenneth R. Crudup
2015-01-19 15:55                       ` Alan Stern
2015-01-19 22:59                         ` Kenneth R. Crudup
2015-02-08 22:11                         ` Kenneth R. Crudup
2015-01-05 17:18               ` Christoph Hellwig

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=54A2D07B.4040607@interlog.com \
    --to=dgilbert@interlog.com \
    --cc=hch@lst.de \
    --cc=kenny@panix.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).