]> git.baikalelectronics.ru Git - kernel.git/commit
ata: libata-scsi: Fix initialization of device queue depth
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Sat, 24 Sep 2022 05:44:11 +0000 (14:44 +0900)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Wed, 28 Sep 2022 11:47:26 +0000 (20:47 +0900)
commit5c03f40f4216ef30c51c1dd66d5a7f61e27f59c2
tree449bc4f791f4cfca63a2d6a960359876acd85a77
parent9842dd2a2b685f636528a21f3fbe4021153098ab
ata: libata-scsi: Fix initialization of device queue depth

For SATA devices supporting NCQ, drivers using libsas first initialize a
scsi device queue depth based on the controller and device capabilities,
leading to the scsi device queue_depth field being 32 (ATA maximum queue
depth) for most setup. However, if libata was loaded using the
force=[ID]]noncq argument, the default queue depth should be set to 1 to
reflect the fact that queuable commands will never be used. This is
consistent with manually setting a device queue depth to 1 through sysfs
as that disables NCQ use for the device.

Fix ata_scsi_dev_config() to honor the noncq parameter by sertting the
device queue depth to 1 for devices that do not have the ATA_DFLAG_NCQ
flag set.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: John Garry <john.garry@huawei.com>
drivers/ata/libata-scsi.c