public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Steinar H. Gunderson" <sgunderson@bigfoot.com>
To: linux-kernel@vger.kernel.org
Cc: magne@samfundet.no
Subject: [PATCH] Problem with detecting the serial ports on a NetMos 9845
Date: Fri, 10 Feb 2006 18:48:36 +0100	[thread overview]
Message-ID: <20060210174836.GA16968@uio.no> (raw)

[-- Attachment #1: Type: text/plain, Size: 1524 bytes --]

[I'm not subscribed to linux-kernel, so please Cc me on any replies -- I
 tried posting this to linux-serial in December, but never got any reply, so
 I guess nobody's reading the list.]

Hi,

We have a NetMos 9845 controller with four serial ports but no parallel port, 
and tried to use parport_serial driver with it. However, all it would say was
that it had detected a parallel port at 9710:9735, and then exit.

We tracked it down, and found two problems:

  - For some reason, it detects the 9845 as a 9735 -- it appears this is
    simply related to the ordering in parport_serial_pci_tbl[]. If we move
    the 9845 up above the 9735, it prints out 9710:9845, but no change in
    behaviour. (We didn't find out why this was the case; we left it alone
    since it didn't affect our problem.)
  - The card has no parallel port (at least no physical ones), yet it reports
    (via its subsystem ID of 0x0014) one parallel port and four serial ports.
    The probe for the parallel port fails, and the driver just aborts. Thus,
    it doesn't find the serial ports.

We tested this under both 2.6.12 and 2.6.15, and both had the same problem.
The attached patch (against 2.6.12) changes the logic for the parallel port
detection: If there are detected parallel ports but the probe fails, the
number of parallel ports is simply set to zero, and the probe continues as
usual. This makes it work correctly in our case, and should not present a
problem for other systems.

/* Steinar */
-- 
Homepage: http://www.sesse.net/

[-- Attachment #2: parport_serial.c.diff --]
[-- Type: text/plain, Size: 383 bytes --]

--- linux-source-2.6.12-2.6.12/drivers/parport/parport_serial.c	2005-06-17 21:48:29.000000000 +0200
@@ -418,10 +419,13 @@
 		return err;
 	}
 
-	if (parport_register (dev, id)) {
+	err = parport_register (dev, id);
+	if (err < 0) {
 		pci_set_drvdata (dev, NULL);
 		kfree (priv);
 		return -ENODEV;
+	} else if (err) {
+		priv->num_par = 0;
 	}
 
 	if (serial_register (dev, id)) {

             reply	other threads:[~2006-02-10 17:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-10 17:48 Steinar H. Gunderson [this message]
2006-02-15 11:00 ` [PATCH] Problem with detecting the serial ports on a NetMos 9845 Russell King
2006-02-23 10:10   ` Russell King

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=20060210174836.GA16968@uio.no \
    --to=sgunderson@bigfoot.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magne@samfundet.no \
    /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