Commit 8c9289e6 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

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: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240409143748.980206-13-hch@lst.deReviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b57089d3
...@@ -2497,14 +2497,15 @@ _scsih_enable_tlr(struct MPT3SAS_ADAPTER *ioc, struct scsi_device *sdev) ...@@ -2497,14 +2497,15 @@ _scsih_enable_tlr(struct MPT3SAS_ADAPTER *ioc, struct scsi_device *sdev)
} }
/** /**
* scsih_slave_configure - device configure routine. * scsih_device_configure - device configure routine.
* @sdev: scsi device struct * @sdev: scsi device struct
* @lim: queue limits
* *
* Return: 0 if ok. Any other return is assumed to be an error and * Return: 0 if ok. Any other return is assumed to be an error and
* the device is ignored. * the device is ignored.
*/ */
static int static int
scsih_slave_configure(struct scsi_device *sdev) scsih_device_configure(struct scsi_device *sdev, struct queue_limits *lim)
{ {
struct Scsi_Host *shost = sdev->host; struct Scsi_Host *shost = sdev->host;
struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
...@@ -2609,8 +2610,7 @@ scsih_slave_configure(struct scsi_device *sdev) ...@@ -2609,8 +2610,7 @@ scsih_slave_configure(struct scsi_device *sdev)
raid_device->num_pds, ds); raid_device->num_pds, ds);
if (shost->max_sectors > MPT3SAS_RAID_MAX_SECTORS) { if (shost->max_sectors > MPT3SAS_RAID_MAX_SECTORS) {
blk_queue_max_hw_sectors(sdev->request_queue, lim->max_hw_sectors = MPT3SAS_RAID_MAX_SECTORS;
MPT3SAS_RAID_MAX_SECTORS);
sdev_printk(KERN_INFO, sdev, sdev_printk(KERN_INFO, sdev,
"Set queue's max_sector to: %u\n", "Set queue's max_sector to: %u\n",
MPT3SAS_RAID_MAX_SECTORS); MPT3SAS_RAID_MAX_SECTORS);
...@@ -2675,8 +2675,7 @@ scsih_slave_configure(struct scsi_device *sdev) ...@@ -2675,8 +2675,7 @@ scsih_slave_configure(struct scsi_device *sdev)
pcie_device->connector_name); pcie_device->connector_name);
if (pcie_device->nvme_mdts) if (pcie_device->nvme_mdts)
blk_queue_max_hw_sectors(sdev->request_queue, lim->max_hw_sectors = pcie_device->nvme_mdts / 512;
pcie_device->nvme_mdts/512);
pcie_device_put(pcie_device); pcie_device_put(pcie_device);
spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); spin_unlock_irqrestore(&ioc->pcie_device_lock, flags);
...@@ -2687,8 +2686,7 @@ scsih_slave_configure(struct scsi_device *sdev) ...@@ -2687,8 +2686,7 @@ scsih_slave_configure(struct scsi_device *sdev)
**/ **/
blk_queue_flag_set(QUEUE_FLAG_NOMERGES, blk_queue_flag_set(QUEUE_FLAG_NOMERGES,
sdev->request_queue); sdev->request_queue);
blk_queue_virt_boundary(sdev->request_queue, lim->virt_boundary_mask = ioc->page_size - 1;
ioc->page_size - 1);
return 0; return 0;
} }
...@@ -11914,7 +11912,7 @@ static const struct scsi_host_template mpt2sas_driver_template = { ...@@ -11914,7 +11912,7 @@ static const struct scsi_host_template mpt2sas_driver_template = {
.queuecommand = scsih_qcmd, .queuecommand = scsih_qcmd,
.target_alloc = scsih_target_alloc, .target_alloc = scsih_target_alloc,
.slave_alloc = scsih_slave_alloc, .slave_alloc = scsih_slave_alloc,
.slave_configure = scsih_slave_configure, .device_configure = scsih_device_configure,
.target_destroy = scsih_target_destroy, .target_destroy = scsih_target_destroy,
.slave_destroy = scsih_slave_destroy, .slave_destroy = scsih_slave_destroy,
.scan_finished = scsih_scan_finished, .scan_finished = scsih_scan_finished,
...@@ -11952,7 +11950,7 @@ static const struct scsi_host_template mpt3sas_driver_template = { ...@@ -11952,7 +11950,7 @@ static const struct scsi_host_template mpt3sas_driver_template = {
.queuecommand = scsih_qcmd, .queuecommand = scsih_qcmd,
.target_alloc = scsih_target_alloc, .target_alloc = scsih_target_alloc,
.slave_alloc = scsih_slave_alloc, .slave_alloc = scsih_slave_alloc,
.slave_configure = scsih_slave_configure, .device_configure = scsih_device_configure,
.target_destroy = scsih_target_destroy, .target_destroy = scsih_target_destroy,
.slave_destroy = scsih_slave_destroy, .slave_destroy = scsih_slave_destroy,
.scan_finished = scsih_scan_finished, .scan_finished = scsih_scan_finished,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment