Skip to content

Commit 4af14d1

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
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>
1 parent 1c3726a commit 4af14d1

37 files changed

+34
-53
lines changed

Documentation/scsi/scsi_mid_low_api.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,8 +1098,6 @@ of interest:
10981098
unchecked_isa_dma - 1=>only use bottom 16 MB of ram (ISA DMA addressing
10991099
restriction), 0=>can use full 32 bit (or better) DMA
11001100
address space
1101-
use_clustering - 1=>SCSI commands in mid level's queue can be merged,
1102-
0=>disallow SCSI command merging
11031101
no_async_abort - 1=>Asynchronous aborts are not supported
11041102
0=>Timed-out commands will be aborted asynchronously
11051103
hostt - pointer to driver's struct scsi_host_template from which

arch/ia64/hp/sim/simscsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static struct scsi_host_template driver_template = {
347347
.sg_tablesize = SG_ALL,
348348
.max_sectors = 1024,
349349
.cmd_per_lun = SIMSCSI_REQ_QUEUE_LEN,
350-
.use_clustering = DISABLE_CLUSTERING,
350+
.dma_boundary = PAGE_SIZE - 1,
351351
};
352352

353353
static int __init

drivers/scsi/a2091.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static struct scsi_host_template a2091_scsi_template = {
160160
.this_id = 7,
161161
.sg_tablesize = SG_ALL,
162162
.cmd_per_lun = CMD_PER_LUN,
163-
.use_clustering = DISABLE_CLUSTERING
163+
.dma_boundary = PAGE_SIZE - 1,
164164
};
165165

166166
static int a2091_probe(struct zorro_dev *z, const struct zorro_device_id *ent)

drivers/scsi/advansys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,8 +3192,8 @@ static void asc_prt_driver_conf(struct seq_file *m, struct Scsi_Host *shost)
31923192
shost->sg_tablesize, shost->cmd_per_lun);
31933193

31943194
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);
31973197

31983198
seq_printf(m,
31993199
" flags 0x%x, last_reset 0x%lx, jiffies 0x%lx, asc_n_io_port 0x%x\n",

drivers/scsi/aha152x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2920,7 +2920,7 @@ static struct scsi_host_template aha152x_driver_template = {
29202920
.can_queue = 1,
29212921
.this_id = 7,
29222922
.sg_tablesize = SG_ALL,
2923-
.use_clustering = DISABLE_CLUSTERING,
2923+
.dma_boundary = PAGE_SIZE - 1,
29242924
.slave_alloc = aha152x_adjust_queue,
29252925
};
29262926

drivers/scsi/arm/acornscsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2890,7 +2890,7 @@ static struct scsi_host_template acornscsi_template = {
28902890
.this_id = 7,
28912891
.sg_tablesize = SG_ALL,
28922892
.cmd_per_lun = 2,
2893-
.use_clustering = DISABLE_CLUSTERING,
2893+
.dma_boundary = PAGE_SIZE - 1,
28942894
.proc_name = "acornscsi",
28952895
};
28962896

drivers/scsi/arm/arxescsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static struct scsi_host_template arxescsi_template = {
245245
.can_queue = 0,
246246
.this_id = 7,
247247
.sg_tablesize = SG_ALL,
248-
.use_clustering = DISABLE_CLUSTERING,
248+
.dma_boundary = PAGE_SIZE - 1,
249249
.proc_name = "arxescsi",
250250
};
251251

drivers/scsi/arm/cumana_1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ static struct scsi_host_template cumanascsi_template = {
221221
.this_id = 7,
222222
.sg_tablesize = SG_ALL,
223223
.cmd_per_lun = 2,
224-
.use_clustering = DISABLE_CLUSTERING,
225224
.proc_name = "CumanaSCSI-1",
226225
.cmd_size = NCR5380_CMD_SIZE,
227226
.max_sectors = 128,
227+
.dma_boundary = PAGE_SIZE - 1,
228228
};
229229

230230
static int cumanascsi1_probe(struct expansion_card *ec,

drivers/scsi/arm/oak.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static struct scsi_host_template oakscsi_template = {
110110
.this_id = 7,
111111
.sg_tablesize = SG_ALL,
112112
.cmd_per_lun = 2,
113-
.use_clustering = DISABLE_CLUSTERING,
113+
.dma_boundary = PAGE_SIZE - 1,
114114
.proc_name = "oakscsi",
115115
.cmd_size = NCR5380_CMD_SIZE,
116116
.max_sectors = 128,

drivers/scsi/atari_scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ static struct scsi_host_template atari_scsi_template = {
714714
.eh_host_reset_handler = atari_scsi_host_reset,
715715
.this_id = 7,
716716
.cmd_per_lun = 2,
717-
.use_clustering = DISABLE_CLUSTERING,
717+
.dma_boundary = PAGE_SIZE - 1,
718718
.cmd_size = NCR5380_CMD_SIZE,
719719
};
720720

drivers/scsi/cxgbi/cxgb3i/cxgb3i.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static struct scsi_host_template cxgb3i_host_template = {
9595
.eh_device_reset_handler = iscsi_eh_device_reset,
9696
.eh_target_reset_handler = iscsi_eh_recover_target,
9797
.target_alloc = iscsi_target_alloc,
98-
.use_clustering = DISABLE_CLUSTERING,
98+
.dma_boundary = PAGE_SIZE - 1,
9999
.this_id = -1,
100100
.track_queue_depth = 1,
101101
};

drivers/scsi/cxgbi/cxgb4i/cxgb4i.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static struct scsi_host_template cxgb4i_host_template = {
113113
.eh_device_reset_handler = iscsi_eh_device_reset,
114114
.eh_target_reset_handler = iscsi_eh_recover_target,
115115
.target_alloc = iscsi_target_alloc,
116-
.use_clustering = DISABLE_CLUSTERING,
116+
.dma_boundary = PAGE_SIZE - 1,
117117
.this_id = -1,
118118
.track_queue_depth = 1,
119119
};

drivers/scsi/dc395x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4631,7 +4631,7 @@ static struct scsi_host_template dc395x_driver_template = {
46314631
.cmd_per_lun = DC395x_MAX_CMD_PER_LUN,
46324632
.eh_abort_handler = dc395x_eh_abort,
46334633
.eh_bus_reset_handler = dc395x_eh_bus_reset,
4634-
.use_clustering = DISABLE_CLUSTERING,
4634+
.dma_boundary = PAGE_SIZE - 1,
46354635
};
46364636

46374637

drivers/scsi/dmx3191d.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static struct scsi_host_template dmx3191d_driver_template = {
6363
.this_id = 7,
6464
.sg_tablesize = SG_ALL,
6565
.cmd_per_lun = 2,
66-
.use_clustering = DISABLE_CLUSTERING,
66+
.dma_boundary = PAGE_SIZE - 1,
6767
.cmd_size = NCR5380_CMD_SIZE,
6868
};
6969

drivers/scsi/g_NCR5380.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ static struct scsi_host_template driver_template = {
700700
.this_id = 7,
701701
.sg_tablesize = SG_ALL,
702702
.cmd_per_lun = 2,
703-
.use_clustering = DISABLE_CLUSTERING,
703+
.dma_boundary = PAGE_SIZE - 1,
704704
.cmd_size = NCR5380_CMD_SIZE,
705705
.max_sectors = 128,
706706
};

drivers/scsi/gvp11.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static struct scsi_host_template gvp11_scsi_template = {
184184
.this_id = 7,
185185
.sg_tablesize = SG_ALL,
186186
.cmd_per_lun = CMD_PER_LUN,
187-
.use_clustering = DISABLE_CLUSTERING
187+
.dma_boundary = PAGE_SIZE - 1,
188188
};
189189

190190
static int check_wd33c93(struct gvp11_scsiregs *regs)

drivers/scsi/hosts.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
431431
shost->sg_prot_tablesize = sht->sg_prot_tablesize;
432432
shost->cmd_per_lun = sht->cmd_per_lun;
433433
shost->unchecked_isa_dma = sht->unchecked_isa_dma;
434-
shost->use_clustering = sht->use_clustering;
435434
shost->no_write_same = sht->no_write_same;
436435

437436
if (shost_eh_deadline == -1 || !sht->eh_host_reset_handler)

drivers/scsi/ips.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6677,7 +6677,6 @@ ips_register_scsi(int index)
66776677
sh->sg_tablesize = sh->hostt->sg_tablesize;
66786678
sh->can_queue = sh->hostt->can_queue;
66796679
sh->cmd_per_lun = sh->hostt->cmd_per_lun;
6680-
sh->use_clustering = sh->hostt->use_clustering;
66816680
sh->max_sectors = 128;
66826681

66836682
sh->max_id = ha->ntargets;

drivers/scsi/iscsi_tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ static struct scsi_host_template iscsi_sw_tcp_sht = {
980980
.eh_abort_handler = iscsi_eh_abort,
981981
.eh_device_reset_handler= iscsi_eh_device_reset,
982982
.eh_target_reset_handler = iscsi_eh_recover_target,
983-
.use_clustering = DISABLE_CLUSTERING,
983+
.dma_boundary = PAGE_SIZE - 1,
984984
.slave_alloc = iscsi_sw_tcp_slave_alloc,
985985
.slave_configure = iscsi_sw_tcp_slave_configure,
986986
.target_alloc = iscsi_target_alloc,

drivers/scsi/mac_esp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static int esp_mac_probe(struct platform_device *dev)
307307
goto fail;
308308

309309
host->max_id = 8;
310-
host->use_clustering = DISABLE_CLUSTERING;
310+
host->dma_boundary = PAGE_SIZE - 1;
311311
esp = shost_priv(host);
312312

313313
esp->host = host;

drivers/scsi/mac_scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static struct scsi_host_template mac_scsi_template = {
333333
.this_id = 7,
334334
.sg_tablesize = 1,
335335
.cmd_per_lun = 2,
336-
.use_clustering = DISABLE_CLUSTERING,
336+
.dma_boundary = PAGE_SIZE - 1,
337337
.cmd_size = NCR5380_CMD_SIZE,
338338
.max_sectors = 128,
339339
};

drivers/scsi/mvumi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,7 @@ static struct scsi_host_template mvumi_template = {
21972197
.eh_timed_out = mvumi_timed_out,
21982198
.eh_host_reset_handler = mvumi_host_reset,
21992199
.bios_param = mvumi_bios_param,
2200-
.use_clustering = DISABLE_CLUSTERING,
2200+
.dma_boundary = PAGE_SIZE - 1,
22012201
.this_id = -1,
22022202
};
22032203

drivers/scsi/myrb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2236,7 +2236,7 @@ struct scsi_host_template myrb_template = {
22362236
.shost_attrs = myrb_shost_attrs,
22372237
.sdev_attrs = myrb_sdev_attrs,
22382238
.this_id = -1,
2239-
.use_clustering = DISABLE_CLUSTERING,
2239+
.dma_boundary = PAGE_SIZE - 1,
22402240
};
22412241

22422242
/**

drivers/scsi/myrs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ struct scsi_host_template myrs_template = {
19291929
.shost_attrs = myrs_shost_attrs,
19301930
.sdev_attrs = myrs_sdev_attrs,
19311931
.this_id = -1,
1932-
.use_clustering = DISABLE_CLUSTERING,
1932+
.dma_boundary = PAGE_SIZE - 1,
19331933
};
19341934

19351935
static struct myrs_hba *myrs_alloc_host(struct pci_dev *pdev,

drivers/scsi/nsp32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static struct scsi_host_template nsp32_template = {
274274
.sg_tablesize = NSP32_SG_SIZE,
275275
.max_sectors = 128,
276276
.this_id = NSP32_HOST_SCSIID,
277-
.use_clustering = DISABLE_CLUSTERING,
277+
.dma_boundary = PAGE_SIZE - 1,
278278
.eh_abort_handler = nsp32_eh_abort,
279279
.eh_host_reset_handler = nsp32_eh_host_reset,
280280
/* .highmem_io = 1, */

drivers/scsi/pcmcia/nsp_cs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static struct scsi_host_template nsp_driver_template = {
8686
.can_queue = 1,
8787
.this_id = NSP_INITIATOR_ID,
8888
.sg_tablesize = SG_ALL,
89-
.use_clustering = DISABLE_CLUSTERING,
89+
.dma_boundary = PAGE_SIZE - 1,
9090
};
9191

9292
static nsp_hw_data nsp_data_base; /* attach <-> detect glue */

drivers/scsi/pcmcia/qlogic_stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static struct scsi_host_template qlogicfas_driver_template = {
7272
.can_queue = 1,
7373
.this_id = -1,
7474
.sg_tablesize = SG_ALL,
75-
.use_clustering = DISABLE_CLUSTERING,
75+
.dma_boundary = PAGE_SIZE - 1,
7676
};
7777

7878
/*====================================================================*/

drivers/scsi/qlogicfas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static struct scsi_host_template qlogicfas_driver_template = {
193193
.can_queue = 1,
194194
.this_id = -1,
195195
.sg_tablesize = SG_ALL,
196-
.use_clustering = DISABLE_CLUSTERING,
196+
.dma_boundary = PAGE_SIZE - 1,
197197
};
198198

199199
static __init int qlogicfas_init(void)

drivers/scsi/scsi_debug.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5866,7 +5866,8 @@ static int sdebug_driver_probe(struct device *dev)
58665866

58675867
sdebug_driver_template.can_queue = sdebug_max_queue;
58685868
if (!sdebug_clustering)
5869-
sdebug_driver_template.use_clustering = DISABLE_CLUSTERING;
5869+
sdebug_driver_template.dma_boundary = PAGE_SIZE - 1;
5870+
58705871
hpnt = scsi_host_alloc(&sdebug_driver_template, sizeof(sdbg_host));
58715872
if (NULL == hpnt) {
58725873
pr_err("scsi_host_alloc failed\n");

drivers/scsi/scsi_lib.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,9 +2230,6 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
22302230
blk_queue_max_segment_size(q,
22312231
min(shost->max_segment_size, dma_get_max_seg_size(dev)));
22322232

2233-
if (shost->use_clustering == DISABLE_CLUSTERING)
2234-
q->limits.cluster = 0;
2235-
22362233
/*
22372234
* Set a reasonable default alignment: The larger of 32-byte (dword),
22382235
* which is a common minimum for HBAs, and the minimum DMA alignment,

drivers/scsi/sgiwd93.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static struct scsi_host_template sgiwd93_template = {
208208
.this_id = 7,
209209
.sg_tablesize = SG_ALL,
210210
.cmd_per_lun = 8,
211-
.use_clustering = DISABLE_CLUSTERING,
211+
.dma_boundary = PAGE_SIZE - 1,
212212
};
213213

214214
static int sgiwd93_probe(struct platform_device *pdev)

drivers/scsi/stex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ static struct scsi_host_template driver_template = {
14891489
.eh_abort_handler = stex_abort,
14901490
.eh_host_reset_handler = stex_reset,
14911491
.this_id = -1,
1492-
.use_clustering = DISABLE_CLUSTERING,
1492+
.dma_boundary = PAGE_SIZE - 1,
14931493
};
14941494

14951495
static struct pci_device_id stex_pci_tbl[] = {

drivers/scsi/sun3_scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static struct scsi_host_template sun3_scsi_template = {
500500
.this_id = 7,
501501
.sg_tablesize = SG_NONE,
502502
.cmd_per_lun = 2,
503-
.use_clustering = DISABLE_CLUSTERING,
503+
.dma_boundary = PAGE_SIZE - 1,
504504
.cmd_size = NCR5380_CMD_SIZE,
505505
};
506506

drivers/scsi/ufs/ufshcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6982,7 +6982,7 @@ static struct scsi_host_template ufshcd_driver_template = {
69826982
.max_host_blocked = 1,
69836983
.track_queue_depth = 1,
69846984
.sdev_groups = ufshcd_driver_groups,
6985-
.use_clustering = DISABLE_CLUSTERING,
6985+
.dma_boundary = PAGE_SIZE - 1,
69866986
};
69876987

69886988
static int ufshcd_config_vreg_load(struct device *dev, struct ufs_vreg *vreg,

drivers/target/loopback/tcm_loop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static struct scsi_host_template tcm_loop_driver_template = {
324324
.sg_tablesize = 256,
325325
.cmd_per_lun = 1024,
326326
.max_sectors = 0xFFFF,
327-
.use_clustering = DISABLE_CLUSTERING,
327+
.dma_boundary = PAGE_SIZE - 1,
328328
.slave_alloc = tcm_loop_slave_alloc,
329329
.module = THIS_MODULE,
330330
.track_queue_depth = 1,

drivers/usb/storage/uas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ static struct scsi_host_template uas_host_template = {
879879
.this_id = -1,
880880
.sg_tablesize = SG_NONE,
881881
.skip_settle_delay = 1,
882-
.use_clustering = DISABLE_CLUSTERING,
882+
.dma_boundary = PAGE_SIZE - 1,
883883
};
884884

885885
#define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \

include/scsi/scsi_host.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ struct blk_queue_tags;
4444
#define MODE_INITIATOR 0x01
4545
#define MODE_TARGET 0x02
4646

47-
#define DISABLE_CLUSTERING (-1)
48-
4947
struct scsi_host_template {
5048
struct module *module;
5149
const char *name;
@@ -418,16 +416,6 @@ struct scsi_host_template {
418416
*/
419417
unsigned unchecked_isa_dma:1;
420418

421-
/*
422-
* True if this host adapter can make good use of clustering.
423-
* I originally thought that if the tablesize was large that it
424-
* was a waste of CPU cycles to prepare a cluster list, but
425-
* it works out that the Buslogic is faster if you use a smaller
426-
* number of segments (i.e. use clustering). I guess it is
427-
* inefficient.
428-
*/
429-
unsigned use_clustering:1;
430-
431419
/*
432420
* True for emulated SCSI host adapters (e.g. ATAPI).
433421
*/
@@ -626,7 +614,6 @@ struct Scsi_Host {
626614

627615
unsigned active_mode:2;
628616
unsigned unchecked_isa_dma:1;
629-
unsigned use_clustering:1;
630617

631618
/*
632619
* Host has requested that no further requests come through for the

0 commit comments

Comments
 (0)