From: Alan Cox <alan@redhat.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: PATCH: Fix ide probe double detection
Date: Tue, 27 Jul 2004 18:46:29 -0400 [thread overview]
Message-ID: <20040727224629.GA17147@devserv.devel.redhat.com> (raw)
Some devices don't decode master/slave - notably PCMCIA adapters.
Unfortunately for us some also do, which makes it hard to guess if we
should probe the slave.
This patch fixes the problem by probing the slave and then using the model
and serial information to spot undecoded pairs. An additional check is done
to catch pairs of pre ATA devices just in case.
Alan
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.6.7/drivers/ide/ide-probe.c 2.6.7-ac/drivers/ide/ide-probe.c
--- linux-2.6.7/drivers/ide/ide-probe.c 2004-06-16 21:11:35.000000000 +0100
+++ 2.6.7-ac/drivers/ide/ide-probe.c 2004-06-16 21:19:28.000000000 +0100
@@ -749,6 +749,16 @@
ide_drive_t *drive = &hwif->drives[unit];
drive->dn = (hwif->channel ? 2 : 0) + unit;
(void) probe_for_drive(drive);
+ if (drive->present && hwif->present && unit == 1)
+ {
+ if(strcmp(hwif->drives[0].id->model, drive->id->model) == 0 &&
+ strcmp(drive->id->model, "UNKNOWN") && /* Don't do this for non ATA or for noprobe */
+ strncmp(hwif->drives[0].id->serial_no, drive->id->serial_no, 20) == 0)
+ {
+ printk(KERN_WARNING "ide-probe: ignoring undecoded slave\n");
+ drive->present = 0;
+ }
+ }
if (drive->present && !hwif->present) {
hwif->present = 1;
if (hwif->chipset != ide_4drives ||
next reply other threads:[~2004-07-27 22:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-27 22:46 Alan Cox [this message]
2004-07-29 3:22 ` PATCH: Fix ide probe double detection Benjamin Herrenschmidt
2004-07-29 13:39 ` Alan Cox
2004-07-29 15:56 ` Doug Maxey
2004-07-29 16:02 ` Alan Cox
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=20040727224629.GA17147@devserv.devel.redhat.com \
--to=alan@redhat.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox