Skip to content

Commit 8c9289e

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
scsi: mpt3sas: Switch to using ->device_configure
Switch to the ->device_configure method instead of ->slave_configure and update the block limits on the passed in queue_limits instead of using the per-limit accessors. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20240409143748.980206-13-hch@lst.de Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent b57089d commit 8c9289e

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

drivers/scsi/mpt3sas/mpt3sas_scsih.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2497,14 +2497,15 @@ _scsih_enable_tlr(struct MPT3SAS_ADAPTER *ioc, struct scsi_device *sdev)
24972497
}
24982498

24992499
/**
2500-
* scsih_slave_configure - device configure routine.
2500+
* scsih_device_configure - device configure routine.
25012501
* @sdev: scsi device struct
2502+
* @lim: queue limits
25022503
*
25032504
* Return: 0 if ok. Any other return is assumed to be an error and
25042505
* the device is ignored.
25052506
*/
25062507
static int
2507-
scsih_slave_configure(struct scsi_device *sdev)
2508+
scsih_device_configure(struct scsi_device *sdev, struct queue_limits *lim)
25082509
{
25092510
struct Scsi_Host *shost = sdev->host;
25102511
struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
@@ -2609,8 +2610,7 @@ scsih_slave_configure(struct scsi_device *sdev)
26092610
raid_device->num_pds, ds);
26102611

26112612
if (shost->max_sectors > MPT3SAS_RAID_MAX_SECTORS) {
2612-
blk_queue_max_hw_sectors(sdev->request_queue,
2613-
MPT3SAS_RAID_MAX_SECTORS);
2613+
lim->max_hw_sectors = MPT3SAS_RAID_MAX_SECTORS;
26142614
sdev_printk(KERN_INFO, sdev,
26152615
"Set queue's max_sector to: %u\n",
26162616
MPT3SAS_RAID_MAX_SECTORS);
@@ -2675,8 +2675,7 @@ scsih_slave_configure(struct scsi_device *sdev)
26752675
pcie_device->connector_name);
26762676

26772677
if (pcie_device->nvme_mdts)
2678-
blk_queue_max_hw_sectors(sdev->request_queue,
2679-
pcie_device->nvme_mdts/512);
2678+
lim->max_hw_sectors = pcie_device->nvme_mdts / 512;
26802679

26812680
pcie_device_put(pcie_device);
26822681
spin_unlock_irqrestore(&ioc->pcie_device_lock, flags);
@@ -2687,8 +2686,7 @@ scsih_slave_configure(struct scsi_device *sdev)
26872686
**/
26882687
blk_queue_flag_set(QUEUE_FLAG_NOMERGES,
26892688
sdev->request_queue);
2690-
blk_queue_virt_boundary(sdev->request_queue,
2691-
ioc->page_size - 1);
2689+
lim->virt_boundary_mask = ioc->page_size - 1;
26922690
return 0;
26932691
}
26942692

@@ -11914,7 +11912,7 @@ static const struct scsi_host_template mpt2sas_driver_template = {
1191411912
.queuecommand = scsih_qcmd,
1191511913
.target_alloc = scsih_target_alloc,
1191611914
.slave_alloc = scsih_slave_alloc,
11917-
.slave_configure = scsih_slave_configure,
11915+
.device_configure = scsih_device_configure,
1191811916
.target_destroy = scsih_target_destroy,
1191911917
.slave_destroy = scsih_slave_destroy,
1192011918
.scan_finished = scsih_scan_finished,
@@ -11952,7 +11950,7 @@ static const struct scsi_host_template mpt3sas_driver_template = {
1195211950
.queuecommand = scsih_qcmd,
1195311951
.target_alloc = scsih_target_alloc,
1195411952
.slave_alloc = scsih_slave_alloc,
11955-
.slave_configure = scsih_slave_configure,
11953+
.device_configure = scsih_device_configure,
1195611954
.target_destroy = scsih_target_destroy,
1195711955
.slave_destroy = scsih_slave_destroy,
1195811956
.scan_finished = scsih_scan_finished,

0 commit comments

Comments
 (0)