public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>
Cc: Leopold Palomo-Avellaneda <leo@alaxarxa.net>,
	linux-kernel@vger.kernel.org, Adam Baker <linux@baker-net.org.uk>,
	linux-parport@lists.infradead.org,
	Nicos Gollan <gollan@informatik.uni-kl.de>,
	Greg KH <greg@kroah.com>, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Alexander Gordeev <lasaine@lvk.cs.msu.su>,
	jan@lvr.com
Subject: Re: [PATCH/RFC] parport_pc: remove ancient, overeager quirk that disables EPP support on many chipsets
Date: Thu, 15 Sep 2011 14:43:48 -0500	[thread overview]
Message-ID: <20110915194348.GC19450@elie> (raw)
In-Reply-To: <CAE2SPAatxqkFUExiNc3EAP3T4EiHQiPxVcd7vPZG23xycy4QLw@mail.gmail.com>

Bastien ROUCARIES wrote:

> Why not check dmi years for this test and do the test only for board
> before 2000 ? Better safe than sorry

That would just leave the code broken on boards before 2000.

Here's a reference to the problem the test was supposed to fix:

 http://lkml.indiana.edu/hypermail/linux/kernel/9901.2/1285.html

It says:

| A small number of IO chipsets do not have the EPP timeout function hence if 
| there is no EPP device then the CPU is permantly in the HALT state and nothing 
| happens LITERALLY! <CNTL><ALT><DEL> does not even function! The bulk (if not 
| all) the IO chipsets in this category fail the bug check test, as a result it 
| is assumed there is no EPP (or to dangerous to use). This may prevent some 
| valid chipsets working properly.

It sounds like the test removed by [1] has false positives and false
negatives.

Jan Axelson's "Parallel Port Complete" recommends:

 - first check for ECP as described in Microsoft's "Extended
   Capabilities Port Protocol and ISA Interface Standard" document:

   . First check for the presence of the ECR register, by checking
     that bits 0 and 1 act like "empty" and "full" bits (so they
     start out set and cleared respectively and after writing 0x34 you
     can read back 0x35).

     parport_ECR_present() does this and save the result to priv->ecr.

   . Put the port in configuration mode by writing 0xf4 to the ECR,
     etc (parport_ECP_supported() does these checks).

 - if the above fails, then check for EPP.  There are a couple of
   choices suggested for that:

   A) Write some values to one of the EPP registers and then read them
      back.  If nothing is plugged in there, that should provoke a
      timeout; the spec doesn't say what you read back, but she found
      that it would always read back what you wrote and that in practice
      it worked for discovering EPP ports.

   B) Check that the timeout bit (ECR bit 0) is set when a timeout occurs,
      and then clear it.  On some ports, just trying a transfer with
      nothing plugged in will provoke a timeout, while on others ECR bit 7
      needs to be set first.  And of course there's more than one way to
      clear it.

      Intel's 82091 data sheet does not mention the timeout bit at all.
      Maybe it doesn't implement it.

      http://www.lvr.com/jansfaq.htm also mentions "Beware #1: on
      SMC's chips (& maybe others), a set timeout bit can make the
      port unusable in any mode, until a hard reset (or clearing the
      bit)!"  So one does have to make sure to clear the bit.

Would it make sense to switch to doing (A)?  If not, is there some
test that can be used to detect an 82091 specifically (or are there
other chipsets that don't have the timeout bit)?  Cc-ing Jan for
advice (thanks for your work in documenting what makes parallel ports
tick, Jan!).

Thanks,
Jonathan

[1] http://thread.gmane.org/gmane.linux.kernel/1191591

  parent reply	other threads:[~2011-09-15 19:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-15 12:41 [PATCH/RFC] parport_pc: remove ancient, overeager quirk that disables EPP support on many chipsets Leopold Palomo-Avellaneda
2011-09-15 13:35 ` Greg KH
2011-09-15 17:39   ` Jonathan Nieder
2011-09-15 20:23     ` Adam Baker
2011-09-15 20:35       ` Jonathan Nieder
2011-09-16 10:09         ` Leopold Palomo-Avellaneda
2011-09-15 13:41 ` Bastien ROUCARIES
2011-09-15 13:44   ` Bastien ROUCARIES
2011-09-16 10:39     ` Leopold Palomo-Avellaneda
2011-09-15 19:43   ` Jonathan Nieder [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-09-15 13:02 Leopold Palomo-Avellaneda
2011-09-15  9:33 Leopold Palomo-Avellaneda
2011-09-15 10:16 ` Greg KH

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=20110915194348.GC19450@elie \
    --to=jrnieder@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=gollan@informatik.uni-kl.de \
    --cc=greg@kroah.com \
    --cc=jan@lvr.com \
    --cc=lasaine@lvk.cs.msu.su \
    --cc=leo@alaxarxa.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parport@lists.infradead.org \
    --cc=linux@baker-net.org.uk \
    --cc=roucaries.bastien@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox