public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rogier Wolff <R.E.Wolff@BitWizard.nl>
To: marcello@connectiva.com.br,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Urgent patch for SX.
Date: Fri, 8 Nov 2002 18:28:41 +0100	[thread overview]
Message-ID: <20021108182841.A24198@bitwizard.nl> (raw)

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


Hi Marcello, 

Somone messed with the SX driver in 2.4.19. It now detects some cards
twice (both as a V1 and as a V2 card). And as there end up being no
"interlocks", the card is entered twice in the "list of cards". 

This is fixed by adding a check for Version 1 when we really are
really probing for a V1 card and the other way around.

It would be very nice if this could still be accepted into 2.4.20, as
a bunch of people are bitten by this.... 

Honesty requires me to tell you that I haven't been able to fully test
this: I don't have a Version 1 card. But it has been tested with a
Version 2 card and it fixes the double detection problem there. So,
worst case, I think we'll hose support for version 1 cards, produced
in the late nineteen-eighties, or early nineteen-nineties....


				Roger. 

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* The Worlds Ecosystem is a stable system. Stable systems may experience *
* excursions from the stable situation. We are currently in such an      * 
* excursion: The stable situation does not include humans. ***************

[-- Attachment #2: sxfix-2.4.20-rc1 --]
[-- Type: text/plain, Size: 964 bytes --]

diff -ur linux-2.4.20-rc1.clean/drivers/char/sx.c linux-2.4.20-rc1.sxfix/drivers/char/sx.c
--- linux-2.4.20-rc1.clean/drivers/char/sx.c	Fri Nov  8 18:13:57 2002
+++ linux-2.4.20-rc1.sxfix/drivers/char/sx.c	Fri Nov  8 18:16:55 2002
@@ -2216,6 +2216,23 @@
 		}
 	}
 
+	/* Now we're pretty much convinced that there is an SI board here, 
+	   but to prevent trouble, we'd better double check that we don't
+	   have an SI1 board when we're probing for an SI2 board.... */
+
+	write_sx_byte (board, SI2_ISA_ID_BASE,0x10); 
+	if ( IS_SI1_BOARD(board)) {
+		/* This should be an SI1 board, which has this
+		   location writable... */
+		if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10)
+			return 0; 
+	} else {
+		/* This should be an SI2 board, which has the bottom
+		   3 bits non-writable... */
+		if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10)
+			return 0; 
+	}
+
 	printheader ();
 
 	printk (KERN_DEBUG "sx: Found an SI board at %lx\n", board->hw_base);

                 reply	other threads:[~2002-11-08 17:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20021108182841.A24198@bitwizard.nl \
    --to=r.e.wolff@bitwizard.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcello@connectiva.com.br \
    /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