All of lore.kernel.org
 help / color / mirror / Atom feed
* PATCH: Fix ide probe double detection
@ 2004-07-27 22:46 Alan Cox
  2004-07-29  3:22 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2004-07-27 22:46 UTC (permalink / raw)
  To: akpm, linux-kernel

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 ||

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-07-29 16:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-27 22:46 PATCH: Fix ide probe double detection Alan Cox
2004-07-29  3:22 ` Benjamin Herrenschmidt
2004-07-29 13:39   ` Alan Cox
2004-07-29 15:56   ` Doug Maxey
2004-07-29 16:02     ` Alan Cox

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.