From 2a3d4eb8e228061c09d5ca8bf39e7f00c2091213 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Dec 2018 16:17:02 +0100 Subject: scsi: flip the default on use_clustering Most SCSI drivers want to enable "clustering", that is merging of segments so that they might span more than a single page. Remove the ENABLE_CLUSTERING define, and require drivers to explicitly set DISABLE_CLUSTERING to disable this feature. Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen --- include/scsi/scsi_host.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 5ea06d310a25..7dc534c794dc 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -44,8 +44,7 @@ struct blk_queue_tags; #define MODE_INITIATOR 0x01 #define MODE_TARGET 0x02 -#define DISABLE_CLUSTERING 0 -#define ENABLE_CLUSTERING 1 +#define DISABLE_CLUSTERING (-1) struct scsi_host_template { struct module *module; -- cgit From 50c2e9107f176a82e14567b39c5d0f2a208cc82c Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Dec 2018 16:17:03 +0100 Subject: scsi: introduce a max_segment_size host_template parameters This allows the host driver to indicate the maximum supported segment size in a nice an easy way, so that the driver doesn't have to worry about DMA-layer imposed limitations. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- include/scsi/scsi_host.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/scsi') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 7dc534c794dc..834204681ca3 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -364,6 +364,11 @@ struct scsi_host_template { */ unsigned int max_sectors; + /* + * Maximum size in bytes of a single segment. + */ + unsigned int max_segment_size; + /* * DMA scatter gather segment boundary limit. A segment crossing this * boundary will be split in two. @@ -603,6 +608,7 @@ struct Scsi_Host { short unsigned int sg_tablesize; short unsigned int sg_prot_tablesize; unsigned int max_sectors; + unsigned int max_segment_size; unsigned long dma_boundary; /* * In scsi-mq mode, the number of hardware queues supported by the LLD. -- cgit From 4af14d113bcf95c12d1462ba623b7e7117bd3fb3 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Dec 2018 16:17:09 +0100 Subject: 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 Signed-off-by: Martin K. Petersen --- include/scsi/scsi_host.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 834204681ca3..7ba34a0ca8bf 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -44,8 +44,6 @@ struct blk_queue_tags; #define MODE_INITIATOR 0x01 #define MODE_TARGET 0x02 -#define DISABLE_CLUSTERING (-1) - struct scsi_host_template { struct module *module; const char *name; @@ -418,16 +416,6 @@ struct scsi_host_template { */ unsigned unchecked_isa_dma:1; - /* - * True if this host adapter can make good use of clustering. - * I originally thought that if the tablesize was large that it - * was a waste of CPU cycles to prepare a cluster list, but - * it works out that the Buslogic is faster if you use a smaller - * number of segments (i.e. use clustering). I guess it is - * inefficient. - */ - unsigned use_clustering:1; - /* * True for emulated SCSI host adapters (e.g. ATAPI). */ @@ -626,7 +614,6 @@ struct Scsi_Host { unsigned active_mode:2; unsigned unchecked_isa_dma:1; - unsigned use_clustering:1; /* * Host has requested that no further requests come through for the -- cgit