All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arkadi Shishlov <arkadi@mebius.lv>
To: sparclinux@vger.kernel.org
Subject: Re: parport_sunbpp patch, works on ultra2
Date: Tue, 24 Apr 2007 09:58:03 +0000	[thread overview]
Message-ID: <462DD4AB.8050905@mebius.lv> (raw)
In-Reply-To: <op.tqnalwnm3zd5kp@k37>

David Miller wrote:
> But your patch doesn't seem right.  The generic parport code should be
> polling the status lines properly before calling down into the
> ->read() and ->write() handlers of the driver.
> 
> The FEPS manual states that the BSY signal in the TCR register is
> "active low" but that might just be normal for parallel ports.  The
> test is therefore inverted in status_sunbpp_to_pc for the P_TCR_BUSY
> bit.
> 
> That might be what the problem is, could you play around with that
> instead?  For example, try making the test in status_sunbpp_to_pc()
> be:
> 
> 	if (value_tcr & P_TCR_BUSY)
> 		bits |= PARPORT_STATUS_BUSY;

With this
--- parport_sunbpp.c~   2007-04-11 19:26:14.000000000 +0300
+++ parport_sunbpp.c    2007-04-24 12:32:31.000000000 +0300
@@ -123,7 +123,7 @@
                 bits |= PARPORT_STATUS_PAPEROUT;
         if (value_tcr & P_TCR_ACK)
                 bits |= PARPORT_STATUS_ACK;
-       if (!(value_tcr & P_TCR_BUSY))
+       if (value_tcr & P_TCR_BUSY)
                 bits |= PARPORT_STATUS_BUSY;

         dprintk((KERN_DEBUG "tcr 0x%x ir 0x%x\n", regs->p_tcr, regs->p_ir));

the printer does not print anything, and echo -en "test\r\ntest2\r\n\f" >/dev/lp0
never returns.

[ 7012.534343] frob1: tcr 0x1 or 0x3
[ 7012.534380] frob2: tcr 0x1 or 0x3
[ 7012.534419] tcr 0x1 or 0x3
[ 7012.534455] read control 0xc
[ 7012.534487] tcr 0x1 or 0x3
[ 7012.534497] read control 0xc
[ 7012.534566] frob1: tcr 0x1 or 0x3
[ 7012.534592] frob2: tcr 0x1 or 0x3
[ 7012.534605] tcr 0x1 or 0x3
[ 7012.534615] read control 0xc
[ 7012.534631] tcr 0x1 ir 0x4
[ 7012.534641] read status 0x18
[ 7012.534657] frob1: tcr 0x1 or 0x3
[ 7012.534668] frob2: tcr 0x1 or 0x3
[ 7012.534681] tcr 0x1 or 0x3
[ 7012.534691] read control 0xc
[ 7012.534702] forward
[ 7012.534715] tcr 0x1 ir 0x4
[ 7012.534725] read status 0x18
[ 7012.534737] tcr 0x1 ir 0x4
[ 7012.534747] read status 0x18
[ 7012.534758] tcr 0x1 ir 0x4

and so on, until canceled with 3 ^C

[ 7024.506696] tcr 0x1 or 0x3
[ 7024.506721] read control 0xc

> diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c
> index 9793533..400bb90 100644
> --- a/drivers/parport/parport_sunbpp.c
> +++ b/drivers/parport/parport_sunbpp.c

Applied, no OOPS with debug now.

      parent reply	other threads:[~2007-04-24  9:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12  0:35 parport_sunbpp patch, works on ultra2 Arkadi Shishlov
2007-04-12  5:06 ` David Miller
2007-04-24  6:32 ` David Miller
2007-04-24  9:58 ` Arkadi Shishlov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=462DD4AB.8050905@mebius.lv \
    --to=arkadi@mebius.lv \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.