[PARPORT] Re: PPA crashes and bugs (fwd)

From: Tim Waugh (twaugh@redhat.com)
Date: Wed Jul 12 2000 - 13:14:59 EDT

  • Next message: Tim Waugh: "[PARPORT] Re: PPA crashes and bugs (fwd)"

    On Tue, Jul 11, 2000 at 01:48:54PM +0100, Dr. Peter Cherriman wrote:

    > I'd be grateful if people could try the patch, and measure the speed
    > of file transfers with and without the patched module, rebooting
    > between tests to clear an cache. I can get 22.1Mb/min in EPP mode
    > (Mb=1024^2) with my motherboards parallel port.

    Peter,

    Here is your patch back again, with a couple of changes:

    - versioning stuff
    - change ppa_wait into a for loop, saving a udelay on a successful
      r_str

    Would you like to test to make sure that it still fixes the problem?
    I'll be testing it out with my Zip drive tonight.

    Thanks,
    Tim.
    */

    Index: linux/drivers/scsi/ppa.c
    diff -u linux/drivers/scsi/ppa.c:1.1.1.1 linux/drivers/scsi/ppa.c:1.3
    --- linux/drivers/scsi/ppa.c:1.1.1.1 Fri Sep 24 23:00:05 1999
    +++ linux/drivers/scsi/ppa.c Wed Jul 12 17:45:36 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;
    Index: linux/drivers/scsi/ppa.h
    diff -u linux/drivers/scsi/ppa.h:1.1.1.2 linux/drivers/scsi/ppa.h:1.2
    --- linux/drivers/scsi/ppa.h:1.1.1.2 Mon Nov 15 09:15:15 1999
    +++ linux/drivers/scsi/ppa.h Wed Jul 12 17:35:33 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) (PJCv3)"
     
     /*
      * this driver has been hacked by Matteo Frigo (athena@theory.lcs.mit.edu)

    -- To unsubscribe, send mail to: linux-parport-request@torque.net --
    -- with the single word "unsubscribe" in the body of the message. --



    This archive was generated by hypermail 2b29 : Wed Jul 12 2000 - 13:20:31 EDT