[PARPORT] ppdev hangs on read

From: VOLTZ Stéphane (svoltz@wanadoo.fr)
Date: Thu Oct 10 2002 - 15:31:38 EDT

  • Next message: Tim Waugh: "Re: [PARPORT] ppdev hangs on read"

        Hello,

    I have troubles using ppdev since version 2.4.19 . My scanner is
    hanging on a ppdev read
    when parport is set to EPP in BIOS. When the BIOS is set to ECP+EPP,
    everything works
    OK. Both modes work fine with kernel 2.4.18.

        Here's the end of the strace:

    ioctl(3, PPWDATA, 0xbffff39f) = 0
    ioctl(3, PPWDATA, 0xbffff39f) = 0
    ioctl(3, PPWDATA, 0xbffff39f) = 0
    ioctl(3, PPWDATA, 0xbffff39f) = 0
    ioctl(3, PPWDATA, 0xbffff39f) = 0
    ioctl(3, PPRCONTROL, 0xbffff3a3) = 0
    ioctl(3, PPRCONTROL, 0xbffff3a3) = 0
    ioctl(3, PPWCONTROL, 0xbffff39f) = 0
    ioctl(3, PPWCONTROL, 0xbffff39f) = 0
    ioctl(3, PPRCONTROL, 0xbffff3a3) = 0
    ioctl(3, PPWCONTROL, 0xbffff39f) = 0
    ioctl(3, PPWCONTROL, 0xbffff39f) = 0
    ioctl(3, PPWCONTROL, 0xbffff39f) = 0
    ioctl(3, PPWCONTROL, 0xbffff39f) = 0
    ioctl(3, PPWDATA, 0xbffff39f) = 0
    ioctl(3, PPWDATA, 0xbffff39f) = 0
    ioctl(3, PPWCONTROL, 0xbffff39f) = 0
    ioctl(3, PPWDATA, 0xbffff7df) = 0
    ioctl(3, PPWCONTROL, 0xbffff7df) = 0
    ioctl(3, PPSETMODE, 0xbffff81c) = 0
    write(3, "J", 1) = 0
    ioctl(3, PPSETMODE, 0xbffff81c) = 0
    write(3, "\0", 1) = 0
    ioctl(3, PPSETMODE, 0xbffff818) = 0
    write(3, "\r", 1) = 0
    ioctl(3, PPDATADIR, 0xbffff818) = 0
    ioctl(3, PPSETMODE, 0xbffff818) = 0
    read(3, 0xbffff816, 1) = ? ERESTARTSYS (To be restarted)
    --- SIGTERM (Terminated) ---
    +++ killed by SIGTERM +++

        And here's the affected code:

          breg = (unsigned char) (reg);
          mode = IEEE1284_MODE_EPP | IEEE1284_ADDR;
          rc = ioctl (fd, PPSETMODE, &mode);
          if (rc)
            DBG (0, "ppdev ioctl returned <%s> (%s:%d)\n", strerror (errno),
                 __FILE__, __LINE__);
          rc = write (fd, &breg, 1);

          mode = 1; /* data_reverse */
          rc = ioctl (fd, PPDATADIR, &mode);

          mode = IEEE1284_MODE_EPP | IEEE1284_DATA;
          rc = ioctl (fd, PPSETMODE, &mode);
          if (rc)
            DBG (0, "ppdev ioctl returned <%s> (%s:%d)\n", strerror (errno),
                 __FILE__, __LINE__);
          rc = read (fd, &bval, 1);
          value = bval;

          mode = 0; /* forward */
          rc = ioctl (fd, PPDATADIR, &mode); /* program blocks here */
          if (rc)
            DBG (0, "ppdev ioctl returned <%s> (%s:%d)\n", strerror (errno),
                 __FILE__, __LINE__);

        It hangs since 2.4.19 can do blocking/no blocking IO, and ppdev is open
    in blocking mode by default. But I cannot explain why there is nothing
    to read.

        Any suggestion ?

    Regards,
        Stef

    -- 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 : Thu Oct 10 2002 - 15:41:27 EDT