Thread (4 messages) 4 messages, 3 authors, 2016-08-12

Re: [PATCH v2 2/2] libata-core: do not set dev->max_sectors for LBA48 devices

From: Tom Yan <hidden>
Date: 2016-08-12 08:17:05
Also in: linux-ide, linux-scsi

On 12 August 2016 at 13:18, Tom Yan [off-list ref] wrote:
On 12 August 2016 at 10:01, Martin K. Petersen
[off-list ref] wrote:
quoted
Again, the point of max_hw_sectors and max_dev_sectors is to enforce the
hard limits of controller and device respectively. Nothing else.
Sounds like libata-scsi is doing something wrong then. It should not
set max_hw_sectors to dev->max_sectors that is set by libata-core:
quoted
blk_queue_max_hw_sectors(q, dev->max_sectors);
Though we'll still have to "abuse" max_hw_sectors for ATAPI class
devices, since neither the SATL or sr cares about VPD. The only
devices that need ATA_HORKAGE_MAX_SEC_LBA48 are ATAPI devices as well.
but instead it should report it as Maximum Transfer Length and let sd
set it as max_dev_sectors:
quoted
put_unaligned_be32(dev->max_sectors, &rbuf[8]);
While max_hw_sectors will be left untouched (in the case of AHCI, for
example, since its SCSI host template does not have max_sectors set;
so max_hw_sectors will be SCSI_DEFAULT_MAX_SECTORS).

Although that means setting dev->max_sectors to a value larger than
1024 will probably be a no-op, if that's really an issue, we should
have the host templates in libata updated.

Make sense?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help