Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1300181 > unrolled thread

[PATCH v4 00/78] More fixes, cleanup and modernization for NCR5380 drivers

Started byFinn Thain <fthain@telegraphics.com.au>
First post2016-01-03 06:20 +0100
Last post2016-01-07 04:00 +0100
Articles 4 on this page of 84 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v4 00/78] More fixes, cleanup and modernization for NCR5380 drivers Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:20 +0100
    [PATCH v4 63/78] atari_NCR5380: Remove HOSTNO macro from printk() and seq_printf() calls Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 29/78] ncr5380: Remove references to linked commands Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 73/78] ncr5380: Fix pseudo DMA transfers on 53C400 Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 21/78] ncr5380: Sleep when polling, if possible Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 33/78] atari_NCR5380: Set do_abort() timeouts Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 53/78] ncr5380: Use shost_priv helper Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 62/78] ncr5380: Implement new eh_bus_reset_handler Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 60/78] ncr5380: Implement new eh_abort_handler Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 51/78] ncr5380: Remove command list debug code Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 68/78] ncr5380: Fix trailing whitespace using regexp Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 38/78] ncr5380: Remove UNSAFE macro Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 46/78] ncr5380: Fix NDEBUG_NO_DATAOUT flag Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 47/78] ncr5380: Fix and cleanup scsi_host_template initializers Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 44/78] ncr5380: Fix off-by-one bug in extended_msg[] bounds check Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 55/78] ncr5380: Remove LIST and REMOVE macros Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 69/78] ncr5380: Fix whitespace in comments using regexp Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
      Re: [PATCH v4 69/78] ncr5380: Fix whitespace in comments using  regexp Joe Perches <joe@perches.com> - 2016-01-03 09:00 +0100
        Re: [PATCH v4 69/78] ncr5380: Fix whitespace in comments using  regexp Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 09:20 +0100
        Re: [PATCH v4 69/78] ncr5380: Fix whitespace in comments using  regexp One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-01-03 15:20 +0100
          Re: [PATCH v4 69/78] ncr5380: Fix whitespace in comments using  regexp Joe Perches <joe@perches.com> - 2016-01-03 19:30 +0100
            Re: [PATCH v4 69/78] ncr5380: Fix whitespace in comments using  regexp One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-01-03 22:40 +0100
              Re: [PATCH v4 69/78] ncr5380: Fix whitespace in comments using  regexp Joe Perches <joe@perches.com> - 2016-01-03 22:50 +0100
                Re: [PATCH v4 69/78] ncr5380: Fix whitespace in comments using  regexp Joe Perches <joe@perches.com> - 2016-01-03 23:20 +0100
    [PATCH v4 71/78] atari_NCR5380: Merge changes from NCR5380.c Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 70/78] ncr5380: Merge changes from atari_NCR5380.c Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 52/78] ncr5380: Remove H_NO macro and introduce dsprintk Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 31/78] ncr5380: Fix !REQ timeout in do_abort() Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 74/78] ncr5380: Use runtime register mapping Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 76/78] ncr5380: Enable PDMA for DTC chips Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 67/78] ncr5380: Cleanup comments Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 39/78] ncr5380: Standardize interrupt handling Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 65/78] atari_scsi, sun3_scsi: Remove global Scsi_Host pointer Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 57/78] ncr5380: Use standard list data structure Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 42/78] ncr5380: Replace READ_OVERRUNS macro with FLAG_NO_DMA_FIXUPS Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 56/78] ncr5380: Remove redundant volatile qualifiers Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 59/78] ncr5380: Fix autosense bugs Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 45/78] ncr5380: Cleanup #include directives Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 75/78] ncr5380: Enable PDMA for NCR53C400A Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 48/78] atari_NCR5380: Fix queue_size limit Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 54/78] ncr5380: Use dsprintk() for queue debugging Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 08/78] ncr5380: Move NCR53C400-specific code Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 35/78] ncr5380: Dont wait for BUS FREE after disconnect Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 10/78] atari_NCR5380: Remove RESET_BOOT, CONFIG_ATARI_SCSI_TOSHIBA_DELAY and CONFIG_ATARI_SCSI_RESET_BOOT Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 58/78] ncr5380: Refactor command completion Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 64/78] atari_NCR5380: Eliminate HOSTNO macro Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 78/78] ncr5380: Add support for HP C2502 Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 72/78] ncr5380: Cleanup whitespace and parentheses Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 77/78] ncr5380: Fix wait for 53C80 registers registers after PDMA Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 61/78] ncr5380: Fix EH during arbitration and selection Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 03/78] ncr5380: Eliminate PDEBUG*, TDEBUG* and DTCDEBUG* macros Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 66/78] ncr5380: Fix soft lockups Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:30 +0100
    [PATCH v4 32/78] ncr5380: Fix bus phase in do_abort() Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 06/78] ncr5380: Remove NCR5380_instance_name macro Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 34/78] atari_NCR5380: Use arbitration timeout Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 50/78] ncr5380: Change instance->host_lock to hostdata->lock Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 22/78] ncr5380: Eliminate selecting state Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 27/78] ncr5380: Add missing lock in eh_abort_handler Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 20/78] ncr5380: Introduce unbound workqueue Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 11/78] ncr5380: Simplify bus reset handlers Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 17/78] ncr5380: Keep BSY asserted when entering SELECTION phase Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 05/78] ncr5380: Remove NCR5380_local_declare and NCR5380_setup macros Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 37/78] ncr5380: Standardize work queueing algorithm Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 12/78] ncr5380: Remove unused hostdata->aborted flag Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 49/78] ncr5380: Remove redundant ICR_ARBITRATION_LOST test and eliminate FLAG_DTC3181E Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 28/78] ncr5380: Drop DEF_SCSI_QCMD macro Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 40/78] ncr5380: Introduce NCR5380_poll_politely2 Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 30/78] ncr5380: Add missing break after case MESSAGE_REJECT Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 43/78] ncr5380: Standardize reselection handling Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 26/78] ncr5380: Fix NCR5380_transfer_pio() result Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 19/78] ncr5380: Cleanup bogus {request,release}_region() calls Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 07/78] ncr5380: Split NCR5380_init() into two functions Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 36/78] ncr5380: Use work_struct instead of delayed_work Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 25/78] ncr5380: Rework disconnect versus poll logic Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 09/78] atari_NCR5380: Reset bus on driver initialization if required Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 41/78] ncr5380: Replace redundant flags with FLAG_NO_DMA_FIXUP Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:40 +0100
    [PATCH v4 15/78] ncr5380: Always escalate bad target time-out in NCR5380_select() Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:50 +0100
    [PATCH v4 01/78] atari_scsi: Fix SCSI host ID setting Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:50 +0100
    [PATCH v4 16/78] ncr5380: Proceed with next command after NCR5380_select() calls scsi_done Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:50 +0100
    [PATCH v4 14/78] ncr5380: Use return instead of goto in NCR5380_select() Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:50 +0100
    [PATCH v4 04/78] ncr5380: Remove more pointless macros Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:50 +0100
    [PATCH v4 18/78] ncr5380: Eliminate USLEEP_WAITLONG delay Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:50 +0100
    [PATCH v4 02/78] ncr5380: Remove redundant static variable initializers Finn Thain <fthain@telegraphics.com.au> - 2016-01-03 06:50 +0100
    Re: [PATCH v4 00/78] More fixes, cleanup and modernization for NCR5380 drivers "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-01-07 04:00 +0100

Page 5 of 5 — ← Prev page 1 2 3 4 [5]


#1300258 — [PATCH v4 04/78] ncr5380: Remove more pointless macros

FromFinn Thain <fthain@telegraphics.com.au>
Date2016-01-03 06:50 +0100
Subject[PATCH v4 04/78] ncr5380: Remove more pointless macros
Message-ID<qMJIe-1kw-9@gated-at.bofh.it>
In reply to#1300181
ASM macro is never defined. rtrc in pas16.c is not used.
NCR5380_map_config, do_NCR5380_intr, do_t128_intr and do_pas16_intr
are unused. NCR_NOT_SET harms readability. Remove them.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>

---
 drivers/scsi/NCR5380.h   |    3 ---
 drivers/scsi/g_NCR5380.c |   29 ++++++++++++++---------------
 drivers/scsi/g_NCR5380.h |    5 -----
 drivers/scsi/pas16.c     |   16 ----------------
 drivers/scsi/pas16.h     |    5 -----
 drivers/scsi/t128.h      |    4 ----
 6 files changed, 14 insertions(+), 48 deletions(-)

Index: linux/drivers/scsi/NCR5380.h
===================================================================
--- linux.orig/drivers/scsi/NCR5380.h	2016-01-03 16:02:39.000000000 +1100
+++ linux/drivers/scsi/NCR5380.h	2016-01-03 16:02:54.000000000 +1100
@@ -244,8 +244,6 @@
 #define FLAG_LATE_DMA_SETUP		32	/* Setup NCR before DMA H/W */
 #define FLAG_TAGGED_QUEUING		64	/* as X3T9.2 spelled it */
 
-#ifndef ASM
-
 #ifdef SUPPORT_TAGS
 struct tag_alloc {
 	DECLARE_BITMAP(allocated, MAX_TAGS);
@@ -443,5 +441,4 @@ static __inline__ int NCR5380_pc_dma_res
 #endif				/* defined(i386) || defined(__alpha__) */
 #endif				/* defined(REAL_DMA)  */
 #endif				/* __KERNEL__ */
-#endif				/* ndef ASM */
 #endif				/* NCR5380_H */
Index: linux/drivers/scsi/g_NCR5380.c
===================================================================
--- linux.orig/drivers/scsi/g_NCR5380.c	2016-01-03 16:02:42.000000000 +1100
+++ linux/drivers/scsi/g_NCR5380.c	2016-01-03 16:02:54.000000000 +1100
@@ -82,14 +82,13 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 
-#define NCR_NOT_SET 0
-static int ncr_irq = NCR_NOT_SET;
-static int ncr_dma = NCR_NOT_SET;
-static int ncr_addr = NCR_NOT_SET;
-static int ncr_5380 = NCR_NOT_SET;
-static int ncr_53c400 = NCR_NOT_SET;
-static int ncr_53c400a = NCR_NOT_SET;
-static int dtc_3181e = NCR_NOT_SET;
+static int ncr_irq;
+static int ncr_dma;
+static int ncr_addr;
+static int ncr_5380;
+static int ncr_53c400;
+static int ncr_53c400a;
+static int dtc_3181e;
 
 static struct override {
 	NCR5380_map_type NCR5380_map_name;
@@ -271,19 +270,19 @@ static int __init generic_NCR5380_detect
 	void __iomem *iomem;
 #endif
 
-	if (ncr_irq != NCR_NOT_SET)
+	if (ncr_irq)
 		overrides[0].irq = ncr_irq;
-	if (ncr_dma != NCR_NOT_SET)
+	if (ncr_dma)
 		overrides[0].dma = ncr_dma;
-	if (ncr_addr != NCR_NOT_SET)
+	if (ncr_addr)
 		overrides[0].NCR5380_map_name = (NCR5380_map_type) ncr_addr;
-	if (ncr_5380 != NCR_NOT_SET)
+	if (ncr_5380)
 		overrides[0].board = BOARD_NCR5380;
-	else if (ncr_53c400 != NCR_NOT_SET)
+	else if (ncr_53c400)
 		overrides[0].board = BOARD_NCR53C400;
-	else if (ncr_53c400a != NCR_NOT_SET)
+	else if (ncr_53c400a)
 		overrides[0].board = BOARD_NCR53C400A;
-	else if (dtc_3181e != NCR_NOT_SET)
+	else if (dtc_3181e)
 		overrides[0].board = BOARD_DTC3181E;
 #ifndef SCSI_G_NCR5380_MEM
 	if (!current_override && isapnp_present()) {
Index: linux/drivers/scsi/g_NCR5380.h
===================================================================
--- linux.orig/drivers/scsi/g_NCR5380.h	2016-01-03 16:02:39.000000000 +1100
+++ linux/drivers/scsi/g_NCR5380.h	2016-01-03 16:02:54.000000000 +1100
@@ -21,8 +21,6 @@
 #define NCR5380_BIOSPARAM NULL
 #endif
 
-#ifndef ASM
-
 #ifndef CMD_PER_LUN
 #define CMD_PER_LUN 2
 #endif
@@ -36,7 +34,6 @@
 
 #ifndef SCSI_G_NCR5380_MEM
 
-#define NCR5380_map_config port
 #define NCR5380_map_type int
 #define NCR5380_map_name port
 #define NCR5380_instance_name io_port
@@ -64,7 +61,6 @@
 #else 
 /* therefore SCSI_G_NCR5380_MEM */
 
-#define NCR5380_map_config memory
 #define NCR5380_map_type unsigned long
 #define NCR5380_map_name base
 #define NCR5380_instance_name base
@@ -103,6 +99,5 @@
 #define BOARD_NCR53C400A 2
 #define BOARD_DTC3181E	3
 
-#endif /* ndef ASM */
 #endif /* GENERIC_NCR5380_H */
 
Index: linux/drivers/scsi/pas16.c
===================================================================
--- linux.orig/drivers/scsi/pas16.c	2016-01-03 16:02:47.000000000 +1100
+++ linux/drivers/scsi/pas16.c	2016-01-03 16:02:54.000000000 +1100
@@ -145,22 +145,6 @@ static const unsigned short  pas16_offse
 		    * START_DMA_INITIATOR_RECEIVE_REG wo
 		    */
     };
-/*----------------------------------------------------------------*/
-/* the following will set the monitor border color (useful to find
- where something crashed or gets stuck at */
-/* 1 = blue
- 2 = green
- 3 = cyan
- 4 = red
- 5 = magenta
- 6 = yellow
- 7 = white
-*/
-#if 1
-#define rtrc(i) {inb(0x3da); outb(0x31, 0x3c0); outb((i), 0x3c0);}
-#else
-#define rtrc(i) {}
-#endif
 
 
 /*
Index: linux/drivers/scsi/pas16.h
===================================================================
--- linux.orig/drivers/scsi/pas16.h	2016-01-03 16:02:47.000000000 +1100
+++ linux/drivers/scsi/pas16.h	2016-01-03 16:02:54.000000000 +1100
@@ -95,9 +95,6 @@
 #define OPERATION_MODE_1 0xec03
 #define IO_CONFIG_3 0xf002
 
-
-#ifndef ASM
-
 #ifndef CMD_PER_LUN
 #define CMD_PER_LUN 2
 #endif
@@ -121,7 +118,6 @@
 #define NCR5380_write(reg, value) ( outb((value),PAS16_io_port(reg)) )
 
 #define NCR5380_intr pas16_intr
-#define do_NCR5380_intr do_pas16_intr
 #define NCR5380_queue_command pas16_queue_command
 #define NCR5380_abort pas16_abort
 #define NCR5380_bus_reset pas16_bus_reset
@@ -134,5 +130,4 @@
    
 #define PAS16_IRQS 0xd4a8 
 
-#endif /* ndef ASM */
 #endif /* PAS16_H */
Index: linux/drivers/scsi/t128.h
===================================================================
--- linux.orig/drivers/scsi/t128.h	2016-01-03 16:02:47.000000000 +1100
+++ linux/drivers/scsi/t128.h	2016-01-03 16:02:54.000000000 +1100
@@ -67,8 +67,6 @@
 
 #define T_DATA_REG_OFFSET	0x1e00	/* rw 512 bytes long */
 
-#ifndef ASM
-
 #ifndef CMD_PER_LUN
 #define CMD_PER_LUN 2
 #endif
@@ -92,7 +90,6 @@
 #define NCR5380_write(reg, value) writeb((value),(T128_address(reg)))
 
 #define NCR5380_intr t128_intr
-#define do_NCR5380_intr do_t128_intr
 #define NCR5380_queue_command t128_queue_command
 #define NCR5380_abort t128_abort
 #define NCR5380_bus_reset t128_bus_reset
@@ -105,5 +102,4 @@
 
 #define T128_IRQS 0xc4a8
 
-#endif /* ndef ASM */
 #endif /* T128_H */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1300259 — [PATCH v4 18/78] ncr5380: Eliminate USLEEP_WAITLONG delay

FromFinn Thain <fthain@telegraphics.com.au>
Date2016-01-03 06:50 +0100
Subject[PATCH v4 18/78] ncr5380: Eliminate USLEEP_WAITLONG delay
Message-ID<qMJIe-1kw-11@gated-at.bofh.it>
In reply to#1300181
Linux 2.1.105 introduced the USLEEP_WAITLONG delay, apparently "needed for
Mustek scanners". It is intended to stall the issue queue for 5 seconds.
There are a number of problems with this.

1. Only g_NCR5380 enables the delay, which implies that the other five
   drivers using the NCR5380.c core driver remain incompatible with
   Mustek scanners.

2. The delay is not implemented by atari_NCR5380.c, which is problematic
   for re-unifying the two core driver forks.

3. The delay is implemented using NCR5380_set_timer() which makes it
   unreliable. A new command queued by the mid-layer cancels the delay.

4. The delay is applied indiscriminately in several situations in which
   NCR5380_select() returns -1. These are-- reselection by the target,
   failure of the target to assert BSY, and failure of the target to
   assert REQ. It's clear from the comments that USLEEP_WAITLONG is not
   relevant to the reselection case. And reportedly, these scanners do
   not disconnect.

5. atari_NCR5380.c was forked before Linux 2.1.105, so it was spared some
   of the damage done to NCR5380.c. In this case, the atari_NCR5380.c core
   driver was more standard-compliant and may not have needed any
   workaround like the USLEEP_WAITLONG kludge. The compliance issue was
   addressed in the previous patch.

If these scanners still don't work, we need a better solution. Retrying
selection until EH aborts a command offers equivalent robustness. Bugs in
the existing driver prevent EH working correctly but this is addressed in
a subsequent patch. Remove USLEEP_WAITLONG.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>

---
 drivers/scsi/NCR5380.c   |   19 +++++--------------
 drivers/scsi/g_NCR5380.c |    1 -
 2 files changed, 5 insertions(+), 15 deletions(-)

Index: linux/drivers/scsi/NCR5380.c
===================================================================
--- linux.orig/drivers/scsi/NCR5380.c	2016-01-03 16:03:19.000000000 +1100
+++ linux/drivers/scsi/NCR5380.c	2016-01-03 16:03:20.000000000 +1100
@@ -468,10 +468,6 @@ static void NCR5380_print_phase(struct S
 #ifndef USLEEP_POLL
 #define USLEEP_POLL msecs_to_jiffies(200)
 #endif
-#ifndef USLEEP_WAITLONG
-/* RvC: (reasonable time to wait on select error) */
-#define USLEEP_WAITLONG USLEEP_SLEEP
-#endif
 
 /* 
  * Function : int should_disconnect (unsigned char cmd)
@@ -619,8 +615,8 @@ static void prepare_info(struct Scsi_Hos
 	         "can_queue %d, cmd_per_lun %d, "
 	         "sg_tablesize %d, this_id %d, "
 	         "flags { %s%s%s%s}, "
-#if defined(USLEEP_POLL) && defined(USLEEP_WAITLONG)
-		 "USLEEP_POLL %lu, USLEEP_WAITLONG %lu, "
+#if defined(USLEEP_POLL) && defined(USLEEP_SLEEP)
+		 "USLEEP_POLL %lu, USLEEP_SLEEP %lu, "
 #endif
 	         "options { %s} ",
 	         instance->hostt->name, instance->io_port, instance->n_io_port,
@@ -631,8 +627,8 @@ static void prepare_info(struct Scsi_Hos
 	         hostdata->flags & FLAG_DTC3181E      ? "DTC3181E "      : "",
 	         hostdata->flags & FLAG_NO_PSEUDO_DMA ? "NO_PSEUDO_DMA " : "",
 	         hostdata->flags & FLAG_TOSHIBA_DELAY ? "TOSHIBA_DELAY "  : "",
-#if defined(USLEEP_POLL) && defined(USLEEP_WAITLONG)
-	         USLEEP_POLL, USLEEP_WAITLONG,
+#if defined(USLEEP_POLL) && defined(USLEEP_SLEEP)
+	         USLEEP_POLL, USLEEP_SLEEP,
 #endif
 #ifdef AUTOPROBE_IRQ
 	         "AUTOPROBE_IRQ "
@@ -1030,15 +1026,10 @@ static void NCR5380_main(struct work_str
 			if (!NCR5380_select(instance, tmp)) {
 				/* OK or bad target */
 			} else {
-				/* RvC: device failed, so we wait a long time
-				   this is needed for Mustek scanners, that
-				   do not respond to commands immediately
-				   after a scan */
-				printk(KERN_DEBUG "scsi%d: device %d did not respond in time\n", instance->host_no, tmp->device->id);
 				LIST(tmp, hostdata->issue_queue);
 				tmp->host_scribble = (unsigned char *) hostdata->issue_queue;
 				hostdata->issue_queue = tmp;
-				NCR5380_set_timer(hostdata, USLEEP_WAITLONG);
+				done = 0;
 			}
 		}	/* if hostdata->selecting */
 		if (hostdata->connected
Index: linux/drivers/scsi/g_NCR5380.c
===================================================================
--- linux.orig/drivers/scsi/g_NCR5380.c	2016-01-03 16:03:06.000000000 +1100
+++ linux/drivers/scsi/g_NCR5380.c	2016-01-03 16:03:20.000000000 +1100
@@ -59,7 +59,6 @@
 /* settings for DTC3181E card with only Mustek scanner attached */
 #define USLEEP_POLL	msecs_to_jiffies(10)
 #define USLEEP_SLEEP	msecs_to_jiffies(200)
-#define USLEEP_WAITLONG	msecs_to_jiffies(5000)
 
 #define AUTOPROBE_IRQ
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1300260 — [PATCH v4 02/78] ncr5380: Remove redundant static variable initializers

FromFinn Thain <fthain@telegraphics.com.au>
Date2016-01-03 06:50 +0100
Subject[PATCH v4 02/78] ncr5380: Remove redundant static variable initializers
Message-ID<qMJIf-1kw-13@gated-at.bofh.it>
In reply to#1300181
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>

---
 drivers/scsi/NCR5380.c   |    2 +-
 drivers/scsi/dtc.c       |    4 ++--
 drivers/scsi/g_NCR5380.c |    4 ++--
 drivers/scsi/pas16.c     |   10 +++++-----
 drivers/scsi/sun3_scsi.c |    8 ++++----
 drivers/scsi/t128.c      |    4 ++--
 6 files changed, 16 insertions(+), 16 deletions(-)

Index: linux/drivers/scsi/NCR5380.c
===================================================================
--- linux.orig/drivers/scsi/NCR5380.c	2016-01-03 16:02:39.000000000 +1100
+++ linux/drivers/scsi/NCR5380.c	2016-01-03 16:02:42.000000000 +1100
@@ -534,7 +534,7 @@ static void NCR5380_set_timer(struct NCR
 }
 
 
-static int probe_irq __initdata = 0;
+static int probe_irq __initdata;
 
 /**
  *	probe_intr	-	helper for IRQ autoprobe
Index: linux/drivers/scsi/dtc.c
===================================================================
--- linux.orig/drivers/scsi/dtc.c	2016-01-03 16:02:39.000000000 +1100
+++ linux/drivers/scsi/dtc.c	2016-01-03 16:02:42.000000000 +1100
@@ -150,7 +150,7 @@ static const struct signature {
 
 static int __init dtc_setup(char *str)
 {
-	static int commandline_current = 0;
+	static int commandline_current;
 	int i;
 	int ints[10];
 
@@ -188,7 +188,7 @@ __setup("dtc=", dtc_setup);
 
 static int __init dtc_detect(struct scsi_host_template * tpnt)
 {
-	static int current_override = 0, current_base = 0;
+	static int current_override, current_base;
 	struct Scsi_Host *instance;
 	unsigned int addr;
 	void __iomem *base;
Index: linux/drivers/scsi/g_NCR5380.c
===================================================================
--- linux.orig/drivers/scsi/g_NCR5380.c	2016-01-03 16:02:39.000000000 +1100
+++ linux/drivers/scsi/g_NCR5380.c	2016-01-03 16:02:42.000000000 +1100
@@ -121,7 +121,7 @@ static struct override {
 
 static void __init internal_setup(int board, char *str, int *ints)
 {
-	static int commandline_current = 0;
+	static int commandline_current;
 	switch (board) {
 	case BOARD_NCR5380:
 		if (ints[0] != 2 && ints[0] != 3) {
@@ -251,7 +251,7 @@ static int __init do_DTC3181E_setup(char
 
 static int __init generic_NCR5380_detect(struct scsi_host_template *tpnt)
 {
-	static int current_override = 0;
+	static int current_override;
 	int count;
 	unsigned int *ports;
 #ifndef SCSI_G_NCR5380_MEM
Index: linux/drivers/scsi/pas16.c
===================================================================
--- linux.orig/drivers/scsi/pas16.c	2016-01-03 16:02:39.000000000 +1100
+++ linux/drivers/scsi/pas16.c	2016-01-03 16:02:42.000000000 +1100
@@ -87,8 +87,8 @@
 #include "NCR5380.h"
 
 
-static unsigned short pas16_addr = 0;
-static int pas16_irq = 0;
+static unsigned short pas16_addr;
+static int pas16_irq;
  
 
 static const int scsi_irq_translate[] =
@@ -305,7 +305,7 @@ static int __init
 
 static int __init pas16_setup(char *str)
 {
-    static int commandline_current = 0;
+	static int commandline_current;
     int i;
     int ints[10];
 
@@ -344,8 +344,8 @@ __setup("pas16=", pas16_setup);
 
 static int __init pas16_detect(struct scsi_host_template *tpnt)
 {
-    static int current_override = 0;
-    static unsigned short current_base = 0;
+	static int current_override;
+	static unsigned short current_base;
     struct Scsi_Host *instance;
     unsigned short io_port;
     int  count;
Index: linux/drivers/scsi/sun3_scsi.c
===================================================================
--- linux.orig/drivers/scsi/sun3_scsi.c	2016-01-03 16:02:39.000000000 +1100
+++ linux/drivers/scsi/sun3_scsi.c	2016-01-03 16:02:42.000000000 +1100
@@ -100,10 +100,10 @@ static struct scsi_cmnd *sun3_dma_setup_
 static unsigned char *sun3_scsi_regp;
 static volatile struct sun3_dma_regs *dregs;
 static struct sun3_udc_regs *udc_regs;
-static unsigned char *sun3_dma_orig_addr = NULL;
-static unsigned long sun3_dma_orig_count = 0;
-static int sun3_dma_active = 0;
-static unsigned long last_residual = 0;
+static unsigned char *sun3_dma_orig_addr;
+static unsigned long sun3_dma_orig_count;
+static int sun3_dma_active;
+static unsigned long last_residual;
 static struct Scsi_Host *default_instance;
 
 /*
Index: linux/drivers/scsi/t128.c
===================================================================
--- linux.orig/drivers/scsi/t128.c	2016-01-03 16:02:39.000000000 +1100
+++ linux/drivers/scsi/t128.c	2016-01-03 16:02:42.000000000 +1100
@@ -126,7 +126,7 @@ static struct signature {
 
 static int __init t128_setup(char *str)
 {
-    static int commandline_current = 0;
+	static int commandline_current;
     int i;
     int ints[10];
 
@@ -165,7 +165,7 @@ __setup("t128=", t128_setup);
 
 static int __init t128_detect(struct scsi_host_template *tpnt)
 {
-    static int current_override = 0, current_base = 0;
+	static int current_override, current_base;
     struct Scsi_Host *instance;
     unsigned long base;
     void __iomem *p;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1303255

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2016-01-07 04:00 +0100
Message-ID<qO8XU-1Eh-15@gated-at.bofh.it>
In reply to#1300181
>>>>> "Finn" == Finn Thain <fthain@telegraphics.com.au> writes:

Finn> Like my previous work on the NCR5380 drivers, this patch series
Finn> has bug fixes, code cleanup and modernization. These drivers
Finn> suffer from mistakes, poor style and neglect and this long series
Finn> addresses the worst of it, covering all ten wrapper drivers and
Finn> both of the core driver forks. The combined size of the drivers is
Finn> reduced by over 700 LoC.

I have staged this for inclusion in a separate branch. Will pull it into
the main queue unless kbuild complains.

http://git.kernel.org/cgit/linux/kernel/git/mkp/scsi.git/log/?h=4.5/ncr5380

-- 
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Page 5 of 5 — ← Prev page 1 2 3 4 [5]

Back to top | Article view | linux.kernel


csiph-web