Commit 9042fb6d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: mpi3mr: Pass queue_limits to bsg_setup_queue()

Pass the limits to bsg_setup_queue() instead of setting them up on the live
queue.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240409143748.980206-4-hch@lst.deReviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4373d2ec
...@@ -1845,6 +1845,10 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc) ...@@ -1845,6 +1845,10 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc)
{ {
struct device *bsg_dev = &mrioc->bsg_dev; struct device *bsg_dev = &mrioc->bsg_dev;
struct device *parent = &mrioc->shost->shost_gendev; struct device *parent = &mrioc->shost->shost_gendev;
struct queue_limits lim = {
.max_hw_sectors = MPI3MR_MAX_APP_XFER_SECTORS,
.max_segments = MPI3MR_MAX_APP_XFER_SEGMENTS,
};
device_initialize(bsg_dev); device_initialize(bsg_dev);
...@@ -1860,20 +1864,14 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc) ...@@ -1860,20 +1864,14 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc)
return; return;
} }
mrioc->bsg_queue = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), NULL, mrioc->bsg_queue = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), &lim,
mpi3mr_bsg_request, NULL, 0); mpi3mr_bsg_request, NULL, 0);
if (IS_ERR(mrioc->bsg_queue)) { if (IS_ERR(mrioc->bsg_queue)) {
ioc_err(mrioc, "%s: bsg registration failed\n", ioc_err(mrioc, "%s: bsg registration failed\n",
dev_name(bsg_dev)); dev_name(bsg_dev));
device_del(bsg_dev); device_del(bsg_dev);
put_device(bsg_dev); put_device(bsg_dev);
return;
} }
blk_queue_max_segments(mrioc->bsg_queue, MPI3MR_MAX_APP_XFER_SEGMENTS);
blk_queue_max_hw_sectors(mrioc->bsg_queue, MPI3MR_MAX_APP_XFER_SECTORS);
return;
} }
/** /**
......
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