Commit b4a93dc0 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] ide: identify non decoded master/slave by serial and model

From: Alan Cox <alan@redhat.com>

Some interfaces (notably PCMCIA ones) don't decode the master/slave select so
you get two copies of a device appearing and bad things happening if a user
accidentally uses both. 

This checks for the model/serial matching but also knows about non ATA drives
ide=noprobe and a Maxtor problem that was found in Andrew's testing of an
earlier patch. Although M00000.. drives should be RMA'd to Maxtor (and with
info on where they were obtained...) we don't want to break anyone who has
them.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7e8745b8
...@@ -745,6 +745,18 @@ static void probe_hwif(ide_hwif_t *hwif) ...@@ -745,6 +745,18 @@ static void probe_hwif(ide_hwif_t *hwif)
ide_drive_t *drive = &hwif->drives[unit]; ide_drive_t *drive = &hwif->drives[unit];
drive->dn = (hwif->channel ? 2 : 0) + unit; drive->dn = (hwif->channel ? 2 : 0) + unit;
(void) probe_for_drive(drive); (void) probe_for_drive(drive);
if (drive->present && hwif->present && unit == 1) {
if (strcmp(hwif->drives[0].id->model, drive->id->model) == 0 &&
/* Don't do this for noprobe or non ATA */
strcmp(drive->id->model, "UNKNOWN") &&
/* And beware of confused Maxtor drives that go "M0000000000"
"The SN# is garbage in the ID block..." [Eric] */
strncmp(drive->id->serial_no, "M0000000000000000000", 20) &&
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) { if (drive->present && !hwif->present) {
hwif->present = 1; hwif->present = 1;
if (hwif->chipset != ide_4drives || if (hwif->chipset != ide_4drives ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment