Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge patch series "convert SCSI to atomic queue limits, part 1 (v3)"

Christoph Hellwig <hch@lst.de> says:

Hi all,

this series converts the SCSI midlayer and LLDDs to use atomic queue
limits API. It is pretty straight forward, except for the mpt3mr
driver which does really weird and probably already broken things by
setting limits from unlocked device iteration callbacks.

I will probably defer the (more complicated) ULD changes to the next
merge window as they would heavily conflict with Damien's zone write
plugging series. With that the series could go in through the SCSI
tree if Jens' ACKs the core block layer bits.

Link: https://lore.kernel.org/r/20240409143748.980206-1-hch@lst.de
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

+345 -593
-245
block/blk-settings.c
··· 285 285 EXPORT_SYMBOL_GPL(queue_limits_set); 286 286 287 287 /** 288 - * blk_queue_bounce_limit - set bounce buffer limit for queue 289 - * @q: the request queue for the device 290 - * @bounce: bounce limit to enforce 291 - * 292 - * Description: 293 - * Force bouncing for ISA DMA ranges or highmem. 294 - * 295 - * DEPRECATED, don't use in new code. 296 - **/ 297 - void blk_queue_bounce_limit(struct request_queue *q, enum blk_bounce bounce) 298 - { 299 - q->limits.bounce = bounce; 300 - } 301 - EXPORT_SYMBOL(blk_queue_bounce_limit); 302 - 303 - /** 304 - * blk_queue_max_hw_sectors - set max sectors for a request for this queue 305 - * @q: the request queue for the device 306 - * @max_hw_sectors: max hardware sectors in the usual 512b unit 307 - * 308 - * Description: 309 - * Enables a low level driver to set a hard upper limit, 310 - * max_hw_sectors, on the size of requests. max_hw_sectors is set by 311 - * the device driver based upon the capabilities of the I/O 312 - * controller. 313 - * 314 - * max_dev_sectors is a hard limit imposed by the storage device for 315 - * READ/WRITE requests. It is set by the disk driver. 316 - * 317 - * max_sectors is a soft limit imposed by the block layer for 318 - * filesystem type requests. This value can be overridden on a 319 - * per-device basis in /sys/block/<device>/queue/max_sectors_kb. 320 - * The soft limit can not exceed max_hw_sectors. 321 - **/ 322 - void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_sectors) 323 - { 324 - struct queue_limits *limits = &q->limits; 325 - unsigned int max_sectors; 326 - 327 - if ((max_hw_sectors << 9) < PAGE_SIZE) { 328 - max_hw_sectors = 1 << (PAGE_SHIFT - 9); 329 - pr_info("%s: set to minimum %u\n", __func__, max_hw_sectors); 330 - } 331 - 332 - max_hw_sectors = round_down(max_hw_sectors, 333 - limits->logical_block_size >> SECTOR_SHIFT); 334 - limits->max_hw_sectors = max_hw_sectors; 335 - 336 - max_sectors = min_not_zero(max_hw_sectors, limits->max_dev_sectors); 337 - 338 - if (limits->max_user_sectors) 339 - max_sectors = min(max_sectors, limits->max_user_sectors); 340 - else 341 - max_sectors = min(max_sectors, BLK_DEF_MAX_SECTORS_CAP); 342 - 343 - max_sectors = round_down(max_sectors, 344 - limits->logical_block_size >> SECTOR_SHIFT); 345 - limits->max_sectors = max_sectors; 346 - 347 - if (!q->disk) 348 - return; 349 - q->disk->bdi->io_pages = max_sectors >> (PAGE_SHIFT - 9); 350 - } 351 - EXPORT_SYMBOL(blk_queue_max_hw_sectors); 352 - 353 - /** 354 288 * blk_queue_chunk_sectors - set size of the chunk for this queue 355 289 * @q: the request queue for the device 356 290 * @chunk_sectors: chunk sectors in the usual 512b unit ··· 369 435 q->limits.max_zone_append_sectors = max_sectors; 370 436 } 371 437 EXPORT_SYMBOL_GPL(blk_queue_max_zone_append_sectors); 372 - 373 - /** 374 - * blk_queue_max_segments - set max hw segments for a request for this queue 375 - * @q: the request queue for the device 376 - * @max_segments: max number of segments 377 - * 378 - * Description: 379 - * Enables a low level driver to set an upper limit on the number of 380 - * hw data segments in a request. 381 - **/ 382 - void blk_queue_max_segments(struct request_queue *q, unsigned short max_segments) 383 - { 384 - if (!max_segments) { 385 - max_segments = 1; 386 - pr_info("%s: set to minimum %u\n", __func__, max_segments); 387 - } 388 - 389 - q->limits.max_segments = max_segments; 390 - } 391 - EXPORT_SYMBOL(blk_queue_max_segments); 392 - 393 - /** 394 - * blk_queue_max_discard_segments - set max segments for discard requests 395 - * @q: the request queue for the device 396 - * @max_segments: max number of segments 397 - * 398 - * Description: 399 - * Enables a low level driver to set an upper limit on the number of 400 - * segments in a discard request. 401 - **/ 402 - void blk_queue_max_discard_segments(struct request_queue *q, 403 - unsigned short max_segments) 404 - { 405 - q->limits.max_discard_segments = max_segments; 406 - } 407 - EXPORT_SYMBOL_GPL(blk_queue_max_discard_segments); 408 - 409 - /** 410 - * blk_queue_max_segment_size - set max segment size for blk_rq_map_sg 411 - * @q: the request queue for the device 412 - * @max_size: max size of segment in bytes 413 - * 414 - * Description: 415 - * Enables a low level driver to set an upper limit on the size of a 416 - * coalesced segment 417 - **/ 418 - void blk_queue_max_segment_size(struct request_queue *q, unsigned int max_size) 419 - { 420 - if (max_size < PAGE_SIZE) { 421 - max_size = PAGE_SIZE; 422 - pr_info("%s: set to minimum %u\n", __func__, max_size); 423 - } 424 - 425 - /* see blk_queue_virt_boundary() for the explanation */ 426 - WARN_ON_ONCE(q->limits.virt_boundary_mask); 427 - 428 - q->limits.max_segment_size = max_size; 429 - } 430 - EXPORT_SYMBOL(blk_queue_max_segment_size); 431 438 432 439 /** 433 440 * blk_queue_logical_block_size - set logical block size for the queue ··· 535 660 limits->io_opt = opt; 536 661 } 537 662 EXPORT_SYMBOL(blk_limits_io_opt); 538 - 539 - /** 540 - * blk_queue_io_opt - set optimal request size for the queue 541 - * @q: the request queue for the device 542 - * @opt: optimal request size in bytes 543 - * 544 - * Description: 545 - * Storage devices may report an optimal I/O size, which is the 546 - * device's preferred unit for sustained I/O. This is rarely reported 547 - * for disk drives. For RAID arrays it is usually the stripe width or 548 - * the internal track size. A properly aligned multiple of 549 - * optimal_io_size is the preferred request size for workloads where 550 - * sustained throughput is desired. 551 - */ 552 - void blk_queue_io_opt(struct request_queue *q, unsigned int opt) 553 - { 554 - blk_limits_io_opt(&q->limits, opt); 555 - if (!q->disk) 556 - return; 557 - q->disk->bdi->ra_pages = 558 - max(queue_io_opt(q) * 2 / PAGE_SIZE, VM_READAHEAD_PAGES); 559 - } 560 - EXPORT_SYMBOL(blk_queue_io_opt); 561 663 562 664 static int queue_limit_alignment_offset(const struct queue_limits *lim, 563 665 sector_t sector) ··· 786 934 EXPORT_SYMBOL(blk_queue_update_dma_pad); 787 935 788 936 /** 789 - * blk_queue_segment_boundary - set boundary rules for segment merging 790 - * @q: the request queue for the device 791 - * @mask: the memory boundary mask 792 - **/ 793 - void blk_queue_segment_boundary(struct request_queue *q, unsigned long mask) 794 - { 795 - if (mask < PAGE_SIZE - 1) { 796 - mask = PAGE_SIZE - 1; 797 - pr_info("%s: set to minimum %lx\n", __func__, mask); 798 - } 799 - 800 - q->limits.seg_boundary_mask = mask; 801 - } 802 - EXPORT_SYMBOL(blk_queue_segment_boundary); 803 - 804 - /** 805 - * blk_queue_virt_boundary - set boundary rules for bio merging 806 - * @q: the request queue for the device 807 - * @mask: the memory boundary mask 808 - **/ 809 - void blk_queue_virt_boundary(struct request_queue *q, unsigned long mask) 810 - { 811 - q->limits.virt_boundary_mask = mask; 812 - 813 - /* 814 - * Devices that require a virtual boundary do not support scatter/gather 815 - * I/O natively, but instead require a descriptor list entry for each 816 - * page (which might not be idential to the Linux PAGE_SIZE). Because 817 - * of that they are not limited by our notion of "segment size". 818 - */ 819 - if (mask) 820 - q->limits.max_segment_size = UINT_MAX; 821 - } 822 - EXPORT_SYMBOL(blk_queue_virt_boundary); 823 - 824 - /** 825 - * blk_queue_dma_alignment - set dma length and memory alignment 826 - * @q: the request queue for the device 827 - * @mask: alignment mask 828 - * 829 - * description: 830 - * set required memory and length alignment for direct dma transactions. 831 - * this is used when building direct io requests for the queue. 832 - * 833 - **/ 834 - void blk_queue_dma_alignment(struct request_queue *q, int mask) 835 - { 836 - q->limits.dma_alignment = mask; 837 - } 838 - EXPORT_SYMBOL(blk_queue_dma_alignment); 839 - 840 - /** 841 - * blk_queue_update_dma_alignment - update dma length and memory alignment 842 - * @q: the request queue for the device 843 - * @mask: alignment mask 844 - * 845 - * description: 846 - * update required memory and length alignment for direct dma transactions. 847 - * If the requested alignment is larger than the current alignment, then 848 - * the current queue alignment is updated to the new value, otherwise it 849 - * is left alone. The design of this is to allow multiple objects 850 - * (driver, device, transport etc) to set their respective 851 - * alignments without having them interfere. 852 - * 853 - **/ 854 - void blk_queue_update_dma_alignment(struct request_queue *q, int mask) 855 - { 856 - BUG_ON(mask > PAGE_SIZE); 857 - 858 - if (mask > q->limits.dma_alignment) 859 - q->limits.dma_alignment = mask; 860 - } 861 - EXPORT_SYMBOL(blk_queue_update_dma_alignment); 862 - 863 - /** 864 937 * blk_set_queue_depth - tell the block layer about the device queue depth 865 938 * @q: the request queue for the device 866 939 * @depth: queue depth ··· 837 1060 q->required_elevator_features = features; 838 1061 } 839 1062 EXPORT_SYMBOL_GPL(blk_queue_required_elevator_features); 840 - 841 - /** 842 - * blk_queue_can_use_dma_map_merging - configure queue for merging segments. 843 - * @q: the request queue for the device 844 - * @dev: the device pointer for dma 845 - * 846 - * Tell the block layer about merging the segments by dma map of @q. 847 - */ 848 - bool blk_queue_can_use_dma_map_merging(struct request_queue *q, 849 - struct device *dev) 850 - { 851 - unsigned long boundary = dma_get_merge_boundary(dev); 852 - 853 - if (!boundary) 854 - return false; 855 - 856 - /* No need to update max_segment_size. see blk_queue_virt_boundary() */ 857 - blk_queue_virt_boundary(q, boundary); 858 - 859 - return true; 860 - } 861 - EXPORT_SYMBOL_GPL(blk_queue_can_use_dma_map_merging); 862 1063 863 1064 /** 864 1065 * disk_set_zoned - inidicate a zoned device
+4 -2
block/bsg-lib.c
··· 354 354 * bsg_setup_queue - Create and add the bsg hooks so we can receive requests 355 355 * @dev: device to attach bsg device to 356 356 * @name: device to give bsg device 357 + * @lim: queue limits for the bsg queue 357 358 * @job_fn: bsg job handler 358 359 * @timeout: timeout handler function pointer 359 360 * @dd_job_size: size of LLD data needed for each job 360 361 */ 361 362 struct request_queue *bsg_setup_queue(struct device *dev, const char *name, 362 - bsg_job_fn *job_fn, bsg_timeout_fn *timeout, int dd_job_size) 363 + struct queue_limits *lim, bsg_job_fn *job_fn, 364 + bsg_timeout_fn *timeout, int dd_job_size) 363 365 { 364 366 struct bsg_set *bset; 365 367 struct blk_mq_tag_set *set; ··· 385 383 if (blk_mq_alloc_tag_set(set)) 386 384 goto out_tag_set; 387 385 388 - q = blk_mq_alloc_queue(set, NULL, NULL); 386 + q = blk_mq_alloc_queue(set, lim, NULL); 389 387 if (IS_ERR(q)) { 390 388 ret = PTR_ERR(q); 391 389 goto out_queue;
+1 -1
drivers/ata/ahci.h
··· 397 397 .sdev_groups = ahci_sdev_groups, \ 398 398 .change_queue_depth = ata_scsi_change_queue_depth, \ 399 399 .tag_alloc_policy = BLK_TAG_ALLOC_RR, \ 400 - .slave_configure = ata_scsi_slave_config 400 + .device_configure = ata_scsi_device_configure 401 401 402 402 extern struct ata_port_operations ahci_ops; 403 403 extern struct ata_port_operations ahci_platform_ops;
+7 -4
drivers/ata/libata-sata.c
··· 1254 1254 EXPORT_SYMBOL_GPL(ata_sas_tport_delete); 1255 1255 1256 1256 /** 1257 - * ata_sas_slave_configure - Default slave_config routine for libata devices 1257 + * ata_sas_device_configure - Default device_configure routine for libata 1258 + * devices 1258 1259 * @sdev: SCSI device to configure 1260 + * @lim: queue limits 1259 1261 * @ap: ATA port to which SCSI device is attached 1260 1262 * 1261 1263 * RETURNS: 1262 1264 * Zero. 1263 1265 */ 1264 1266 1265 - int ata_sas_slave_configure(struct scsi_device *sdev, struct ata_port *ap) 1267 + int ata_sas_device_configure(struct scsi_device *sdev, struct queue_limits *lim, 1268 + struct ata_port *ap) 1266 1269 { 1267 1270 ata_scsi_sdev_config(sdev); 1268 1271 1269 - return ata_scsi_dev_config(sdev, ap->link.device); 1272 + return ata_scsi_dev_config(sdev, lim, ap->link.device); 1270 1273 } 1271 - EXPORT_SYMBOL_GPL(ata_sas_slave_configure); 1274 + EXPORT_SYMBOL_GPL(ata_sas_device_configure); 1272 1275 1273 1276 /** 1274 1277 * ata_sas_queuecmd - Issue SCSI cdb to libata-managed device
+11 -8
drivers/ata/libata-scsi.c
··· 1021 1021 } 1022 1022 EXPORT_SYMBOL_GPL(ata_scsi_dma_need_drain); 1023 1023 1024 - int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev) 1024 + int ata_scsi_dev_config(struct scsi_device *sdev, struct queue_limits *lim, 1025 + struct ata_device *dev) 1025 1026 { 1026 1027 struct request_queue *q = sdev->request_queue; 1027 1028 int depth = 1; ··· 1032 1031 1033 1032 /* configure max sectors */ 1034 1033 dev->max_sectors = min(dev->max_sectors, sdev->host->max_sectors); 1035 - blk_queue_max_hw_sectors(q, dev->max_sectors); 1034 + lim->max_hw_sectors = dev->max_sectors; 1036 1035 1037 1036 if (dev->class == ATA_DEV_ATAPI) { 1038 1037 sdev->sector_size = ATA_SECT_SIZE; ··· 1041 1040 blk_queue_update_dma_pad(q, ATA_DMA_PAD_SZ - 1); 1042 1041 1043 1042 /* make room for appending the drain */ 1044 - blk_queue_max_segments(q, queue_max_segments(q) - 1); 1043 + lim->max_segments--; 1045 1044 1046 1045 sdev->dma_drain_len = ATAPI_MAX_DRAIN; 1047 1046 sdev->dma_drain_buf = kmalloc(sdev->dma_drain_len, GFP_NOIO); ··· 1078 1077 "sector_size=%u > PAGE_SIZE, PIO may malfunction\n", 1079 1078 sdev->sector_size); 1080 1079 1081 - blk_queue_update_dma_alignment(q, sdev->sector_size - 1); 1080 + lim->dma_alignment = sdev->sector_size - 1; 1082 1081 1083 1082 if (dev->flags & ATA_DFLAG_AN) 1084 1083 set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); ··· 1132 1131 EXPORT_SYMBOL_GPL(ata_scsi_slave_alloc); 1133 1132 1134 1133 /** 1135 - * ata_scsi_slave_config - Set SCSI device attributes 1134 + * ata_scsi_device_configure - Set SCSI device attributes 1136 1135 * @sdev: SCSI device to examine 1136 + * @lim: queue limits 1137 1137 * 1138 1138 * This is called before we actually start reading 1139 1139 * and writing to the device, to configure certain ··· 1144 1142 * Defined by SCSI layer. We don't really care. 1145 1143 */ 1146 1144 1147 - int ata_scsi_slave_config(struct scsi_device *sdev) 1145 + int ata_scsi_device_configure(struct scsi_device *sdev, 1146 + struct queue_limits *lim) 1148 1147 { 1149 1148 struct ata_port *ap = ata_shost_to_port(sdev->host); 1150 1149 struct ata_device *dev = __ata_scsi_find_dev(ap, sdev); 1151 1150 1152 1151 if (dev) 1153 - return ata_scsi_dev_config(sdev, dev); 1152 + return ata_scsi_dev_config(sdev, lim, dev); 1154 1153 1155 1154 return 0; 1156 1155 } 1157 - EXPORT_SYMBOL_GPL(ata_scsi_slave_config); 1156 + EXPORT_SYMBOL_GPL(ata_scsi_device_configure); 1158 1157 1159 1158 /** 1160 1159 * ata_scsi_slave_destroy - SCSI device is about to be destroyed
+2 -1
drivers/ata/libata.h
··· 131 131 extern int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, 132 132 unsigned int id, u64 lun); 133 133 void ata_scsi_sdev_config(struct scsi_device *sdev); 134 - int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev); 134 + int ata_scsi_dev_config(struct scsi_device *sdev, struct queue_limits *lim, 135 + struct ata_device *dev); 135 136 int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, struct ata_device *dev); 136 137 137 138 /* libata-eh.c */
+6 -5
drivers/ata/pata_macio.c
··· 796 796 /* Hook the standard slave config to fixup some HW related alignment 797 797 * restrictions 798 798 */ 799 - static int pata_macio_slave_config(struct scsi_device *sdev) 799 + static int pata_macio_device_configure(struct scsi_device *sdev, 800 + struct queue_limits *lim) 800 801 { 801 802 struct ata_port *ap = ata_shost_to_port(sdev->host); 802 803 struct pata_macio_priv *priv = ap->private_data; ··· 806 805 int rc; 807 806 808 807 /* First call original */ 809 - rc = ata_scsi_slave_config(sdev); 808 + rc = ata_scsi_device_configure(sdev, lim); 810 809 if (rc) 811 810 return rc; 812 811 ··· 815 814 816 815 /* OHare has issues with non cache aligned DMA on some chipsets */ 817 816 if (priv->kind == controller_ohare) { 818 - blk_queue_update_dma_alignment(sdev->request_queue, 31); 817 + lim->dma_alignment = 31; 819 818 blk_queue_update_dma_pad(sdev->request_queue, 31); 820 819 821 820 /* Tell the world about it */ ··· 830 829 /* Shasta and K2 seem to have "issues" with reads ... */ 831 830 if (priv->kind == controller_sh_ata6 || priv->kind == controller_k2_ata6) { 832 831 /* Allright these are bad, apply restrictions */ 833 - blk_queue_update_dma_alignment(sdev->request_queue, 15); 832 + lim->dma_alignment = 15; 834 833 blk_queue_update_dma_pad(sdev->request_queue, 15); 835 834 836 835 /* We enable MWI and hack cache line size directly here, this ··· 919 918 * use 64K minus 256 920 919 */ 921 920 .max_segment_size = MAX_DBDMA_SEG, 922 - .slave_configure = pata_macio_slave_config, 921 + .device_configure = pata_macio_device_configure, 923 922 .sdev_groups = ata_common_sdev_groups, 924 923 .can_queue = ATA_DEF_QUEUE, 925 924 .tag_alloc_policy = BLK_TAG_ALLOC_RR,
+1 -1
drivers/ata/sata_mv.c
··· 673 673 .sdev_groups = ata_ncq_sdev_groups, 674 674 .change_queue_depth = ata_scsi_change_queue_depth, 675 675 .tag_alloc_policy = BLK_TAG_ALLOC_RR, 676 - .slave_configure = ata_scsi_slave_config 676 + .device_configure = ata_scsi_device_configure 677 677 }; 678 678 679 679 static struct ata_port_operations mv5_ops = {
+14 -10
drivers/ata/sata_nv.c
··· 296 296 static void nv_nf2_thaw(struct ata_port *ap); 297 297 static void nv_ck804_freeze(struct ata_port *ap); 298 298 static void nv_ck804_thaw(struct ata_port *ap); 299 - static int nv_adma_slave_config(struct scsi_device *sdev); 299 + static int nv_adma_device_configure(struct scsi_device *sdev, 300 + struct queue_limits *lim); 300 301 static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc); 301 302 static enum ata_completion_errors nv_adma_qc_prep(struct ata_queued_cmd *qc); 302 303 static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc); ··· 319 318 static void nv_mcp55_thaw(struct ata_port *ap); 320 319 static void nv_mcp55_freeze(struct ata_port *ap); 321 320 static void nv_swncq_error_handler(struct ata_port *ap); 322 - static int nv_swncq_slave_config(struct scsi_device *sdev); 321 + static int nv_swncq_device_configure(struct scsi_device *sdev, 322 + struct queue_limits *lim); 323 323 static int nv_swncq_port_start(struct ata_port *ap); 324 324 static enum ata_completion_errors nv_swncq_qc_prep(struct ata_queued_cmd *qc); 325 325 static void nv_swncq_fill_sg(struct ata_queued_cmd *qc); ··· 382 380 .can_queue = NV_ADMA_MAX_CPBS, 383 381 .sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN, 384 382 .dma_boundary = NV_ADMA_DMA_BOUNDARY, 385 - .slave_configure = nv_adma_slave_config, 383 + .device_configure = nv_adma_device_configure, 386 384 .sdev_groups = ata_ncq_sdev_groups, 387 385 .change_queue_depth = ata_scsi_change_queue_depth, 388 386 .tag_alloc_policy = BLK_TAG_ALLOC_RR, ··· 393 391 .can_queue = ATA_MAX_QUEUE - 1, 394 392 .sg_tablesize = LIBATA_MAX_PRD, 395 393 .dma_boundary = ATA_DMA_BOUNDARY, 396 - .slave_configure = nv_swncq_slave_config, 394 + .device_configure = nv_swncq_device_configure, 397 395 .sdev_groups = ata_ncq_sdev_groups, 398 396 .change_queue_depth = ata_scsi_change_queue_depth, 399 397 .tag_alloc_policy = BLK_TAG_ALLOC_RR, ··· 663 661 pp->flags &= ~NV_ADMA_PORT_REGISTER_MODE; 664 662 } 665 663 666 - static int nv_adma_slave_config(struct scsi_device *sdev) 664 + static int nv_adma_device_configure(struct scsi_device *sdev, 665 + struct queue_limits *lim) 667 666 { 668 667 struct ata_port *ap = ata_shost_to_port(sdev->host); 669 668 struct nv_adma_port_priv *pp = ap->private_data; ··· 676 673 int adma_enable; 677 674 u32 current_reg, new_reg, config_mask; 678 675 679 - rc = ata_scsi_slave_config(sdev); 676 + rc = ata_scsi_device_configure(sdev, lim); 680 677 681 678 if (sdev->id >= ATA_MAX_DEVICES || sdev->channel || sdev->lun) 682 679 /* Not a proper libata device, ignore */ ··· 743 740 rc = dma_set_mask(&pdev->dev, pp->adma_dma_mask); 744 741 } 745 742 746 - blk_queue_segment_boundary(sdev->request_queue, segment_boundary); 747 - blk_queue_max_segments(sdev->request_queue, sg_tablesize); 743 + lim->seg_boundary_mask = segment_boundary; 744 + lim->max_segments = sg_tablesize; 748 745 ata_port_info(ap, 749 746 "DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n", 750 747 (unsigned long long)*ap->host->dev->dma_mask, ··· 1871 1868 writel(~0x0, mmio + NV_INT_STATUS_MCP55); 1872 1869 } 1873 1870 1874 - static int nv_swncq_slave_config(struct scsi_device *sdev) 1871 + static int nv_swncq_device_configure(struct scsi_device *sdev, 1872 + struct queue_limits *lim) 1875 1873 { 1876 1874 struct ata_port *ap = ata_shost_to_port(sdev->host); 1877 1875 struct pci_dev *pdev = to_pci_dev(ap->host->dev); ··· 1882 1878 u8 check_maxtor = 0; 1883 1879 unsigned char model_num[ATA_ID_PROD_LEN + 1]; 1884 1880 1885 - rc = ata_scsi_slave_config(sdev); 1881 + rc = ata_scsi_device_configure(sdev, lim); 1886 1882 if (sdev->id >= ATA_MAX_DEVICES || sdev->channel || sdev->lun) 1887 1883 /* Not a proper libata device, ignore */ 1888 1884 return rc;
+1 -1
drivers/ata/sata_sil24.c
··· 381 381 .tag_alloc_policy = BLK_TAG_ALLOC_FIFO, 382 382 .sdev_groups = ata_ncq_sdev_groups, 383 383 .change_queue_depth = ata_scsi_change_queue_depth, 384 - .slave_configure = ata_scsi_slave_config 384 + .device_configure = ata_scsi_device_configure 385 385 }; 386 386 387 387 static struct ata_port_operations sil24_ops = {
+4 -9
drivers/firewire/sbp2.c
··· 1500 1500 1501 1501 sdev->allow_restart = 1; 1502 1502 1503 - /* 1504 - * SBP-2 does not require any alignment, but we set it anyway 1505 - * for compatibility with earlier versions of this driver. 1506 - */ 1507 - blk_queue_update_dma_alignment(sdev->request_queue, 4 - 1); 1508 - 1509 1503 if (lu->tgt->workarounds & SBP2_WORKAROUND_INQUIRY_36) 1510 1504 sdev->inquiry_len = 36; 1511 1505 1512 1506 return 0; 1513 1507 } 1514 1508 1515 - static int sbp2_scsi_slave_configure(struct scsi_device *sdev) 1509 + static int sbp2_scsi_device_configure(struct scsi_device *sdev, 1510 + struct queue_limits *lim) 1516 1511 { 1517 1512 struct sbp2_logical_unit *lu = sdev->hostdata; 1518 1513 ··· 1533 1538 sdev->start_stop_pwr_cond = 1; 1534 1539 1535 1540 if (lu->tgt->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS) 1536 - blk_queue_max_hw_sectors(sdev->request_queue, 128 * 1024 / 512); 1541 + lim->max_hw_sectors = 128 * 1024 / 512; 1537 1542 1538 1543 return 0; 1539 1544 } ··· 1591 1596 .proc_name = "sbp2", 1592 1597 .queuecommand = sbp2_scsi_queuecommand, 1593 1598 .slave_alloc = sbp2_scsi_slave_alloc, 1594 - .slave_configure = sbp2_scsi_slave_configure, 1599 + .device_configure = sbp2_scsi_device_configure, 1595 1600 .eh_abort_handler = sbp2_scsi_abort, 1596 1601 .this_id = -1, 1597 1602 .sg_tablesize = SG_ALL,
+1
drivers/message/fusion/mptfc.c
··· 129 129 .sg_tablesize = MPT_SCSI_SG_DEPTH, 130 130 .max_sectors = 8192, 131 131 .cmd_per_lun = 7, 132 + .dma_alignment = 511, 132 133 .shost_groups = mptscsih_host_attr_groups, 133 134 }; 134 135
+1
drivers/message/fusion/mptsas.c
··· 2020 2020 .sg_tablesize = MPT_SCSI_SG_DEPTH, 2021 2021 .max_sectors = 8192, 2022 2022 .cmd_per_lun = 7, 2023 + .dma_alignment = 511, 2023 2024 .shost_groups = mptscsih_host_attr_groups, 2024 2025 .no_write_same = 1, 2025 2026 };
-2
drivers/message/fusion/mptscsih.c
··· 2438 2438 "tagged %d, simple %d\n", 2439 2439 ioc->name,sdev->tagged_supported, sdev->simple_tags)); 2440 2440 2441 - blk_queue_dma_alignment (sdev->request_queue, 512 - 1); 2442 - 2443 2441 return 0; 2444 2442 } 2445 2443
+1
drivers/message/fusion/mptspi.c
··· 843 843 .sg_tablesize = MPT_SCSI_SG_DEPTH, 844 844 .max_sectors = 8192, 845 845 .cmd_per_lun = 7, 846 + .dma_alignment = 511, 846 847 .shost_groups = mptscsih_host_attr_groups, 847 848 }; 848 849
+3 -3
drivers/s390/block/dasd_eckd.c
··· 4561 4561 len_to_track_end = 0; 4562 4562 /* 4563 4563 * A tidaw can address 4k of memory, but must not cross page boundaries 4564 - * We can let the block layer handle this by setting 4565 - * blk_queue_segment_boundary to page boundaries and 4566 - * blk_max_segment_size to page size when setting up the request queue. 4564 + * We can let the block layer handle this by setting seg_boundary_mask 4565 + * to page boundaries and max_segment_size to page size when setting up 4566 + * the request queue. 4567 4567 * For write requests, a TIDAW must not cross track boundaries, because 4568 4568 * we have to set the CBC flag on the last tidaw for each track. 4569 4569 */
+1 -7
drivers/scsi/aha152x.c
··· 746 746 /* need to have host registered before triggering any interrupt */ 747 747 list_add_tail(&HOSTDATA(shpnt)->host_list, &aha152x_host_list); 748 748 749 + shpnt->no_highmem = true; 749 750 shpnt->io_port = setup->io_port; 750 751 shpnt->n_io_port = IO_RANGE; 751 752 shpnt->irq = setup->irq; ··· 2941 2940 return 0; 2942 2941 } 2943 2942 2944 - static int aha152x_adjust_queue(struct scsi_device *device) 2945 - { 2946 - blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH); 2947 - return 0; 2948 - } 2949 - 2950 2943 static const struct scsi_host_template aha152x_driver_template = { 2951 2944 .module = THIS_MODULE, 2952 2945 .name = AHA152X_REVID, ··· 2956 2961 .this_id = 7, 2957 2962 .sg_tablesize = SG_ALL, 2958 2963 .dma_boundary = PAGE_SIZE - 1, 2959 - .slave_alloc = aha152x_adjust_queue, 2960 2964 .cmd_size = sizeof(struct aha152x_cmd_priv), 2961 2965 }; 2962 2966
+2 -1
drivers/scsi/hisi_sas/hisi_sas.h
··· 643 643 const struct hisi_sas_hw *ops); 644 644 extern void hisi_sas_remove(struct platform_device *pdev); 645 645 646 - extern int hisi_sas_slave_configure(struct scsi_device *sdev); 646 + int hisi_sas_device_configure(struct scsi_device *sdev, 647 + struct queue_limits *lim); 647 648 extern int hisi_sas_slave_alloc(struct scsi_device *sdev); 648 649 extern int hisi_sas_scan_finished(struct Scsi_Host *shost, unsigned long time); 649 650 extern void hisi_sas_scan_start(struct Scsi_Host *shost);
+4 -3
drivers/scsi/hisi_sas/hisi_sas_main.c
··· 868 868 return rc; 869 869 } 870 870 871 - int hisi_sas_slave_configure(struct scsi_device *sdev) 871 + int hisi_sas_device_configure(struct scsi_device *sdev, 872 + struct queue_limits *lim) 872 873 { 873 874 struct domain_device *dev = sdev_to_domain_dev(sdev); 874 - int ret = sas_slave_configure(sdev); 875 + int ret = sas_device_configure(sdev, lim); 875 876 876 877 if (ret) 877 878 return ret; ··· 881 880 882 881 return 0; 883 882 } 884 - EXPORT_SYMBOL_GPL(hisi_sas_slave_configure); 883 + EXPORT_SYMBOL_GPL(hisi_sas_device_configure); 885 884 886 885 void hisi_sas_scan_start(struct Scsi_Host *shost) 887 886 {
+1 -1
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
··· 1736 1736 1737 1737 static const struct scsi_host_template sht_v1_hw = { 1738 1738 LIBSAS_SHT_BASE_NO_SLAVE_INIT 1739 - .slave_configure = hisi_sas_slave_configure, 1739 + .device_configure = hisi_sas_device_configure, 1740 1740 .scan_finished = hisi_sas_scan_finished, 1741 1741 .scan_start = hisi_sas_scan_start, 1742 1742 .sg_tablesize = HISI_SAS_SGE_PAGE_CNT,
+1 -1
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
··· 3568 3568 3569 3569 static const struct scsi_host_template sht_v2_hw = { 3570 3570 LIBSAS_SHT_BASE_NO_SLAVE_INIT 3571 - .slave_configure = hisi_sas_slave_configure, 3571 + .device_configure = hisi_sas_device_configure, 3572 3572 .scan_finished = hisi_sas_scan_finished, 3573 3573 .scan_start = hisi_sas_scan_start, 3574 3574 .sg_tablesize = HISI_SAS_SGE_PAGE_CNT,
+4 -3
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
··· 2894 2894 } 2895 2895 static DEVICE_ATTR_RO(iopoll_q_cnt_v3_hw); 2896 2896 2897 - static int slave_configure_v3_hw(struct scsi_device *sdev) 2897 + static int device_configure_v3_hw(struct scsi_device *sdev, 2898 + struct queue_limits *lim) 2898 2899 { 2899 2900 struct Scsi_Host *shost = dev_to_shost(&sdev->sdev_gendev); 2900 2901 struct hisi_hba *hisi_hba = shost_priv(shost); 2901 - int ret = hisi_sas_slave_configure(sdev); 2902 + int ret = hisi_sas_device_configure(sdev, lim); 2902 2903 struct device *dev = hisi_hba->dev; 2903 2904 2904 2905 if (ret) ··· 3322 3321 3323 3322 static const struct scsi_host_template sht_v3_hw = { 3324 3323 LIBSAS_SHT_BASE_NO_SLAVE_INIT 3325 - .slave_configure = slave_configure_v3_hw, 3324 + .device_configure = device_configure_v3_hw, 3326 3325 .scan_finished = hisi_sas_scan_finished, 3327 3326 .scan_start = hisi_sas_scan_start, 3328 3327 .map_queues = hisi_sas_map_queues,
+6
drivers/scsi/hosts.c
··· 478 478 else 479 479 shost->max_segment_size = BLK_MAX_SEGMENT_SIZE; 480 480 481 + /* 32-byte (dword) is a common minimum for HBAs. */ 482 + if (sht->dma_alignment) 483 + shost->dma_alignment = sht->dma_alignment; 484 + else 485 + shost->dma_alignment = 3; 486 + 481 487 /* 482 488 * assume a 4GB boundary, if not set 483 489 */
+4 -4
drivers/scsi/hptiop.c
··· 1151 1151 1152 1152 ATTRIBUTE_GROUPS(hptiop_host); 1153 1153 1154 - static int hptiop_slave_config(struct scsi_device *sdev) 1154 + static int hptiop_device_configure(struct scsi_device *sdev, 1155 + struct queue_limits *lim) 1155 1156 { 1156 1157 if (sdev->type == TYPE_TAPE) 1157 - blk_queue_max_hw_sectors(sdev->request_queue, 8192); 1158 - 1158 + lim->max_hw_sectors = 8192; 1159 1159 return 0; 1160 1160 } 1161 1161 ··· 1168 1168 .emulated = 0, 1169 1169 .proc_name = driver_name, 1170 1170 .shost_groups = hptiop_host_groups, 1171 - .slave_configure = hptiop_slave_config, 1171 + .device_configure = hptiop_device_configure, 1172 1172 .this_id = -1, 1173 1173 .change_queue_depth = hptiop_adjust_disk_queue_depth, 1174 1174 .cmd_size = sizeof(struct hpt_cmd_priv),
+1 -4
drivers/scsi/ibmvscsi/ibmvfc.c
··· 5541 5541 rport->supported_classes |= FC_COS_CLASS2; 5542 5542 if (be32_to_cpu(tgt->service_parms.class3_parms[0]) & 0x80000000) 5543 5543 rport->supported_classes |= FC_COS_CLASS3; 5544 - if (rport->rqst_q) 5545 - blk_queue_max_segments(rport->rqst_q, 1); 5546 5544 } else 5547 5545 tgt_dbg(tgt, "rport add failed\n"); 5548 5546 spin_unlock_irqrestore(vhost->host->host_lock, flags); ··· 6389 6391 6390 6392 ibmvfc_init_sub_crqs(vhost); 6391 6393 6392 - if (shost_to_fc_host(shost)->rqst_q) 6393 - blk_queue_max_segments(shost_to_fc_host(shost)->rqst_q, 1); 6394 6394 dev_set_drvdata(dev, vhost); 6395 6395 spin_lock(&ibmvfc_driver_lock); 6396 6396 list_add_tail(&vhost->queue, &ibmvfc_head); ··· 6543 6547 .get_starget_port_id = ibmvfc_get_starget_port_id, 6544 6548 .show_starget_port_id = 1, 6545 6549 6550 + .max_bsg_segments = 1, 6546 6551 .bsg_request = ibmvfc_bsg_request, 6547 6552 .bsg_timeout = ibmvfc_bsg_timeout, 6548 6553 };
+1 -11
drivers/scsi/imm.c
··· 1100 1100 return -ENODEV; 1101 1101 } 1102 1102 1103 - /* 1104 - * imm cannot deal with highmem, so this causes all IO pages for this host 1105 - * to reside in low memory (hence mapped) 1106 - */ 1107 - static int imm_adjust_queue(struct scsi_device *device) 1108 - { 1109 - blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH); 1110 - return 0; 1111 - } 1112 - 1113 1103 static const struct scsi_host_template imm_template = { 1114 1104 .module = THIS_MODULE, 1115 1105 .proc_name = "imm", ··· 1113 1123 .this_id = 7, 1114 1124 .sg_tablesize = SG_ALL, 1115 1125 .can_queue = 1, 1116 - .slave_alloc = imm_adjust_queue, 1117 1126 .cmd_size = sizeof(struct scsi_pointer), 1118 1127 }; 1119 1128 ··· 1224 1235 host = scsi_host_alloc(&imm_template, sizeof(imm_struct *)); 1225 1236 if (!host) 1226 1237 goto out1; 1238 + host->no_highmem = true; 1227 1239 host->io_port = pb->base; 1228 1240 host->n_io_port = ports; 1229 1241 host->dma_channel = -1;
+6 -4
drivers/scsi/ipr.c
··· 4769 4769 } 4770 4770 4771 4771 /** 4772 - * ipr_slave_configure - Configure a SCSI device 4772 + * ipr_device_configure - Configure a SCSI device 4773 4773 * @sdev: scsi device struct 4774 + * @lim: queue limits 4774 4775 * 4775 4776 * This function configures the specified scsi device. 4776 4777 * 4777 4778 * Return value: 4778 4779 * 0 on success 4779 4780 **/ 4780 - static int ipr_slave_configure(struct scsi_device *sdev) 4781 + static int ipr_device_configure(struct scsi_device *sdev, 4782 + struct queue_limits *lim) 4781 4783 { 4782 4784 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata; 4783 4785 struct ipr_resource_entry *res; ··· 4800 4798 sdev->no_report_opcodes = 1; 4801 4799 blk_queue_rq_timeout(sdev->request_queue, 4802 4800 IPR_VSET_RW_TIMEOUT); 4803 - blk_queue_max_hw_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS); 4801 + lim->max_hw_sectors = IPR_VSET_MAX_SECTORS; 4804 4802 } 4805 4803 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 4806 4804 ··· 6399 6397 .eh_device_reset_handler = ipr_eh_dev_reset, 6400 6398 .eh_host_reset_handler = ipr_eh_host_reset, 6401 6399 .slave_alloc = ipr_slave_alloc, 6402 - .slave_configure = ipr_slave_configure, 6400 + .device_configure = ipr_device_configure, 6403 6401 .slave_destroy = ipr_slave_destroy, 6404 6402 .scan_finished = ipr_scan_finished, 6405 6403 .target_destroy = ipr_target_destroy,
+1 -1
drivers/scsi/iscsi_tcp.c
··· 943 943 shost->max_id = 0; 944 944 shost->max_channel = 0; 945 945 shost->max_cmd_len = SCSI_MAX_VARLEN_CDB_SIZE; 946 + shost->dma_alignment = 0; 946 947 947 948 rc = iscsi_host_get_max_scsi_cmds(shost, cmds_max); 948 949 if (rc < 0) ··· 1066 1065 if (conn->datadgst_en) 1067 1066 blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, 1068 1067 sdev->request_queue); 1069 - blk_queue_dma_alignment(sdev->request_queue, 0); 1070 1068 return 0; 1071 1069 } 1072 1070
+4 -3
drivers/scsi/libsas/sas_scsi_host.c
··· 804 804 805 805 #define SAS_DEF_QD 256 806 806 807 - int sas_slave_configure(struct scsi_device *scsi_dev) 807 + int sas_device_configure(struct scsi_device *scsi_dev, 808 + struct queue_limits *lim) 808 809 { 809 810 struct domain_device *dev = sdev_to_domain_dev(scsi_dev); 810 811 811 812 BUG_ON(dev->rphy->identify.device_type != SAS_END_DEVICE); 812 813 813 814 if (dev_is_sata(dev)) { 814 - ata_sas_slave_configure(scsi_dev, dev->sata_dev.ap); 815 + ata_sas_device_configure(scsi_dev, lim, dev->sata_dev.ap); 815 816 return 0; 816 817 } 817 818 ··· 830 829 831 830 return 0; 832 831 } 833 - EXPORT_SYMBOL_GPL(sas_slave_configure); 832 + EXPORT_SYMBOL_GPL(sas_device_configure); 834 833 835 834 int sas_change_queue_depth(struct scsi_device *sdev, int depth) 836 835 {
+1 -1
drivers/scsi/megaraid/megaraid_sas.h
··· 2701 2701 int 2702 2702 megasas_sync_pd_seq_num(struct megasas_instance *instance, bool pend); 2703 2703 void megasas_set_dynamic_target_properties(struct scsi_device *sdev, 2704 - bool is_target_prop); 2704 + struct queue_limits *lim, bool is_target_prop); 2705 2705 int megasas_get_target_prop(struct megasas_instance *instance, 2706 2706 struct scsi_device *sdev); 2707 2707 void megasas_get_snapdump_properties(struct megasas_instance *instance);
+17 -12
drivers/scsi/megaraid/megaraid_sas_base.c
··· 1888 1888 * Returns void 1889 1889 */ 1890 1890 void megasas_set_dynamic_target_properties(struct scsi_device *sdev, 1891 - bool is_target_prop) 1891 + struct queue_limits *lim, bool is_target_prop) 1892 1892 { 1893 1893 u16 pd_index = 0, ld; 1894 1894 u32 device_id; ··· 1915 1915 return; 1916 1916 raid = MR_LdRaidGet(ld, local_map_ptr); 1917 1917 1918 - if (raid->capability.ldPiMode == MR_PROT_INFO_TYPE_CONTROLLER) 1919 - blk_queue_update_dma_alignment(sdev->request_queue, 0x7); 1918 + if (raid->capability.ldPiMode == MR_PROT_INFO_TYPE_CONTROLLER) { 1919 + if (lim) 1920 + lim->dma_alignment = 0x7; 1921 + } 1920 1922 1921 1923 mr_device_priv_data->is_tm_capable = 1922 1924 raid->capability.tmCapable; ··· 1969 1967 * 1970 1968 */ 1971 1969 static inline void 1972 - megasas_set_nvme_device_properties(struct scsi_device *sdev, u32 max_io_size) 1970 + megasas_set_nvme_device_properties(struct scsi_device *sdev, 1971 + struct queue_limits *lim, u32 max_io_size) 1973 1972 { 1974 1973 struct megasas_instance *instance; 1975 1974 u32 mr_nvme_pg_size; ··· 1979 1976 mr_nvme_pg_size = max_t(u32, instance->nvme_page_size, 1980 1977 MR_DEFAULT_NVME_PAGE_SIZE); 1981 1978 1982 - blk_queue_max_hw_sectors(sdev->request_queue, (max_io_size / 512)); 1979 + lim->max_hw_sectors = max_io_size / 512; 1980 + lim->virt_boundary_mask = mr_nvme_pg_size - 1; 1983 1981 1984 1982 blk_queue_flag_set(QUEUE_FLAG_NOMERGES, sdev->request_queue); 1985 - blk_queue_virt_boundary(sdev->request_queue, mr_nvme_pg_size - 1); 1986 1983 } 1987 1984 1988 1985 /* ··· 2044 2041 * @is_target_prop true, if fw provided target properties. 2045 2042 */ 2046 2043 static void megasas_set_static_target_properties(struct scsi_device *sdev, 2047 - bool is_target_prop) 2044 + struct queue_limits *lim, bool is_target_prop) 2048 2045 { 2049 2046 u32 max_io_size_kb = MR_DEFAULT_NVME_MDTS_KB; 2050 2047 struct megasas_instance *instance; ··· 2063 2060 max_io_size_kb = le32_to_cpu(instance->tgt_prop->max_io_size_kb); 2064 2061 2065 2062 if (instance->nvme_page_size && max_io_size_kb) 2066 - megasas_set_nvme_device_properties(sdev, (max_io_size_kb << 10)); 2063 + megasas_set_nvme_device_properties(sdev, lim, 2064 + max_io_size_kb << 10); 2067 2065 2068 2066 megasas_set_fw_assisted_qd(sdev, is_target_prop); 2069 2067 } 2070 2068 2071 2069 2072 - static int megasas_slave_configure(struct scsi_device *sdev) 2070 + static int megasas_device_configure(struct scsi_device *sdev, 2071 + struct queue_limits *lim) 2073 2072 { 2074 2073 u16 pd_index = 0; 2075 2074 struct megasas_instance *instance; ··· 2101 2096 ret_target_prop = megasas_get_target_prop(instance, sdev); 2102 2097 2103 2098 is_target_prop = (ret_target_prop == DCMD_SUCCESS) ? true : false; 2104 - megasas_set_static_target_properties(sdev, is_target_prop); 2099 + megasas_set_static_target_properties(sdev, lim, is_target_prop); 2105 2100 2106 2101 /* This sdev property may change post OCR */ 2107 - megasas_set_dynamic_target_properties(sdev, is_target_prop); 2102 + megasas_set_dynamic_target_properties(sdev, lim, is_target_prop); 2108 2103 2109 2104 mutex_unlock(&instance->reset_mutex); 2110 2105 ··· 3512 3507 .module = THIS_MODULE, 3513 3508 .name = "Avago SAS based MegaRAID driver", 3514 3509 .proc_name = "megaraid_sas", 3515 - .slave_configure = megasas_slave_configure, 3510 + .device_configure = megasas_device_configure, 3516 3511 .slave_alloc = megasas_slave_alloc, 3517 3512 .slave_destroy = megasas_slave_destroy, 3518 3513 .queuecommand = megasas_queue_command,
+2 -1
drivers/scsi/megaraid/megaraid_sas_fusion.c
··· 5119 5119 ret_target_prop = megasas_get_target_prop(instance, sdev); 5120 5120 5121 5121 is_target_prop = (ret_target_prop == DCMD_SUCCESS) ? true : false; 5122 - megasas_set_dynamic_target_properties(sdev, is_target_prop); 5122 + megasas_set_dynamic_target_properties(sdev, NULL, 5123 + is_target_prop); 5123 5124 } 5124 5125 5125 5126 status_reg = instance->instancet->read_fw_status_reg
-1
drivers/scsi/mpi3mr/mpi3mr.h
··· 1352 1352 void mpi3mr_cleanup_fwevt_list(struct mpi3mr_ioc *mrioc); 1353 1353 void mpi3mr_flush_host_io(struct mpi3mr_ioc *mrioc); 1354 1354 void mpi3mr_invalidate_devhandles(struct mpi3mr_ioc *mrioc); 1355 - void mpi3mr_refresh_tgtdevs(struct mpi3mr_ioc *mrioc); 1356 1355 void mpi3mr_flush_delayed_cmd_lists(struct mpi3mr_ioc *mrioc); 1357 1356 void mpi3mr_check_rh_fault_ioc(struct mpi3mr_ioc *mrioc, u32 reason_code); 1358 1357 void mpi3mr_print_fault_info(struct mpi3mr_ioc *mrioc);
+5 -7
drivers/scsi/mpi3mr/mpi3mr_app.c
··· 1845 1845 { 1846 1846 struct device *bsg_dev = &mrioc->bsg_dev; 1847 1847 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 + }; 1848 1852 1849 1853 device_initialize(bsg_dev); 1850 1854 ··· 1864 1860 return; 1865 1861 } 1866 1862 1867 - mrioc->bsg_queue = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), 1863 + mrioc->bsg_queue = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), &lim, 1868 1864 mpi3mr_bsg_request, NULL, 0); 1869 1865 if (IS_ERR(mrioc->bsg_queue)) { 1870 1866 ioc_err(mrioc, "%s: bsg registration failed\n", 1871 1867 dev_name(bsg_dev)); 1872 1868 device_del(bsg_dev); 1873 1869 put_device(bsg_dev); 1874 - return; 1875 1870 } 1876 - 1877 - blk_queue_max_segments(mrioc->bsg_queue, MPI3MR_MAX_APP_XFER_SEGMENTS); 1878 - blk_queue_max_hw_sectors(mrioc->bsg_queue, MPI3MR_MAX_APP_XFER_SECTORS); 1879 - 1880 - return; 1881 1871 } 1882 1872 1883 1873 /**
+31 -45
drivers/scsi/mpi3mr/mpi3mr_os.c
··· 986 986 return retval; 987 987 } 988 988 989 + static void mpi3mr_configure_nvme_dev(struct mpi3mr_tgt_dev *tgt_dev, 990 + struct queue_limits *lim) 991 + { 992 + u8 pgsz = tgt_dev->dev_spec.pcie_inf.pgsz ? : MPI3MR_DEFAULT_PGSZEXP; 993 + 994 + lim->max_hw_sectors = tgt_dev->dev_spec.pcie_inf.mdts / 512; 995 + lim->virt_boundary_mask = (1 << pgsz) - 1; 996 + } 997 + 998 + static void mpi3mr_configure_tgt_dev(struct mpi3mr_tgt_dev *tgt_dev, 999 + struct queue_limits *lim) 1000 + { 1001 + if (tgt_dev->dev_type == MPI3_DEVICE_DEVFORM_PCIE && 1002 + (tgt_dev->dev_spec.pcie_inf.dev_info & 1003 + MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_MASK) == 1004 + MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_NVME_DEVICE) 1005 + mpi3mr_configure_nvme_dev(tgt_dev, lim); 1006 + } 1007 + 989 1008 /** 990 1009 * mpi3mr_update_sdev - Update SCSI device information 991 1010 * @sdev: SCSI device reference ··· 1020 1001 mpi3mr_update_sdev(struct scsi_device *sdev, void *data) 1021 1002 { 1022 1003 struct mpi3mr_tgt_dev *tgtdev; 1004 + struct queue_limits lim; 1023 1005 1024 1006 tgtdev = (struct mpi3mr_tgt_dev *)data; 1025 1007 if (!tgtdev) 1026 1008 return; 1027 1009 1028 1010 mpi3mr_change_queue_depth(sdev, tgtdev->q_depth); 1029 - switch (tgtdev->dev_type) { 1030 - case MPI3_DEVICE_DEVFORM_PCIE: 1031 - /*The block layer hw sector size = 512*/ 1032 - if ((tgtdev->dev_spec.pcie_inf.dev_info & 1033 - MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_MASK) == 1034 - MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_NVME_DEVICE) { 1035 - blk_queue_max_hw_sectors(sdev->request_queue, 1036 - tgtdev->dev_spec.pcie_inf.mdts / 512); 1037 - if (tgtdev->dev_spec.pcie_inf.pgsz == 0) 1038 - blk_queue_virt_boundary(sdev->request_queue, 1039 - ((1 << MPI3MR_DEFAULT_PGSZEXP) - 1)); 1040 - else 1041 - blk_queue_virt_boundary(sdev->request_queue, 1042 - ((1 << tgtdev->dev_spec.pcie_inf.pgsz) - 1)); 1043 - } 1044 - break; 1045 - default: 1046 - break; 1047 - } 1011 + 1012 + lim = queue_limits_start_update(sdev->request_queue); 1013 + mpi3mr_configure_tgt_dev(tgtdev, &lim); 1014 + WARN_ON_ONCE(queue_limits_commit_update(sdev->request_queue, &lim)); 1048 1015 } 1049 1016 1050 1017 /** ··· 1043 1038 * 1044 1039 * Return: Nothing. 1045 1040 */ 1046 - 1047 - void mpi3mr_refresh_tgtdevs(struct mpi3mr_ioc *mrioc) 1041 + static void mpi3mr_refresh_tgtdevs(struct mpi3mr_ioc *mrioc) 1048 1042 { 1049 1043 struct mpi3mr_tgt_dev *tgtdev, *tgtdev_next; 1050 1044 struct mpi3mr_stgt_priv_data *tgt_priv; ··· 4397 4393 } 4398 4394 4399 4395 /** 4400 - * mpi3mr_slave_configure - Slave configure callback handler 4396 + * mpi3mr_device_configure - Slave configure callback handler 4401 4397 * @sdev: SCSI device reference 4398 + * @lim: queue limits 4402 4399 * 4403 4400 * Configure queue depth, max hardware sectors and virt boundary 4404 4401 * as required 4405 4402 * 4406 4403 * Return: 0 always. 4407 4404 */ 4408 - static int mpi3mr_slave_configure(struct scsi_device *sdev) 4405 + static int mpi3mr_device_configure(struct scsi_device *sdev, 4406 + struct queue_limits *lim) 4409 4407 { 4410 4408 struct scsi_target *starget; 4411 4409 struct Scsi_Host *shost; ··· 4438 4432 sdev->eh_timeout = MPI3MR_EH_SCMD_TIMEOUT; 4439 4433 blk_queue_rq_timeout(sdev->request_queue, MPI3MR_SCMD_TIMEOUT); 4440 4434 4441 - switch (tgt_dev->dev_type) { 4442 - case MPI3_DEVICE_DEVFORM_PCIE: 4443 - /*The block layer hw sector size = 512*/ 4444 - if ((tgt_dev->dev_spec.pcie_inf.dev_info & 4445 - MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_MASK) == 4446 - MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_NVME_DEVICE) { 4447 - blk_queue_max_hw_sectors(sdev->request_queue, 4448 - tgt_dev->dev_spec.pcie_inf.mdts / 512); 4449 - if (tgt_dev->dev_spec.pcie_inf.pgsz == 0) 4450 - blk_queue_virt_boundary(sdev->request_queue, 4451 - ((1 << MPI3MR_DEFAULT_PGSZEXP) - 1)); 4452 - else 4453 - blk_queue_virt_boundary(sdev->request_queue, 4454 - ((1 << tgt_dev->dev_spec.pcie_inf.pgsz) - 1)); 4455 - } 4456 - break; 4457 - default: 4458 - break; 4459 - } 4460 - 4435 + mpi3mr_configure_tgt_dev(tgt_dev, lim); 4461 4436 mpi3mr_tgtdev_put(tgt_dev); 4462 - 4463 4437 return retval; 4464 4438 } 4465 4439 ··· 4907 4921 .queuecommand = mpi3mr_qcmd, 4908 4922 .target_alloc = mpi3mr_target_alloc, 4909 4923 .slave_alloc = mpi3mr_slave_alloc, 4910 - .slave_configure = mpi3mr_slave_configure, 4924 + .device_configure = mpi3mr_device_configure, 4911 4925 .target_destroy = mpi3mr_target_destroy, 4912 4926 .slave_destroy = mpi3mr_slave_destroy, 4913 4927 .scan_finished = mpi3mr_scan_finished,
+8 -10
drivers/scsi/mpt3sas/mpt3sas_scsih.c
··· 2497 2497 } 2498 2498 2499 2499 /** 2500 - * scsih_slave_configure - device configure routine. 2500 + * scsih_device_configure - device configure routine. 2501 2501 * @sdev: scsi device struct 2502 + * @lim: queue limits 2502 2503 * 2503 2504 * Return: 0 if ok. Any other return is assumed to be an error and 2504 2505 * the device is ignored. 2505 2506 */ 2506 2507 static int 2507 - scsih_slave_configure(struct scsi_device *sdev) 2508 + scsih_device_configure(struct scsi_device *sdev, struct queue_limits *lim) 2508 2509 { 2509 2510 struct Scsi_Host *shost = sdev->host; 2510 2511 struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); ··· 2610 2609 raid_device->num_pds, ds); 2611 2610 2612 2611 if (shost->max_sectors > MPT3SAS_RAID_MAX_SECTORS) { 2613 - blk_queue_max_hw_sectors(sdev->request_queue, 2614 - MPT3SAS_RAID_MAX_SECTORS); 2612 + lim->max_hw_sectors = MPT3SAS_RAID_MAX_SECTORS; 2615 2613 sdev_printk(KERN_INFO, sdev, 2616 2614 "Set queue's max_sector to: %u\n", 2617 2615 MPT3SAS_RAID_MAX_SECTORS); ··· 2675 2675 pcie_device->connector_name); 2676 2676 2677 2677 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; 2680 2679 2681 2680 pcie_device_put(pcie_device); 2682 2681 spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); ··· 2686 2687 **/ 2687 2688 blk_queue_flag_set(QUEUE_FLAG_NOMERGES, 2688 2689 sdev->request_queue); 2689 - blk_queue_virt_boundary(sdev->request_queue, 2690 - ioc->page_size - 1); 2690 + lim->virt_boundary_mask = ioc->page_size - 1; 2691 2691 return 0; 2692 2692 } 2693 2693 ··· 11912 11914 .queuecommand = scsih_qcmd, 11913 11915 .target_alloc = scsih_target_alloc, 11914 11916 .slave_alloc = scsih_slave_alloc, 11915 - .slave_configure = scsih_slave_configure, 11917 + .device_configure = scsih_device_configure, 11916 11918 .target_destroy = scsih_target_destroy, 11917 11919 .slave_destroy = scsih_slave_destroy, 11918 11920 .scan_finished = scsih_scan_finished, ··· 11950 11952 .queuecommand = scsih_qcmd, 11951 11953 .target_alloc = scsih_target_alloc, 11952 11954 .slave_alloc = scsih_slave_alloc, 11953 - .slave_configure = scsih_slave_configure, 11955 + .device_configure = scsih_device_configure, 11954 11956 .target_destroy = scsih_target_destroy, 11955 11957 .slave_destroy = scsih_slave_destroy, 11956 11958 .scan_finished = scsih_scan_finished,
+6 -5
drivers/scsi/pmcraid.c
··· 197 197 } 198 198 199 199 /** 200 - * pmcraid_slave_configure - Configures a SCSI device 200 + * pmcraid_device_configure - Configures a SCSI device 201 201 * @scsi_dev: scsi device struct 202 + * @lim: queue limits 202 203 * 203 204 * This function is executed by SCSI mid layer just after a device is first 204 205 * scanned (i.e. it has responded to an INQUIRY). For VSET resources, the ··· 210 209 * Return value: 211 210 * 0 on success 212 211 */ 213 - static int pmcraid_slave_configure(struct scsi_device *scsi_dev) 212 + static int pmcraid_device_configure(struct scsi_device *scsi_dev, 213 + struct queue_limits *lim) 214 214 { 215 215 struct pmcraid_resource_entry *res = scsi_dev->hostdata; 216 216 ··· 235 233 scsi_dev->allow_restart = 1; 236 234 blk_queue_rq_timeout(scsi_dev->request_queue, 237 235 PMCRAID_VSET_IO_TIMEOUT); 238 - blk_queue_max_hw_sectors(scsi_dev->request_queue, 239 - PMCRAID_VSET_MAX_SECTORS); 236 + lim->max_hw_sectors = PMCRAID_VSET_MAX_SECTORS; 240 237 } 241 238 242 239 /* ··· 3669 3668 .eh_host_reset_handler = pmcraid_eh_host_reset_handler, 3670 3669 3671 3670 .slave_alloc = pmcraid_slave_alloc, 3672 - .slave_configure = pmcraid_slave_configure, 3671 + .device_configure = pmcraid_device_configure, 3673 3672 .slave_destroy = pmcraid_slave_destroy, 3674 3673 .change_queue_depth = pmcraid_change_queue_depth, 3675 3674 .can_queue = PMCRAID_MAX_IO_CMD,
+1 -7
drivers/scsi/ppa.c
··· 986 986 return -ENODEV; 987 987 } 988 988 989 - static int ppa_adjust_queue(struct scsi_device *device) 990 - { 991 - blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH); 992 - return 0; 993 - } 994 - 995 989 static const struct scsi_host_template ppa_template = { 996 990 .module = THIS_MODULE, 997 991 .proc_name = "ppa", ··· 999 1005 .this_id = -1, 1000 1006 .sg_tablesize = SG_ALL, 1001 1007 .can_queue = 1, 1002 - .slave_alloc = ppa_adjust_queue, 1003 1008 .cmd_size = sizeof(struct scsi_pointer), 1004 1009 }; 1005 1010 ··· 1104 1111 host = scsi_host_alloc(&ppa_template, sizeof(ppa_struct *)); 1105 1112 if (!host) 1106 1113 goto out1; 1114 + host->no_highmem = true; 1107 1115 host->io_port = pb->base; 1108 1116 host->n_io_port = ports; 1109 1117 host->dma_channel = -1;
+3 -3
drivers/scsi/qla2xxx/qla_os.c
··· 1957 1957 scsi_qla_host_t *vha = shost_priv(sdev->host); 1958 1958 struct req_que *req = vha->req; 1959 1959 1960 - if (IS_T10_PI_CAPABLE(vha->hw)) 1961 - blk_queue_update_dma_alignment(sdev->request_queue, 0x7); 1962 - 1963 1960 scsi_change_queue_depth(sdev, req->max_q_depth); 1964 1961 return 0; 1965 1962 } ··· 3571 3574 host->sg_tablesize = (ha->mr.extended_io_enabled) ? 3572 3575 QLA_SG_ALL : 128; 3573 3576 } 3577 + 3578 + if (IS_T10_PI_CAPABLE(base_vha->hw)) 3579 + host->dma_alignment = 0x7; 3574 3580 3575 3581 ret = scsi_add_host(host, &pdev->dev); 3576 3582 if (ret)
+18 -24
drivers/scsi/scsi_lib.c
··· 32 32 #include <scsi/scsi_driver.h> 33 33 #include <scsi/scsi_eh.h> 34 34 #include <scsi/scsi_host.h> 35 - #include <scsi/scsi_transport.h> /* __scsi_init_queue() */ 35 + #include <scsi/scsi_transport.h> /* scsi_init_limits() */ 36 36 #include <scsi/scsi_dh.h> 37 37 38 38 #include <trace/events/scsi.h> ··· 1965 1965 blk_mq_map_queues(&set->map[HCTX_TYPE_DEFAULT]); 1966 1966 } 1967 1967 1968 - void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q) 1968 + void scsi_init_limits(struct Scsi_Host *shost, struct queue_limits *lim) 1969 1969 { 1970 1970 struct device *dev = shost->dma_dev; 1971 1971 1972 - /* 1973 - * this limit is imposed by hardware restrictions 1974 - */ 1975 - blk_queue_max_segments(q, min_t(unsigned short, shost->sg_tablesize, 1976 - SG_MAX_SEGMENTS)); 1972 + memset(lim, 0, sizeof(*lim)); 1973 + lim->max_segments = 1974 + min_t(unsigned short, shost->sg_tablesize, SG_MAX_SEGMENTS); 1977 1975 1978 1976 if (scsi_host_prot_dma(shost)) { 1979 1977 shost->sg_prot_tablesize = 1980 1978 min_not_zero(shost->sg_prot_tablesize, 1981 1979 (unsigned short)SCSI_MAX_PROT_SG_SEGMENTS); 1982 1980 BUG_ON(shost->sg_prot_tablesize < shost->sg_tablesize); 1983 - blk_queue_max_integrity_segments(q, shost->sg_prot_tablesize); 1981 + lim->max_integrity_segments = shost->sg_prot_tablesize; 1984 1982 } 1985 1983 1986 - blk_queue_max_hw_sectors(q, shost->max_sectors); 1987 - blk_queue_segment_boundary(q, shost->dma_boundary); 1984 + lim->max_hw_sectors = shost->max_sectors; 1985 + lim->seg_boundary_mask = shost->dma_boundary; 1986 + lim->max_segment_size = shost->max_segment_size; 1987 + lim->virt_boundary_mask = shost->virt_boundary_mask; 1988 + lim->dma_alignment = max_t(unsigned int, 1989 + shost->dma_alignment, dma_get_cache_alignment() - 1); 1990 + 1991 + if (shost->no_highmem) 1992 + lim->bounce = BLK_BOUNCE_HIGH; 1993 + 1988 1994 dma_set_seg_boundary(dev, shost->dma_boundary); 1989 - 1990 - blk_queue_max_segment_size(q, shost->max_segment_size); 1991 - blk_queue_virt_boundary(q, shost->virt_boundary_mask); 1992 - dma_set_max_seg_size(dev, queue_max_segment_size(q)); 1993 - 1994 - /* 1995 - * Set a reasonable default alignment: The larger of 32-byte (dword), 1996 - * which is a common minimum for HBAs, and the minimum DMA alignment, 1997 - * which is set by the platform. 1998 - * 1999 - * Devices that require a bigger alignment can increase it later. 2000 - */ 2001 - blk_queue_dma_alignment(q, max(4, dma_get_cache_alignment()) - 1); 1995 + dma_set_max_seg_size(dev, shost->max_segment_size); 2002 1996 } 2003 - EXPORT_SYMBOL_GPL(__scsi_init_queue); 1997 + EXPORT_SYMBOL_GPL(scsi_init_limits); 2004 1998 2005 1999 static const struct blk_mq_ops scsi_mq_ops_no_commit = { 2006 2000 .get_budget = scsi_mq_get_budget,
+41 -33
drivers/scsi/scsi_scan.c
··· 227 227 228 228 /* 229 229 * realloc if new shift is calculated, which is caused by setting 230 - * up one new default queue depth after calling ->slave_configure 230 + * up one new default queue depth after calling ->device_configure 231 231 */ 232 232 if (!need_alloc && new_shift != sdev->budget_map.shift) 233 233 need_alloc = need_free = true; ··· 283 283 struct request_queue *q; 284 284 int display_failure_msg = 1, ret; 285 285 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 286 + struct queue_limits lim; 286 287 287 288 sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size, 288 289 GFP_KERNEL); ··· 333 332 334 333 sdev->sg_reserved_size = INT_MAX; 335 334 336 - q = blk_mq_alloc_queue(&sdev->host->tag_set, NULL, NULL); 335 + scsi_init_limits(shost, &lim); 336 + q = blk_mq_alloc_queue(&sdev->host->tag_set, &lim, NULL); 337 337 if (IS_ERR(q)) { 338 338 /* release fn is set up in scsi_sysfs_device_initialise, so 339 339 * have to free and put manually here */ ··· 345 343 kref_get(&sdev->host->tagset_refcnt); 346 344 sdev->request_queue = q; 347 345 q->queuedata = sdev; 348 - __scsi_init_queue(sdev->host, q); 349 346 350 347 depth = sdev->host->cmd_per_lun ?: 1; 351 348 ··· 874 873 static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, 875 874 blist_flags_t *bflags, int async) 876 875 { 876 + const struct scsi_host_template *hostt = sdev->host->hostt; 877 + struct queue_limits lim; 877 878 int ret; 878 879 879 880 /* ··· 1007 1004 sdev->select_no_atn = 1; 1008 1005 1009 1006 /* 1010 - * Maximum 512 sector transfer length 1011 - * broken RA4x00 Compaq Disk Array 1012 - */ 1013 - if (*bflags & BLIST_MAX_512) 1014 - blk_queue_max_hw_sectors(sdev->request_queue, 512); 1015 - /* 1016 - * Max 1024 sector transfer length for targets that report incorrect 1017 - * max/optimal lengths and relied on the old block layer safe default 1018 - */ 1019 - else if (*bflags & BLIST_MAX_1024) 1020 - blk_queue_max_hw_sectors(sdev->request_queue, 1024); 1021 - 1022 - /* 1023 1007 * Some devices may not want to have a start command automatically 1024 1008 * issued when a device is added. 1025 1009 */ ··· 1066 1076 1067 1077 transport_configure_device(&sdev->sdev_gendev); 1068 1078 1069 - if (sdev->host->hostt->slave_configure) { 1070 - ret = sdev->host->hostt->slave_configure(sdev); 1071 - if (ret) { 1072 - /* 1073 - * if LLDD reports slave not present, don't clutter 1074 - * console with alloc failure messages 1075 - */ 1076 - if (ret != -ENXIO) { 1077 - sdev_printk(KERN_ERR, sdev, 1078 - "failed to configure device\n"); 1079 - } 1080 - return SCSI_SCAN_NO_RESPONSE; 1081 - } 1079 + /* 1080 + * No need to freeze the queue as it isn't reachable to anyone else yet. 1081 + */ 1082 + lim = queue_limits_start_update(sdev->request_queue); 1083 + if (*bflags & BLIST_MAX_512) 1084 + lim.max_hw_sectors = 512; 1085 + else if (*bflags & BLIST_MAX_1024) 1086 + lim.max_hw_sectors = 1024; 1082 1087 1088 + if (hostt->device_configure) 1089 + ret = hostt->device_configure(sdev, &lim); 1090 + else if (hostt->slave_configure) 1091 + ret = hostt->slave_configure(sdev); 1092 + if (ret) { 1093 + queue_limits_cancel_update(sdev->request_queue); 1083 1094 /* 1084 - * The queue_depth is often changed in ->slave_configure. 1085 - * Set up budget map again since memory consumption of 1086 - * the map depends on actual queue depth. 1095 + * If the LLDD reports device not present, don't clutter the 1096 + * console with failure messages. 1087 1097 */ 1088 - scsi_realloc_sdev_budget_map(sdev, sdev->queue_depth); 1098 + if (ret != -ENXIO) 1099 + sdev_printk(KERN_ERR, sdev, 1100 + "failed to configure device\n"); 1101 + return SCSI_SCAN_NO_RESPONSE; 1089 1102 } 1103 + 1104 + ret = queue_limits_commit_update(sdev->request_queue, &lim); 1105 + if (ret) { 1106 + sdev_printk(KERN_ERR, sdev, "failed to apply queue limits.\n"); 1107 + return SCSI_SCAN_NO_RESPONSE; 1108 + } 1109 + 1110 + /* 1111 + * The queue_depth is often changed in ->device_configure. 1112 + * 1113 + * Set up budget map again since memory consumption of the map depends 1114 + * on actual queue depth. 1115 + */ 1116 + if (hostt->device_configure || hostt->slave_configure) 1117 + scsi_realloc_sdev_budget_map(sdev, sdev->queue_depth); 1090 1118 1091 1119 if (sdev->scsi_level >= SCSI_3) 1092 1120 scsi_attach_vpd(sdev);
+9 -6
drivers/scsi/scsi_transport_fc.c
··· 4276 4276 { 4277 4277 struct device *dev = &shost->shost_gendev; 4278 4278 struct fc_internal *i = to_fc_internal(shost->transportt); 4279 + struct queue_limits lim; 4279 4280 struct request_queue *q; 4280 4281 char bsg_name[20]; 4281 4282 ··· 4287 4286 4288 4287 snprintf(bsg_name, sizeof(bsg_name), 4289 4288 "fc_host%d", shost->host_no); 4290 - 4291 - q = bsg_setup_queue(dev, bsg_name, fc_bsg_dispatch, fc_bsg_job_timeout, 4292 - i->f->dd_bsg_size); 4289 + scsi_init_limits(shost, &lim); 4290 + lim.max_segments = min_not_zero(lim.max_segments, i->f->max_bsg_segments); 4291 + q = bsg_setup_queue(dev, bsg_name, &lim, fc_bsg_dispatch, 4292 + fc_bsg_job_timeout, i->f->dd_bsg_size); 4293 4293 if (IS_ERR(q)) { 4294 4294 dev_err(dev, 4295 4295 "fc_host%d: bsg interface failed to initialize - setup queue\n", 4296 4296 shost->host_no); 4297 4297 return PTR_ERR(q); 4298 4298 } 4299 - __scsi_init_queue(shost, q); 4300 4299 blk_queue_rq_timeout(q, FC_DEFAULT_BSG_TIMEOUT); 4301 4300 fc_host->rqst_q = q; 4302 4301 return 0; ··· 4312 4311 { 4313 4312 struct device *dev = &rport->dev; 4314 4313 struct fc_internal *i = to_fc_internal(shost->transportt); 4314 + struct queue_limits lim; 4315 4315 struct request_queue *q; 4316 4316 4317 4317 rport->rqst_q = NULL; ··· 4320 4318 if (!i->f->bsg_request) 4321 4319 return -ENOTSUPP; 4322 4320 4323 - q = bsg_setup_queue(dev, dev_name(dev), fc_bsg_dispatch_prep, 4321 + scsi_init_limits(shost, &lim); 4322 + lim.max_segments = min_not_zero(lim.max_segments, i->f->max_bsg_segments); 4323 + q = bsg_setup_queue(dev, dev_name(dev), &lim, fc_bsg_dispatch_prep, 4324 4324 fc_bsg_job_timeout, i->f->dd_bsg_size); 4325 4325 if (IS_ERR(q)) { 4326 4326 dev_err(dev, "failed to setup bsg queue\n"); 4327 4327 return PTR_ERR(q); 4328 4328 } 4329 - __scsi_init_queue(shost, q); 4330 4329 blk_queue_rq_timeout(q, BLK_DEFAULT_SG_TIMEOUT); 4331 4330 rport->rqst_q = q; 4332 4331 return 0;
+4 -2
drivers/scsi/scsi_transport_iscsi.c
··· 1535 1535 { 1536 1536 struct device *dev = &shost->shost_gendev; 1537 1537 struct iscsi_internal *i = to_iscsi_internal(shost->transportt); 1538 + struct queue_limits lim; 1538 1539 struct request_queue *q; 1539 1540 char bsg_name[20]; 1540 1541 ··· 1543 1542 return -ENOTSUPP; 1544 1543 1545 1544 snprintf(bsg_name, sizeof(bsg_name), "iscsi_host%d", shost->host_no); 1546 - q = bsg_setup_queue(dev, bsg_name, iscsi_bsg_host_dispatch, NULL, 0); 1545 + scsi_init_limits(shost, &lim); 1546 + q = bsg_setup_queue(dev, bsg_name, &lim, iscsi_bsg_host_dispatch, NULL, 1547 + 0); 1547 1548 if (IS_ERR(q)) { 1548 1549 shost_printk(KERN_ERR, shost, "bsg interface failed to " 1549 1550 "initialize - no request queue\n"); 1550 1551 return PTR_ERR(q); 1551 1552 } 1552 - __scsi_init_queue(shost, q); 1553 1553 1554 1554 ihost->bsg_q = q; 1555 1555 return 0;
+2 -2
drivers/scsi/scsi_transport_sas.c
··· 197 197 } 198 198 199 199 if (rphy) { 200 - q = bsg_setup_queue(&rphy->dev, dev_name(&rphy->dev), 200 + q = bsg_setup_queue(&rphy->dev, dev_name(&rphy->dev), NULL, 201 201 sas_smp_dispatch, NULL, 0); 202 202 if (IS_ERR(q)) 203 203 return PTR_ERR(q); ··· 206 206 char name[20]; 207 207 208 208 snprintf(name, sizeof(name), "sas_host%d", shost->host_no); 209 - q = bsg_setup_queue(&shost->shost_gendev, name, 209 + q = bsg_setup_queue(&shost->shost_gendev, name, NULL, 210 210 sas_smp_dispatch, NULL, 0); 211 211 if (IS_ERR(q)) 212 212 return PTR_ERR(q);
+12 -12
drivers/staging/rts5208/rtsx.c
··· 70 70 71 71 static int slave_configure(struct scsi_device *sdev) 72 72 { 73 - /* 74 - * Scatter-gather buffers (all but the last) must have a length 75 - * divisible by the bulk maxpacket size. Otherwise a data packet 76 - * would end up being short, causing a premature end to the data 77 - * transfer. Since high-speed bulk pipes have a maxpacket size 78 - * of 512, we'll use that as the scsi device queue's DMA alignment 79 - * mask. Guaranteeing proper alignment of the first buffer will 80 - * have the desired effect because, except at the beginning and 81 - * the end, scatter-gather buffers follow page boundaries. 82 - */ 83 - blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); 84 - 85 73 /* Set the SCSI level to at least 2. We'll leave it at 3 if that's 86 74 * what is originally reported. We need this to avoid confusing 87 75 * the SCSI layer with devices that report 0 or 1, but need 10-byte ··· 206 218 207 219 /* limit the total size of a transfer to 120 KB */ 208 220 .max_sectors = 240, 221 + 222 + /* 223 + * Scatter-gather buffers (all but the last) must have a length 224 + * divisible by the bulk maxpacket size. Otherwise a data packet 225 + * would end up being short, causing a premature end to the data 226 + * transfer. Since high-speed bulk pipes have a maxpacket size 227 + * of 512, we'll use that as the scsi device queue's DMA alignment 228 + * mask. Guaranteeing proper alignment of the first buffer will 229 + * have the desired effect because, except at the beginning and 230 + * the end, scatter-gather buffers follow page boundaries. 231 + */ 232 + .dma_alignment = 511, 209 233 210 234 /* emulated HBA */ 211 235 .emulated = 1,
+2 -1
drivers/ufs/core/ufs_bsg.c
··· 253 253 if (ret) 254 254 goto out; 255 255 256 - q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), ufs_bsg_request, NULL, 0); 256 + q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), NULL, ufs_bsg_request, 257 + NULL, 0); 257 258 if (IS_ERR(q)) { 258 259 ret = PTR_ERR(q); 259 260 goto out;
-3
drivers/ufs/core/ufshcd.c
··· 5218 5218 */ 5219 5219 sdev->silence_suspend = 1; 5220 5220 5221 - if (hba->vops && hba->vops->config_scsi_dev) 5222 - hba->vops->config_scsi_dev(sdev); 5223 - 5224 5221 ufshcd_crypto_register(hba, q); 5225 5222 5226 5223 return 0;
+2 -6
drivers/ufs/host/ufs-exynos.c
··· 1187 1187 goto out; 1188 1188 exynos_ufs_specify_phy_time_attr(ufs); 1189 1189 exynos_ufs_config_smu(ufs); 1190 + 1191 + hba->host->dma_alignment = SZ_4K - 1; 1190 1192 return 0; 1191 1193 1192 1194 out: ··· 1512 1510 return 0; 1513 1511 } 1514 1512 1515 - static void exynos_ufs_config_scsi_dev(struct scsi_device *sdev) 1516 - { 1517 - blk_queue_update_dma_alignment(sdev->request_queue, SZ_4K - 1); 1518 - } 1519 - 1520 1513 static int fsd_ufs_post_link(struct exynos_ufs *ufs) 1521 1514 { 1522 1515 int i; ··· 1580 1583 .hibern8_notify = exynos_ufs_hibern8_notify, 1581 1584 .suspend = exynos_ufs_suspend, 1582 1585 .resume = exynos_ufs_resume, 1583 - .config_scsi_dev = exynos_ufs_config_scsi_dev, 1584 1586 }; 1585 1587 1586 1588 static struct ufs_hba_variant_ops ufs_hba_exynosauto_vh_ops = {
+1 -7
drivers/usb/image/microtek.c
··· 328 328 return 0; 329 329 } 330 330 331 - static int mts_slave_configure (struct scsi_device *s) 332 - { 333 - blk_queue_dma_alignment(s->request_queue, (512 - 1)); 334 - return 0; 335 - } 336 - 337 331 static int mts_scsi_abort(struct scsi_cmnd *srb) 338 332 { 339 333 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); ··· 625 631 .can_queue = 1, 626 632 .this_id = -1, 627 633 .emulated = 1, 634 + .dma_alignment = 511, 628 635 .slave_alloc = mts_slave_alloc, 629 - .slave_configure = mts_slave_configure, 630 636 .max_sectors= 256, /* 128 K */ 631 637 }; 632 638
+26 -31
drivers/usb/storage/scsiglue.c
··· 40 40 #include <scsi/scsi_eh.h> 41 41 42 42 #include "usb.h" 43 - #include <linux/usb/hcd.h> 44 43 #include "scsiglue.h" 45 44 #include "debug.h" 46 45 #include "transport.h" ··· 75 76 */ 76 77 sdev->inquiry_len = 36; 77 78 78 - /* 79 - * Some host controllers may have alignment requirements. 80 - * We'll play it safe by requiring 512-byte alignment always. 81 - */ 82 - blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); 83 - 84 79 /* Tell the SCSI layer if we know there is more than one LUN */ 85 80 if (us->protocol == USB_PR_BULK && us->max_lun > 0) 86 81 sdev->sdev_bflags |= BLIST_FORCELUN; ··· 82 89 return 0; 83 90 } 84 91 85 - static int slave_configure(struct scsi_device *sdev) 92 + static int device_configure(struct scsi_device *sdev, struct queue_limits *lim) 86 93 { 87 94 struct us_data *us = host_to_us(sdev->host); 88 95 struct device *dev = us->pusb_dev->bus->sysdev; ··· 97 104 98 105 if (us->fflags & US_FL_MAX_SECTORS_MIN) 99 106 max_sectors = PAGE_SIZE >> 9; 100 - if (queue_max_hw_sectors(sdev->request_queue) > max_sectors) 101 - blk_queue_max_hw_sectors(sdev->request_queue, 102 - max_sectors); 107 + lim->max_hw_sectors = min(lim->max_hw_sectors, max_sectors); 103 108 } else if (sdev->type == TYPE_TAPE) { 104 109 /* 105 110 * Tapes need much higher max_sector limits, so just 106 111 * raise it to the maximum possible (4 GB / 512) and 107 112 * let the queue segment size sort out the real limit. 108 113 */ 109 - blk_queue_max_hw_sectors(sdev->request_queue, 0x7FFFFF); 114 + lim->max_hw_sectors = 0x7FFFFF; 110 115 } else if (us->pusb_dev->speed >= USB_SPEED_SUPER) { 111 116 /* 112 117 * USB3 devices will be limited to 2048 sectors. This gives us 113 118 * better throughput on most devices. 114 119 */ 115 - blk_queue_max_hw_sectors(sdev->request_queue, 2048); 120 + lim->max_hw_sectors = 2048; 116 121 } 117 122 118 123 /* 119 124 * The max_hw_sectors should be up to maximum size of a mapping for 120 125 * the device. Otherwise, a DMA API might fail on swiotlb environment. 121 126 */ 122 - blk_queue_max_hw_sectors(sdev->request_queue, 123 - min_t(size_t, queue_max_hw_sectors(sdev->request_queue), 124 - dma_max_mapping_size(dev) >> SECTOR_SHIFT)); 125 - 126 - /* 127 - * Some USB host controllers can't do DMA; they have to use PIO. 128 - * For such controllers we need to make sure the block layer sets 129 - * up bounce buffers in addressable memory. 130 - */ 131 - if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus)) || 132 - (bus_to_hcd(us->pusb_dev->bus)->localmem_pool != NULL)) 133 - blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_HIGH); 127 + lim->max_hw_sectors = min_t(size_t, 128 + lim->max_hw_sectors, dma_max_mapping_size(dev) >> SECTOR_SHIFT); 134 129 135 130 /* 136 131 * We can't put these settings in slave_alloc() because that gets ··· 579 598 size_t count) 580 599 { 581 600 struct scsi_device *sdev = to_scsi_device(dev); 601 + struct queue_limits lim; 582 602 unsigned short ms; 603 + int ret; 583 604 584 - if (sscanf(buf, "%hu", &ms) > 0) { 585 - blk_queue_max_hw_sectors(sdev->request_queue, ms); 586 - return count; 587 - } 588 - return -EINVAL; 605 + if (sscanf(buf, "%hu", &ms) <= 0) 606 + return -EINVAL; 607 + 608 + blk_mq_freeze_queue(sdev->request_queue); 609 + lim = queue_limits_start_update(sdev->request_queue); 610 + lim.max_hw_sectors = ms; 611 + ret = queue_limits_commit_update(sdev->request_queue, &lim); 612 + blk_mq_unfreeze_queue(sdev->request_queue); 613 + 614 + if (ret) 615 + return ret; 616 + return count; 589 617 } 590 618 static DEVICE_ATTR_RW(max_sectors); 591 619 ··· 632 642 .this_id = -1, 633 643 634 644 .slave_alloc = slave_alloc, 635 - .slave_configure = slave_configure, 645 + .device_configure = device_configure, 636 646 .target_alloc = target_alloc, 637 647 638 648 /* lots of sg segments can be handled */ 639 649 .sg_tablesize = SG_MAX_SEGMENTS, 640 650 651 + /* 652 + * Some host controllers may have alignment requirements. 653 + * We'll play it safe by requiring 512-byte alignment always. 654 + */ 655 + .dma_alignment = 511, 641 656 642 657 /* 643 658 * Limit the total size of a transfer to 120 KB.
+14 -15
drivers/usb/storage/uas.c
··· 823 823 (struct uas_dev_info *)sdev->host->hostdata; 824 824 825 825 sdev->hostdata = devinfo; 826 - 827 - /* 828 - * The protocol has no requirements on alignment in the strict sense. 829 - * Controllers may or may not have alignment restrictions. 830 - * As this is not exported, we use an extremely conservative guess. 831 - */ 832 - blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); 833 - 834 - if (devinfo->flags & US_FL_MAX_SECTORS_64) 835 - blk_queue_max_hw_sectors(sdev->request_queue, 64); 836 - else if (devinfo->flags & US_FL_MAX_SECTORS_240) 837 - blk_queue_max_hw_sectors(sdev->request_queue, 240); 838 - 839 826 return 0; 840 827 } 841 828 842 - static int uas_slave_configure(struct scsi_device *sdev) 829 + static int uas_device_configure(struct scsi_device *sdev, 830 + struct queue_limits *lim) 843 831 { 844 832 struct uas_dev_info *devinfo = sdev->hostdata; 833 + 834 + if (devinfo->flags & US_FL_MAX_SECTORS_64) 835 + lim->max_hw_sectors = 64; 836 + else if (devinfo->flags & US_FL_MAX_SECTORS_240) 837 + lim->max_hw_sectors = 240; 845 838 846 839 if (devinfo->flags & US_FL_NO_REPORT_OPCODES) 847 840 sdev->no_report_opcodes = 1; ··· 900 907 .queuecommand = uas_queuecommand, 901 908 .target_alloc = uas_target_alloc, 902 909 .slave_alloc = uas_slave_alloc, 903 - .slave_configure = uas_slave_configure, 910 + .device_configure = uas_device_configure, 904 911 .eh_abort_handler = uas_eh_abort_handler, 905 912 .eh_device_reset_handler = uas_eh_device_reset_handler, 906 913 .this_id = -1, 907 914 .skip_settle_delay = 1, 915 + /* 916 + * The protocol has no requirements on alignment in the strict sense. 917 + * Controllers may or may not have alignment restrictions. 918 + * As this is not exported, we use an extremely conservative guess. 919 + */ 920 + .dma_alignment = 511, 908 921 .dma_boundary = PAGE_SIZE - 1, 909 922 .cmd_size = sizeof(struct uas_cmd_info), 910 923 };
+10
drivers/usb/storage/usb.c
··· 47 47 #include <scsi/scsi_device.h> 48 48 49 49 #include "usb.h" 50 + #include <linux/usb/hcd.h> 50 51 #include "scsiglue.h" 51 52 #include "transport.h" 52 53 #include "protocol.h" ··· 961 960 result = associate_dev(us, intf); 962 961 if (result) 963 962 goto BadDevice; 963 + 964 + /* 965 + * Some USB host controllers can't do DMA; they have to use PIO. 966 + * For such controllers we need to make sure the block layer sets 967 + * up bounce buffers in addressable memory. 968 + */ 969 + if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus)) || 970 + bus_to_hcd(us->pusb_dev->bus)->localmem_pool) 971 + host->no_highmem = true; 964 972 965 973 /* Get the unusual_devs entries and the descriptors */ 966 974 result = get_device_info(us, id, unusual_dev);
+13 -13
include/linux/blkdev.h
··· 892 892 struct queue_limits *lim); 893 893 int queue_limits_set(struct request_queue *q, struct queue_limits *lim); 894 894 895 + /** 896 + * queue_limits_cancel_update - cancel an atomic update of queue limits 897 + * @q: queue to update 898 + * 899 + * This functions cancels an atomic update of the queue limits started by 900 + * queue_limits_start_update() and should be used when an error occurs after 901 + * starting update. 902 + */ 903 + static inline void queue_limits_cancel_update(struct request_queue *q) 904 + { 905 + mutex_unlock(&q->limits_lock); 906 + } 907 + 895 908 /* 896 909 * Access functions for manipulating queue properties 897 910 */ 898 - void blk_queue_bounce_limit(struct request_queue *q, enum blk_bounce limit); 899 - extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); 900 911 extern void blk_queue_chunk_sectors(struct request_queue *, unsigned int); 901 - extern void blk_queue_max_segments(struct request_queue *, unsigned short); 902 - extern void blk_queue_max_discard_segments(struct request_queue *, 903 - unsigned short); 904 912 void blk_queue_max_secure_erase_sectors(struct request_queue *q, 905 913 unsigned int max_sectors); 906 - extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); 907 914 extern void blk_queue_max_discard_sectors(struct request_queue *q, 908 915 unsigned int max_discard_sectors); 909 916 extern void blk_queue_max_write_zeroes_sectors(struct request_queue *q, ··· 927 920 extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min); 928 921 extern void blk_queue_io_min(struct request_queue *q, unsigned int min); 929 922 extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt); 930 - extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); 931 923 extern void blk_set_queue_depth(struct request_queue *q, unsigned int depth); 932 924 extern void blk_set_stacking_limits(struct queue_limits *lim); 933 925 extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, ··· 934 928 void queue_limits_stack_bdev(struct queue_limits *t, struct block_device *bdev, 935 929 sector_t offset, const char *pfx); 936 930 extern void blk_queue_update_dma_pad(struct request_queue *, unsigned int); 937 - extern void blk_queue_segment_boundary(struct request_queue *, unsigned long); 938 - extern void blk_queue_virt_boundary(struct request_queue *, unsigned long); 939 - extern void blk_queue_dma_alignment(struct request_queue *, int); 940 - extern void blk_queue_update_dma_alignment(struct request_queue *, int); 941 931 extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); 942 932 extern void blk_queue_write_cache(struct request_queue *q, bool enabled, bool fua); 943 933 ··· 950 948 951 949 extern void blk_queue_required_elevator_features(struct request_queue *q, 952 950 unsigned int features); 953 - extern bool blk_queue_can_use_dma_map_merging(struct request_queue *q, 954 - struct device *dev); 955 951 956 952 bool __must_check blk_get_queue(struct request_queue *); 957 953 extern void blk_put_queue(struct request_queue *);
+2 -1
include/linux/bsg-lib.h
··· 65 65 void bsg_job_done(struct bsg_job *job, int result, 66 66 unsigned int reply_payload_rcv_len); 67 67 struct request_queue *bsg_setup_queue(struct device *dev, const char *name, 68 - bsg_job_fn *job_fn, bsg_timeout_fn *timeout, int dd_job_size); 68 + struct queue_limits *lim, bsg_job_fn *job_fn, 69 + bsg_timeout_fn *timeout, int dd_job_size); 69 70 void bsg_remove_queue(struct request_queue *q); 70 71 void bsg_job_put(struct bsg_job *job); 71 72 int __must_check bsg_job_get(struct bsg_job *job);
+6 -4
include/linux/libata.h
··· 1151 1151 sector_t capacity, int geom[]); 1152 1152 extern void ata_scsi_unlock_native_capacity(struct scsi_device *sdev); 1153 1153 extern int ata_scsi_slave_alloc(struct scsi_device *sdev); 1154 - extern int ata_scsi_slave_config(struct scsi_device *sdev); 1154 + int ata_scsi_device_configure(struct scsi_device *sdev, 1155 + struct queue_limits *lim); 1155 1156 extern void ata_scsi_slave_destroy(struct scsi_device *sdev); 1156 1157 extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, 1157 1158 int queue_depth); ··· 1250 1249 extern void ata_port_probe(struct ata_port *ap); 1251 1250 extern int ata_sas_tport_add(struct device *parent, struct ata_port *ap); 1252 1251 extern void ata_sas_tport_delete(struct ata_port *ap); 1253 - extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *); 1252 + int ata_sas_device_configure(struct scsi_device *sdev, struct queue_limits *lim, 1253 + struct ata_port *ap); 1254 1254 extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap); 1255 1255 extern void ata_tf_to_fis(const struct ata_taskfile *tf, 1256 1256 u8 pmp, int is_cmd, u8 *fis); ··· 1417 1415 __ATA_BASE_SHT(drv_name), \ 1418 1416 .can_queue = ATA_DEF_QUEUE, \ 1419 1417 .tag_alloc_policy = BLK_TAG_ALLOC_RR, \ 1420 - .slave_configure = ata_scsi_slave_config 1418 + .device_configure = ata_scsi_device_configure 1421 1419 1422 1420 #define ATA_SUBBASE_SHT_QD(drv_name, drv_qd) \ 1423 1421 __ATA_BASE_SHT(drv_name), \ 1424 1422 .can_queue = drv_qd, \ 1425 1423 .tag_alloc_policy = BLK_TAG_ALLOC_RR, \ 1426 - .slave_configure = ata_scsi_slave_config 1424 + .device_configure = ata_scsi_device_configure 1427 1425 1428 1426 #define ATA_BASE_SHT(drv_name) \ 1429 1427 ATA_SUBBASE_SHT(drv_name), \
+2 -2
include/linux/mmc/host.h
··· 433 433 mmc_pm_flag_t pm_caps; /* supported pm features */ 434 434 435 435 /* host specific block data */ 436 - unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 437 - unsigned short max_segs; /* see blk_queue_max_segments */ 436 + unsigned int max_seg_size; /* lim->max_segment_size */ 437 + unsigned short max_segs; /* lim->max_segments */ 438 438 unsigned short unused; 439 439 unsigned int max_req_size; /* maximum number of bytes in one req */ 440 440 unsigned int max_blk_size; /* maximum size of one mmc block */
+3 -2
include/scsi/libsas.h
··· 683 683 int sas_phy_enable(struct sas_phy *phy, int enable); 684 684 extern int sas_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 685 685 extern int sas_target_alloc(struct scsi_target *); 686 - extern int sas_slave_configure(struct scsi_device *); 686 + int sas_device_configure(struct scsi_device *dev, 687 + struct queue_limits *lim); 687 688 extern int sas_change_queue_depth(struct scsi_device *, int new_depth); 688 689 extern int sas_bios_param(struct scsi_device *, struct block_device *, 689 690 sector_t capacity, int *hsc); ··· 750 749 #endif 751 750 752 751 #define LIBSAS_SHT_BASE _LIBSAS_SHT_BASE \ 753 - .slave_configure = sas_slave_configure, \ 752 + .device_configure = sas_device_configure, \ 754 753 .slave_alloc = sas_slave_alloc, \ 755 754 756 755 #define LIBSAS_SHT_BASE_NO_SLAVE_INIT _LIBSAS_SHT_BASE
+9
include/scsi/scsi_host.h
··· 211 211 * up after yourself before returning non-0 212 212 * 213 213 * Status: OPTIONAL 214 + * 215 + * Note: slave_configure is the legacy version, use device_configure for 216 + * all new code. A driver must never define both. 214 217 */ 218 + int (* device_configure)(struct scsi_device *, struct queue_limits *lim); 215 219 int (* slave_configure)(struct scsi_device *); 216 220 217 221 /* ··· 408 404 * Maximum size in bytes of a single segment. 409 405 */ 410 406 unsigned int max_segment_size; 407 + 408 + unsigned int dma_alignment; 411 409 412 410 /* 413 411 * DMA scatter gather segment boundary limit. A segment crossing this ··· 620 614 unsigned int max_sectors; 621 615 unsigned int opt_sectors; 622 616 unsigned int max_segment_size; 617 + unsigned int dma_alignment; 623 618 unsigned long dma_boundary; 624 619 unsigned long virt_boundary_mask; 625 620 /* ··· 671 664 672 665 /* The transport requires the LUN bits NOT to be stored in CDB[1] */ 673 666 unsigned no_scsi2_lun_in_cdb:1; 667 + 668 + unsigned no_highmem:1; 674 669 675 670 /* 676 671 * Optional work queue to be utilized by the transport
+1 -1
include/scsi/scsi_transport.h
··· 83 83 + shost->transportt->device_private_offset; 84 84 } 85 85 86 - void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q); 86 + void scsi_init_limits(struct Scsi_Host *shost, struct queue_limits *lim); 87 87 88 88 #endif /* SCSI_TRANSPORT_H */
+1
include/scsi/scsi_transport_fc.h
··· 709 709 int (*vport_delete)(struct fc_vport *); 710 710 711 711 /* bsg support */ 712 + u32 max_bsg_segments; 712 713 int (*bsg_request)(struct bsg_job *); 713 714 int (*bsg_timeout)(struct bsg_job *); 714 715
-1
include/ufs/ufshcd.h
··· 374 374 int (*get_outstanding_cqs)(struct ufs_hba *hba, 375 375 unsigned long *ocqs); 376 376 int (*config_esi)(struct ufs_hba *hba); 377 - void (*config_scsi_dev)(struct scsi_device *sdev); 378 377 }; 379 378 380 379 /* clock gating state */