Skip to contentSkip to conversation

make ncr53c8xx work with bio.

PATCH In review Dave Jones 2 participants 2 messages Dec 4, 2001 SCSI

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

PATCH 1/1 make ncr53c8xx work with bio.

Hi folks,
Patch below makes ncr53c8xx driver compile again in 2.5.1pre5. Seems to have survived yesterdays torture tests.

regards,
Dave.

drivers/scsi/ncr53c8xx.c +4 -4
diff -urN --exclude-from=/home/davej/.exclude linux/drivers/scsi/ncr53c8xx.c linux-dj/drivers/scsi/ncr53c8xx.c
@@ -8625,9 +8625,9 @@
      if (DEBUG_FLAGS & DEBUG_TINY) printk ("]\n");
 
      if (done_list) {
-          NCR_LOCK_SCSI_DONE(np, flags);
+          NCR_LOCK_SCSI_DONE(done_list->host, flags);
           ncr_flush_done_cmds(done_list);
-          NCR_UNLOCK_SCSI_DONE(np, flags);
+          NCR_UNLOCK_SCSI_DONE(done_list->host, flags);
      }
 }
 
@@ -8648,9 +8648,9 @@
      NCR_UNLOCK_NCB(np, flags);
 
      if (done_list) {
-          NCR_LOCK_SCSI_DONE(np, flags);
+          NCR_LOCK_SCSI_DONE(done_list->host, flags);
           ncr_flush_done_cmds(done_list);
-          NCR_UNLOCK_SCSI_DONE(np, flags);
+          NCR_UNLOCK_SCSI_DONE(done_list->host, flags);
      }
 }
 
drivers/scsi/sym53c8xx_comm.h +6 -6
diff -urN --exclude-from=/home/davej/.exclude linux/drivers/scsi/sym53c8xx_comm.h linux-dj/drivers/scsi/sym53c8xx_comm.h
@@ -438,10 +438,10 @@
 #define	NCR_LOCK_NCB(np, flags)    spin_lock_irqsave(&np->smp_lock, flags)
 #define	NCR_UNLOCK_NCB(np, flags)  spin_unlock_irqrestore(&np->smp_lock, flags)
 
-#define	NCR_LOCK_SCSI_DONE(np, flags) \
-		spin_lock_irqsave(&io_request_lock, flags)
-#define	NCR_UNLOCK_SCSI_DONE(np, flags) \
-		spin_unlock_irqrestore(&io_request_lock, flags)
+#define	NCR_LOCK_SCSI_DONE(host, flags) \
+		spin_lock_irqsave(&(host)->host_lock, flags)
+#define	NCR_UNLOCK_SCSI_DONE(host, flags) \
+		spin_unlock_irqrestore(&((host)->host_lock), flags)
 
 #else
 
@@ -452,8 +452,8 @@
 #define	NCR_LOCK_NCB(np, flags)    do { save_flags(flags); cli(); } while (0)
 #define	NCR_UNLOCK_NCB(np, flags)  do { restore_flags(flags); } while (0)
 
-#define	NCR_LOCK_SCSI_DONE(np, flags)    do {;} while (0)
-#define	NCR_UNLOCK_SCSI_DONE(np, flags)  do {;} while (0)
+#define	NCR_LOCK_SCSI_DONE(host, flags)    do {;} while (0)
+#define	NCR_UNLOCK_SCSI_DONE(host, flags)  do {;} while (0)
 
 #endif
 
Signature · 2 lines
| Dave Jones.                    http://www.codemonkey.org.uk
| SuSE Labs .
#1 lore raw

Hi Dave,

Indeed the patch does make the ncr53c8xx driver compile and work again. If Linus accepts to apply your patch, this will be just fine.

However, the question about still having ncr53c8xx and may-be sym53c8xx version 1 in linux-2.5, given that sym-2 can, at least in theory, replaces both, is not yet answered.

Anyway, at minimal, these drivers should get made conformant to eh expectations and also modified as follows:

- Remove the double spin_locking.

- Remove the batching of completions prior to give them back to upper layer. This is useless given that no recursive call can happen and such batching is done by scsi layer thanks to forced new eh.

Such changes are easy to make, at least by me, and I will propose them if it gets proven that these drivers versions are still useful for linux-2.5. This depends obviously on the actual reliability of sym-2 compared to the bundle ncr53c8xx/sym53c8xx. Only practice can give the right answer.

In the meantime, maintaining these drivers at minimal compilable and working is certainly a good thing.

Gérard.

Quoted 69 lines · Dave Jones

Hi folks,
Patch below makes ncr53c8xx driver compile again in 2.5.1pre5. Seems to have survived yesterdays torture tests.

regards,
Dave.

diff -urN --exclude-from=/home/davej/.exclude linux/drivers/scsi/ncr53c8xx.c linux-dj/drivers/scsi/ncr53c8xx.c

drivers/scsi/ncr53c8xx.c +4 -4
@@ -8625,9 +8625,9 @@
      if (DEBUG_FLAGS & DEBUG_TINY) printk ("]\n");
 
      if (done_list) {
-          NCR_LOCK_SCSI_DONE(np, flags);
+          NCR_LOCK_SCSI_DONE(done_list->host, flags);
           ncr_flush_done_cmds(done_list);
-          NCR_UNLOCK_SCSI_DONE(np, flags);
+          NCR_UNLOCK_SCSI_DONE(done_list->host, flags);
      }
 }
 
@@ -8648,9 +8648,9 @@
      NCR_UNLOCK_NCB(np, flags);
 
      if (done_list) {
-          NCR_LOCK_SCSI_DONE(np, flags);
+          NCR_LOCK_SCSI_DONE(done_list->host, flags);
           ncr_flush_done_cmds(done_list);
-          NCR_UNLOCK_SCSI_DONE(np, flags);
+          NCR_UNLOCK_SCSI_DONE(done_list->host, flags);
      }
 }
 

diff -urN --exclude-from=/home/davej/.exclude linux/drivers/scsi/sym53c8xx_comm.h linux-dj/drivers/scsi/sym53c8xx_comm.h

drivers/scsi/sym53c8xx_comm.h +6 -7
@@ -438,10 +438,10 @@
 #define	NCR_LOCK_NCB(np, flags)    spin_lock_irqsave(&np->smp_lock, flags)
 #define	NCR_UNLOCK_NCB(np, flags)  spin_unlock_irqrestore(&np->smp_lock, flags)
 
-#define	NCR_LOCK_SCSI_DONE(np, flags) \
-		spin_lock_irqsave(&io_request_lock, flags)
-#define	NCR_UNLOCK_SCSI_DONE(np, flags) \
-		spin_unlock_irqrestore(&io_request_lock, flags)
+#define	NCR_LOCK_SCSI_DONE(host, flags) \
+		spin_lock_irqsave(&(host)->host_lock, flags)
+#define	NCR_UNLOCK_SCSI_DONE(host, flags) \
+		spin_unlock_irqrestore(&((host)->host_lock), flags)
 
 #else
 
@@ -452,8 +452,8 @@
 #define	NCR_LOCK_NCB(np, flags)    do { save_flags(flags); cli(); } while (0)
 #define	NCR_UNLOCK_NCB(np, flags)  do { restore_flags(flags); } while (0)
 
-#define	NCR_LOCK_SCSI_DONE(np, flags)    do {;} while (0)
-#define	NCR_UNLOCK_SCSI_DONE(np, flags)  do {;} while (0)
+#define	NCR_LOCK_SCSI_DONE(host, flags)    do {;} while (0)
+#define	NCR_UNLOCK_SCSI_DONE(host, flags)  do {;} while (0)
 
 #endif
 
 
--

| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs .