From: Tom Yan
Currently we use dev->max_sectors to set max_hw_sectors, which
is actually supposed to be a host controller limit (that get set
by the host controller driver like ahci, and if not it would be
the fallback SCSI_DEFAULT_MAX_SECTORS).
That means we have been doing the wrong thing. The
From: Tom Yan
The SCSI disk driver sets max_sectors to BLK_DEF_MAX_SECTORS when
the device does not report Optimal Transfer Length. However, it
checks only whether it is smaller than max_hw_sectors, but not
max_dev_sectors.
Signed-off-by: Tom Yan
diff --git a/drivers/scsi/sd.c b/drivers/scsi/s
From: Tom Yan
The SCSI disk driver sets max_sector to BLK_DEF_MAX_SECTORS when
the device does not report Optimal Transfer Length. However, it
checks only whether it is smaller than max_hw_sectors, but not
max_dev_sectors.
Signed-off-by: Tom Yan
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd
From: Tom Yan
Currently we use dev->max_sectors to set max_hw_sectors, which
is actually supposed to be a host controller limit (that get set
by the host controller driver like ahci, and if not it would be
the fallback SCSI_DEFAULT_MAX_SECTORS).
That means we have been doing the wrong thing. The
From: Tom Yan
WRITE SAME (16) command can technically handle up to 32-bit
number of blocks. However, since 32-bit is also the limitation of
the maximum number of bytes that can be represented in the block
layer, the current SD_MAX_WS16_BLOCKS was hence derived from the
technical limit devided by
From: Tom Yan
Currently we advertise Maximum Write Same Length based on the
maximum number of sectors that one-block TRIM payload can cover.
The field are used to derived discard_max_bytes and
write_same_max_bytes limits in the block layer, which currently can
at max be 0x (32-bit).
Howe
From: Tom Yan
When the request queue is initialized (see __scsi_init_queue() in
scsi_lib.c), the block layer limit max_hw_sectors is set to
shost->max_sectors, which will be set to the "machine infinity"
SCSI_DEFAULT_MAX_SECTORS (currently 1024) if sht->max_sectors is
not set (see scsi_host_alloc
From: Tom Yan
Currently block layer limit max_hw_sectors is set to
ATA_MAX_SECTORS_LBA48 (65535), for devices with LBA48 support.
However, block layer limit max_sectors (which is the effective
one; also adjustable, upper-bounded by max_hw_sectors) is set to
BLK_DEF_MAX_SECTORS (currently 2560) b
From: Tom Yan
Along with commit 1dc8fff24187 ("libata-scsi: do not call
blk_queue_max_hw_sectors()"), devices with LBA48 support will have
max_sectors set to SCSI_DEFAULT_MAX_SECTORS (currently 1024), by
the scsi driver.
Note that the "max_sectors" here is actually the block layer limit
"max_hw_
From: Tom Yan
We should just let the scsi driver (hosts.c) call the function. It
has better heuristic anyway (i.e. use SCSI_DEFAULT_MAX_SECTORS as
fallback when max_sectors is not set).
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 2bdb5da..495d916 100644
--- a/drivers
10 matches
Mail list logo