Skip to content

Commit 9042fb6

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
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: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: John Garry <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 4373d2e commit 9042fb6

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/scsi/mpi3mr/mpi3mr_app.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,6 +1845,10 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc)
18451845
{
18461846
struct device *bsg_dev = &mrioc->bsg_dev;
18471847
struct device *parent = &mrioc->shost->shost_gendev;
1848+
struct queue_limits lim = {
1849+
.max_hw_sectors = MPI3MR_MAX_APP_XFER_SECTORS,
1850+
.max_segments = MPI3MR_MAX_APP_XFER_SEGMENTS,
1851+
};
18481852

18491853
device_initialize(bsg_dev);
18501854

@@ -1860,20 +1864,14 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc)
18601864
return;
18611865
}
18621866

1863-
mrioc->bsg_queue = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), NULL,
1867+
mrioc->bsg_queue = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), &lim,
18641868
mpi3mr_bsg_request, NULL, 0);
18651869
if (IS_ERR(mrioc->bsg_queue)) {
18661870
ioc_err(mrioc, "%s: bsg registration failed\n",
18671871
dev_name(bsg_dev));
18681872
device_del(bsg_dev);
18691873
put_device(bsg_dev);
1870-
return;
18711874
}
1872-
1873-
blk_queue_max_segments(mrioc->bsg_queue, MPI3MR_MAX_APP_XFER_SEGMENTS);
1874-
blk_queue_max_hw_sectors(mrioc->bsg_queue, MPI3MR_MAX_APP_XFER_SECTORS);
1875-
1876-
return;
18771875
}
18781876

18791877
/**

0 commit comments

Comments
 (0)