Re: [PARPORT] Non-interrupting PIO for PPF and ECP modes

From: Tim Waugh (twaugh@redhat.com)
Date: Tue Dec 04 2001 - 06:18:53 EST

  • Next message: Kipp Cannon: "[PARPORT] multiple low-level drivers"

    On Sat, Nov 24, 2001 at 07:48:47PM -0500, Tom Perkins wrote:

    > 2.) Changing the mode to ECR_TST looks illegal -- Violates the rule that
    > ECR_PS2 must be visited first? This code is the same for the
    > ecp_write_block code. In the MS version of 1284 spec I thought a
    > control single STROBE was used to stop transfer?

    By the way, if you have a tested patch to fix this, it would be most
    welcome..

    > Is this correct and what should be used for compat_write_block?

    Don't know.

    Phil has suggested to me that we make it so that the inactivity
    timeout only has effect when another device wants the port. The
    relevant change would be this:

    --- linux/drivers/parport/parport_pc.c.inactivity Tue Dec 4 11:14:29 2001
    +++ linux/drivers/parport/parport_pc.c Tue Dec 4 11:17:12 2001
    @@ -600,12 +600,6 @@
                             /* Can't yield the port. */
                             schedule ();
     
    - /* Anyone else waiting for the port? */
    - if (port->waithead) {
    - printk (KERN_DEBUG "Somebody wants the port\n");
    - break;
    - }
    -
                     if (ecrval & 0x02) {
                             /* FIFO is full. Wait for interrupt. */
     
    @@ -615,7 +609,7 @@
                             ret = parport_wait_event (port, HZ);
                             if (ret < 0) break;
                             ret = 0;
    - if (!time_before (jiffies, expire)) {
    + if (port->waithead && !time_before (jiffies, expire)) {
                                     /* Timed out. */
                                     printk (KERN_DEBUG "FIFO write timed out\n");
                                     break;
    @@ -739,7 +733,7 @@
                     ret = parport_wait_event (port, HZ);
                     if (ret < 0) break;
                     ret = 0;
    - if (!time_before (jiffies, expire)) {
    + if (port->waithead && !time_before (jiffies, expire)) {
                             /* Timed out. */
                             printk (KERN_DEBUG "DMA write timed out\n");
                             break;
    @@ -762,12 +756,6 @@
                             /* Can't yield the port. */
                             schedule ();
     
    - /* Anyone else waiting for the port? */
    - if (port->waithead) {
    - printk (KERN_DEBUG "Somebody wants the port\n");
    - break;
    - }
    -
                     /* update for possible DMA residue ! */
                     buf -= count;
                     left += count;

    Does that seem like a reasonable thing to do? It would the FIFO/DMA
    problems go away for the common case of there being a single device on
    the port.

    Tim.
    */



    -- 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 : Tue Dec 04 2001 - 06:20:16 EST