]> git.baikalelectronics.ru Git - kernel.git/commit
ata: libata-scsi: cap ata_device->max_sectors according to shost->max_sectors
authorJohn Garry <john.garry@huawei.com>
Thu, 14 Jul 2022 11:15:29 +0000 (19:15 +0800)
committerChristoph Hellwig <hch@lst.de>
Tue, 19 Jul 2022 09:11:49 +0000 (11:11 +0200)
commit392e7f75b6ac605affabe964e193fc6528551707
tree22e9e584d86563236ef6f0a3efa999fa6834e7c4
parent0c7e49280d2e53b32197adb22f0176685a7e3f79
ata: libata-scsi: cap ata_device->max_sectors according to shost->max_sectors

ATA devices (struct ata_device) have a max_sectors field which is
configured internally in libata. This is then used to (re)configure the
associated sdev request queue max_sectors value from how it is earlier set
in __scsi_init_queue(). In __scsi_init_queue() the max_sectors value is set
according to shost limits, which includes host DMA mapping limits.

Cap the ata_device max_sectors according to shost->max_sectors to respect
this shost limit.

Signed-off-by: John Garry <john.garry@huawei.com>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/ata/libata-scsi.c