Commit 84a44a81 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: uas: Switch to using ->device_configure to configure queue limits

Switch to the ->device_configure method instead of ->slave_alloc and update
the block limits on the passed in queue_limits instead of using the
per-limit accessors.

Note that uas was the only driver setting these size limits from
->slave_alloc and not ->slave_configure and this makes it match everyone
else.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240409143748.980206-23-hch@lst.deReviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 30efd382
...@@ -823,19 +823,19 @@ static int uas_slave_alloc(struct scsi_device *sdev) ...@@ -823,19 +823,19 @@ static int uas_slave_alloc(struct scsi_device *sdev)
(struct uas_dev_info *)sdev->host->hostdata; (struct uas_dev_info *)sdev->host->hostdata;
sdev->hostdata = devinfo; sdev->hostdata = devinfo;
if (devinfo->flags & US_FL_MAX_SECTORS_64)
blk_queue_max_hw_sectors(sdev->request_queue, 64);
else if (devinfo->flags & US_FL_MAX_SECTORS_240)
blk_queue_max_hw_sectors(sdev->request_queue, 240);
return 0; return 0;
} }
static int uas_slave_configure(struct scsi_device *sdev) static int uas_device_configure(struct scsi_device *sdev,
struct queue_limits *lim)
{ {
struct uas_dev_info *devinfo = sdev->hostdata; struct uas_dev_info *devinfo = sdev->hostdata;
if (devinfo->flags & US_FL_MAX_SECTORS_64)
lim->max_hw_sectors = 64;
else if (devinfo->flags & US_FL_MAX_SECTORS_240)
lim->max_hw_sectors = 240;
if (devinfo->flags & US_FL_NO_REPORT_OPCODES) if (devinfo->flags & US_FL_NO_REPORT_OPCODES)
sdev->no_report_opcodes = 1; sdev->no_report_opcodes = 1;
...@@ -900,7 +900,7 @@ static const struct scsi_host_template uas_host_template = { ...@@ -900,7 +900,7 @@ static const struct scsi_host_template uas_host_template = {
.queuecommand = uas_queuecommand, .queuecommand = uas_queuecommand,
.target_alloc = uas_target_alloc, .target_alloc = uas_target_alloc,
.slave_alloc = uas_slave_alloc, .slave_alloc = uas_slave_alloc,
.slave_configure = uas_slave_configure, .device_configure = uas_device_configure,
.eh_abort_handler = uas_eh_abort_handler, .eh_abort_handler = uas_eh_abort_handler,
.eh_device_reset_handler = uas_eh_device_reset_handler, .eh_device_reset_handler = uas_eh_device_reset_handler,
.this_id = -1, .this_id = -1,
......
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