[patch] 2.2.17pre11: ppa 2.04

From: Tim Waugh (twaugh@redhat.com)
Date: Fri Jul 14 2000 - 05:12:48 EST


Here is a patch against 2.2.17pre11 to fix some timing problems with
the ppa driver. It works for me, but I'd like more feedback on it.

I'm also interested in any changes in data throughput; for me, the
transfer speed actually increased very slightly.

Tim.
*/

diff -durN linux-2.2.17pre11/drivers/scsi/ppa.c linux/drivers/scsi/ppa.c
--- linux-2.2.17pre11/drivers/scsi/ppa.c Fri May 7 18:57:42 1999
+++ linux/drivers/scsi/ppa.c Fri Jul 14 11:01:54 2000
@@ -298,12 +298,11 @@
     unsigned char r;
 
     k = PPA_SPIN_TMO;
- do {
- r = r_str(ppb);
- k--;
- udelay(1);
+ /* Wait for bit 6 and 7 - PJC */
+ for (r = r_str (ppb); ((r & 0xc0)!=0xc0) && (k); k--) {
+ udelay (1);
+ r = r_str (ppb);
     }
- while (!(r & 0x80) && (k));
 
     /*
      * return some status information.
@@ -637,7 +636,6 @@
      * 1 Finished data transfer
      */
     int host_no = cmd->host->unique_id;
- unsigned short ppb = PPA_BASE(host_no);
     unsigned long start_jiffies = jiffies;
 
     unsigned char r, v;
@@ -649,11 +647,7 @@
             (v == WRITE_6) ||
             (v == WRITE_10));
 
- /*
- * We only get here if the drive is ready to comunicate,
- * hence no need for a full ppa_wait.
- */
- r = (r_str(ppb) & 0xf0);
+ r = ppa_wait(host_no); /* Need a ppa_wait() - PJC */
 
     while (r != (unsigned char) 0xf0) {
         /*
@@ -691,7 +685,7 @@
             }
         }
         /* Now check to see if the drive is ready to comunicate */
- r = (r_str(ppb) & 0xf0);
+ r = ppa_wait(host_no); /* need ppa_wait() - PJC */
         /* If not, drop back down to the scheduler and wait a timer tick */
         if (!(r & 0x80))
             return 0;
diff -durN linux-2.2.17pre11/drivers/scsi/ppa.h linux/drivers/scsi/ppa.h
--- linux-2.2.17pre11/drivers/scsi/ppa.h Tue May 11 18:36:59 1999
+++ linux/drivers/scsi/ppa.h Fri Jul 14 11:01:54 2000
@@ -10,7 +10,7 @@
 #ifndef _PPA_H
 #define _PPA_H
 
-#define PPA_VERSION "2.03 (for Linux 2.2.x)"
+#define PPA_VERSION "2.04 (for Linux 2.2.x)"
 
 /*
  * this driver has been hacked by Matteo Frigo (athena@theory.lcs.mit.edu)
@@ -51,6 +51,12 @@
  * CONFIG_SCSI_PPA_HAVE_PEDANTIC => CONFIG_SCSI_IZIP_EPP16
  * added CONFIG_SCSI_IZIP_SLOW_CTR option
  * [2.03]
+ *
+ * Use ppa_wait() to check for ready AND connected status bits
+ * Add ppa_wait() calls to ppa_completion()
+ * by Peter Cherriman <pjc@ecs.soton.ac.uk> and
+ * Tim Waugh <twaugh@redhat.com>
+ * [2.04]
  */
 /* ------ END OF USER CONFIGURABLE PARAMETERS ----- */
 

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



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:19 EST