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

scsi: remove the use_clustering flag

The same effects can be achieved by setting the dma_boundary to
PAGE_SIZE - 1 and the max_segment_size to PAGE_SIZE, so shift those
settings into the drivers. Note that in many cases the setting might
be bogus, but this keeps the status quo.

[mkp: fix myrs and myrb]

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Christoph Hellwig and committed by
Martin K. Petersen
4af14d11 1c3726ad

+34 -53
-2
Documentation/scsi/scsi_mid_low_api.txt
··· 1098 1098 unchecked_isa_dma - 1=>only use bottom 16 MB of ram (ISA DMA addressing 1099 1099 restriction), 0=>can use full 32 bit (or better) DMA 1100 1100 address space 1101 - use_clustering - 1=>SCSI commands in mid level's queue can be merged, 1102 - 0=>disallow SCSI command merging 1103 1101 no_async_abort - 1=>Asynchronous aborts are not supported 1104 1102 0=>Timed-out commands will be aborted asynchronously 1105 1103 hostt - pointer to driver's struct scsi_host_template from which
+1 -1
arch/ia64/hp/sim/simscsi.c
··· 347 347 .sg_tablesize = SG_ALL, 348 348 .max_sectors = 1024, 349 349 .cmd_per_lun = SIMSCSI_REQ_QUEUE_LEN, 350 - .use_clustering = DISABLE_CLUSTERING, 350 + .dma_boundary = PAGE_SIZE - 1, 351 351 }; 352 352 353 353 static int __init
+1 -1
drivers/scsi/a2091.c
··· 160 160 .this_id = 7, 161 161 .sg_tablesize = SG_ALL, 162 162 .cmd_per_lun = CMD_PER_LUN, 163 - .use_clustering = DISABLE_CLUSTERING 163 + .dma_boundary = PAGE_SIZE - 1, 164 164 }; 165 165 166 166 static int a2091_probe(struct zorro_dev *z, const struct zorro_device_id *ent)
+2 -2
drivers/scsi/advansys.c
··· 3192 3192 shost->sg_tablesize, shost->cmd_per_lun); 3193 3193 3194 3194 seq_printf(m, 3195 - " unchecked_isa_dma %d, use_clustering %d\n", 3196 - shost->unchecked_isa_dma, shost->use_clustering); 3195 + " unchecked_isa_dma %d\n", 3196 + shost->unchecked_isa_dma); 3197 3197 3198 3198 seq_printf(m, 3199 3199 " flags 0x%x, last_reset 0x%lx, jiffies 0x%lx, asc_n_io_port 0x%x\n",
+1 -1
drivers/scsi/aha152x.c
··· 2920 2920 .can_queue = 1, 2921 2921 .this_id = 7, 2922 2922 .sg_tablesize = SG_ALL, 2923 - .use_clustering = DISABLE_CLUSTERING, 2923 + .dma_boundary = PAGE_SIZE - 1, 2924 2924 .slave_alloc = aha152x_adjust_queue, 2925 2925 }; 2926 2926
+1 -1
drivers/scsi/arm/acornscsi.c
··· 2890 2890 .this_id = 7, 2891 2891 .sg_tablesize = SG_ALL, 2892 2892 .cmd_per_lun = 2, 2893 - .use_clustering = DISABLE_CLUSTERING, 2893 + .dma_boundary = PAGE_SIZE - 1, 2894 2894 .proc_name = "acornscsi", 2895 2895 }; 2896 2896
+1 -1
drivers/scsi/arm/arxescsi.c
··· 245 245 .can_queue = 0, 246 246 .this_id = 7, 247 247 .sg_tablesize = SG_ALL, 248 - .use_clustering = DISABLE_CLUSTERING, 248 + .dma_boundary = PAGE_SIZE - 1, 249 249 .proc_name = "arxescsi", 250 250 }; 251 251
+1 -1
drivers/scsi/arm/cumana_1.c
··· 221 221 .this_id = 7, 222 222 .sg_tablesize = SG_ALL, 223 223 .cmd_per_lun = 2, 224 - .use_clustering = DISABLE_CLUSTERING, 225 224 .proc_name = "CumanaSCSI-1", 226 225 .cmd_size = NCR5380_CMD_SIZE, 227 226 .max_sectors = 128, 227 + .dma_boundary = PAGE_SIZE - 1, 228 228 }; 229 229 230 230 static int cumanascsi1_probe(struct expansion_card *ec,
+1 -1
drivers/scsi/arm/oak.c
··· 110 110 .this_id = 7, 111 111 .sg_tablesize = SG_ALL, 112 112 .cmd_per_lun = 2, 113 - .use_clustering = DISABLE_CLUSTERING, 113 + .dma_boundary = PAGE_SIZE - 1, 114 114 .proc_name = "oakscsi", 115 115 .cmd_size = NCR5380_CMD_SIZE, 116 116 .max_sectors = 128,
+1 -1
drivers/scsi/atari_scsi.c
··· 714 714 .eh_host_reset_handler = atari_scsi_host_reset, 715 715 .this_id = 7, 716 716 .cmd_per_lun = 2, 717 - .use_clustering = DISABLE_CLUSTERING, 717 + .dma_boundary = PAGE_SIZE - 1, 718 718 .cmd_size = NCR5380_CMD_SIZE, 719 719 }; 720 720
+1 -1
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
··· 95 95 .eh_device_reset_handler = iscsi_eh_device_reset, 96 96 .eh_target_reset_handler = iscsi_eh_recover_target, 97 97 .target_alloc = iscsi_target_alloc, 98 - .use_clustering = DISABLE_CLUSTERING, 98 + .dma_boundary = PAGE_SIZE - 1, 99 99 .this_id = -1, 100 100 .track_queue_depth = 1, 101 101 };
+1 -1
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
··· 113 113 .eh_device_reset_handler = iscsi_eh_device_reset, 114 114 .eh_target_reset_handler = iscsi_eh_recover_target, 115 115 .target_alloc = iscsi_target_alloc, 116 - .use_clustering = DISABLE_CLUSTERING, 116 + .dma_boundary = PAGE_SIZE - 1, 117 117 .this_id = -1, 118 118 .track_queue_depth = 1, 119 119 };
+1 -1
drivers/scsi/dc395x.c
··· 4631 4631 .cmd_per_lun = DC395x_MAX_CMD_PER_LUN, 4632 4632 .eh_abort_handler = dc395x_eh_abort, 4633 4633 .eh_bus_reset_handler = dc395x_eh_bus_reset, 4634 - .use_clustering = DISABLE_CLUSTERING, 4634 + .dma_boundary = PAGE_SIZE - 1, 4635 4635 }; 4636 4636 4637 4637
+1 -1
drivers/scsi/dmx3191d.c
··· 63 63 .this_id = 7, 64 64 .sg_tablesize = SG_ALL, 65 65 .cmd_per_lun = 2, 66 - .use_clustering = DISABLE_CLUSTERING, 66 + .dma_boundary = PAGE_SIZE - 1, 67 67 .cmd_size = NCR5380_CMD_SIZE, 68 68 }; 69 69
+1 -1
drivers/scsi/g_NCR5380.c
··· 700 700 .this_id = 7, 701 701 .sg_tablesize = SG_ALL, 702 702 .cmd_per_lun = 2, 703 - .use_clustering = DISABLE_CLUSTERING, 703 + .dma_boundary = PAGE_SIZE - 1, 704 704 .cmd_size = NCR5380_CMD_SIZE, 705 705 .max_sectors = 128, 706 706 };
+1 -1
drivers/scsi/gvp11.c
··· 184 184 .this_id = 7, 185 185 .sg_tablesize = SG_ALL, 186 186 .cmd_per_lun = CMD_PER_LUN, 187 - .use_clustering = DISABLE_CLUSTERING 187 + .dma_boundary = PAGE_SIZE - 1, 188 188 }; 189 189 190 190 static int check_wd33c93(struct gvp11_scsiregs *regs)
-1
drivers/scsi/hosts.c
··· 431 431 shost->sg_prot_tablesize = sht->sg_prot_tablesize; 432 432 shost->cmd_per_lun = sht->cmd_per_lun; 433 433 shost->unchecked_isa_dma = sht->unchecked_isa_dma; 434 - shost->use_clustering = sht->use_clustering; 435 434 shost->no_write_same = sht->no_write_same; 436 435 437 436 if (shost_eh_deadline == -1 || !sht->eh_host_reset_handler)
-1
drivers/scsi/ips.c
··· 6677 6677 sh->sg_tablesize = sh->hostt->sg_tablesize; 6678 6678 sh->can_queue = sh->hostt->can_queue; 6679 6679 sh->cmd_per_lun = sh->hostt->cmd_per_lun; 6680 - sh->use_clustering = sh->hostt->use_clustering; 6681 6680 sh->max_sectors = 128; 6682 6681 6683 6682 sh->max_id = ha->ntargets;
+1 -1
drivers/scsi/iscsi_tcp.c
··· 980 980 .eh_abort_handler = iscsi_eh_abort, 981 981 .eh_device_reset_handler= iscsi_eh_device_reset, 982 982 .eh_target_reset_handler = iscsi_eh_recover_target, 983 - .use_clustering = DISABLE_CLUSTERING, 983 + .dma_boundary = PAGE_SIZE - 1, 984 984 .slave_alloc = iscsi_sw_tcp_slave_alloc, 985 985 .slave_configure = iscsi_sw_tcp_slave_configure, 986 986 .target_alloc = iscsi_target_alloc,
+1 -1
drivers/scsi/mac_esp.c
··· 307 307 goto fail; 308 308 309 309 host->max_id = 8; 310 - host->use_clustering = DISABLE_CLUSTERING; 310 + host->dma_boundary = PAGE_SIZE - 1; 311 311 esp = shost_priv(host); 312 312 313 313 esp->host = host;
+1 -1
drivers/scsi/mac_scsi.c
··· 333 333 .this_id = 7, 334 334 .sg_tablesize = 1, 335 335 .cmd_per_lun = 2, 336 - .use_clustering = DISABLE_CLUSTERING, 336 + .dma_boundary = PAGE_SIZE - 1, 337 337 .cmd_size = NCR5380_CMD_SIZE, 338 338 .max_sectors = 128, 339 339 };
+1 -1
drivers/scsi/mvumi.c
··· 2197 2197 .eh_timed_out = mvumi_timed_out, 2198 2198 .eh_host_reset_handler = mvumi_host_reset, 2199 2199 .bios_param = mvumi_bios_param, 2200 - .use_clustering = DISABLE_CLUSTERING, 2200 + .dma_boundary = PAGE_SIZE - 1, 2201 2201 .this_id = -1, 2202 2202 }; 2203 2203
+1 -1
drivers/scsi/myrb.c
··· 2236 2236 .shost_attrs = myrb_shost_attrs, 2237 2237 .sdev_attrs = myrb_sdev_attrs, 2238 2238 .this_id = -1, 2239 - .use_clustering = DISABLE_CLUSTERING, 2239 + .dma_boundary = PAGE_SIZE - 1, 2240 2240 }; 2241 2241 2242 2242 /**
+1 -1
drivers/scsi/myrs.c
··· 1929 1929 .shost_attrs = myrs_shost_attrs, 1930 1930 .sdev_attrs = myrs_sdev_attrs, 1931 1931 .this_id = -1, 1932 - .use_clustering = DISABLE_CLUSTERING, 1932 + .dma_boundary = PAGE_SIZE - 1, 1933 1933 }; 1934 1934 1935 1935 static struct myrs_hba *myrs_alloc_host(struct pci_dev *pdev,
+1 -1
drivers/scsi/nsp32.c
··· 274 274 .sg_tablesize = NSP32_SG_SIZE, 275 275 .max_sectors = 128, 276 276 .this_id = NSP32_HOST_SCSIID, 277 - .use_clustering = DISABLE_CLUSTERING, 277 + .dma_boundary = PAGE_SIZE - 1, 278 278 .eh_abort_handler = nsp32_eh_abort, 279 279 .eh_host_reset_handler = nsp32_eh_host_reset, 280 280 /* .highmem_io = 1, */
+1 -1
drivers/scsi/pcmcia/nsp_cs.c
··· 86 86 .can_queue = 1, 87 87 .this_id = NSP_INITIATOR_ID, 88 88 .sg_tablesize = SG_ALL, 89 - .use_clustering = DISABLE_CLUSTERING, 89 + .dma_boundary = PAGE_SIZE - 1, 90 90 }; 91 91 92 92 static nsp_hw_data nsp_data_base; /* attach <-> detect glue */
+1 -1
drivers/scsi/pcmcia/qlogic_stub.c
··· 72 72 .can_queue = 1, 73 73 .this_id = -1, 74 74 .sg_tablesize = SG_ALL, 75 - .use_clustering = DISABLE_CLUSTERING, 75 + .dma_boundary = PAGE_SIZE - 1, 76 76 }; 77 77 78 78 /*====================================================================*/
+1 -1
drivers/scsi/qlogicfas.c
··· 193 193 .can_queue = 1, 194 194 .this_id = -1, 195 195 .sg_tablesize = SG_ALL, 196 - .use_clustering = DISABLE_CLUSTERING, 196 + .dma_boundary = PAGE_SIZE - 1, 197 197 }; 198 198 199 199 static __init int qlogicfas_init(void)
+2 -1
drivers/scsi/scsi_debug.c
··· 5866 5866 5867 5867 sdebug_driver_template.can_queue = sdebug_max_queue; 5868 5868 if (!sdebug_clustering) 5869 - sdebug_driver_template.use_clustering = DISABLE_CLUSTERING; 5869 + sdebug_driver_template.dma_boundary = PAGE_SIZE - 1; 5870 + 5870 5871 hpnt = scsi_host_alloc(&sdebug_driver_template, sizeof(sdbg_host)); 5871 5872 if (NULL == hpnt) { 5872 5873 pr_err("scsi_host_alloc failed\n");
-3
drivers/scsi/scsi_lib.c
··· 2230 2230 blk_queue_max_segment_size(q, 2231 2231 min(shost->max_segment_size, dma_get_max_seg_size(dev))); 2232 2232 2233 - if (shost->use_clustering == DISABLE_CLUSTERING) 2234 - q->limits.cluster = 0; 2235 - 2236 2233 /* 2237 2234 * Set a reasonable default alignment: The larger of 32-byte (dword), 2238 2235 * which is a common minimum for HBAs, and the minimum DMA alignment,
+1 -1
drivers/scsi/sgiwd93.c
··· 208 208 .this_id = 7, 209 209 .sg_tablesize = SG_ALL, 210 210 .cmd_per_lun = 8, 211 - .use_clustering = DISABLE_CLUSTERING, 211 + .dma_boundary = PAGE_SIZE - 1, 212 212 }; 213 213 214 214 static int sgiwd93_probe(struct platform_device *pdev)
+1 -1
drivers/scsi/stex.c
··· 1489 1489 .eh_abort_handler = stex_abort, 1490 1490 .eh_host_reset_handler = stex_reset, 1491 1491 .this_id = -1, 1492 - .use_clustering = DISABLE_CLUSTERING, 1492 + .dma_boundary = PAGE_SIZE - 1, 1493 1493 }; 1494 1494 1495 1495 static struct pci_device_id stex_pci_tbl[] = {
+1 -1
drivers/scsi/sun3_scsi.c
··· 500 500 .this_id = 7, 501 501 .sg_tablesize = SG_NONE, 502 502 .cmd_per_lun = 2, 503 - .use_clustering = DISABLE_CLUSTERING, 503 + .dma_boundary = PAGE_SIZE - 1, 504 504 .cmd_size = NCR5380_CMD_SIZE, 505 505 }; 506 506
+1 -1
drivers/scsi/ufs/ufshcd.c
··· 6982 6982 .max_host_blocked = 1, 6983 6983 .track_queue_depth = 1, 6984 6984 .sdev_groups = ufshcd_driver_groups, 6985 - .use_clustering = DISABLE_CLUSTERING, 6985 + .dma_boundary = PAGE_SIZE - 1, 6986 6986 }; 6987 6987 6988 6988 static int ufshcd_config_vreg_load(struct device *dev, struct ufs_vreg *vreg,
+1 -1
drivers/target/loopback/tcm_loop.c
··· 324 324 .sg_tablesize = 256, 325 325 .cmd_per_lun = 1024, 326 326 .max_sectors = 0xFFFF, 327 - .use_clustering = DISABLE_CLUSTERING, 327 + .dma_boundary = PAGE_SIZE - 1, 328 328 .slave_alloc = tcm_loop_slave_alloc, 329 329 .module = THIS_MODULE, 330 330 .track_queue_depth = 1,
+1 -1
drivers/usb/storage/uas.c
··· 879 879 .this_id = -1, 880 880 .sg_tablesize = SG_NONE, 881 881 .skip_settle_delay = 1, 882 - .use_clustering = DISABLE_CLUSTERING, 882 + .dma_boundary = PAGE_SIZE - 1, 883 883 }; 884 884 885 885 #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
-13
include/scsi/scsi_host.h
··· 44 44 #define MODE_INITIATOR 0x01 45 45 #define MODE_TARGET 0x02 46 46 47 - #define DISABLE_CLUSTERING (-1) 48 - 49 47 struct scsi_host_template { 50 48 struct module *module; 51 49 const char *name; ··· 417 419 unsigned unchecked_isa_dma:1; 418 420 419 421 /* 420 - * True if this host adapter can make good use of clustering. 421 - * I originally thought that if the tablesize was large that it 422 - * was a waste of CPU cycles to prepare a cluster list, but 423 - * it works out that the Buslogic is faster if you use a smaller 424 - * number of segments (i.e. use clustering). I guess it is 425 - * inefficient. 426 - */ 427 - unsigned use_clustering:1; 428 - 429 - /* 430 422 * True for emulated SCSI host adapters (e.g. ATAPI). 431 423 */ 432 424 unsigned emulated:1; ··· 614 626 615 627 unsigned active_mode:2; 616 628 unsigned unchecked_isa_dma:1; 617 - unsigned use_clustering:1; 618 629 619 630 /* 620 631 * Host has requested that no further requests come through for the