Skip to content

Commit

Permalink
ide: fix probing for hosts with serialized or IRQ sharing interfaces
Browse files Browse the repository at this point in the history
After hwif_register_devices() IDE devices are ready to be used so
the way in which ide_device_add() works currently is racy for hosts
with serialized / IRQ sharing interfaces.

Fix ide_device_add() by looping over interfaces for probe_hwif(),
hwif_init() and hwif_register_devices() operations.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jan 26, 2008
1 parent ba6560a commit 2e13093
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,16 +1382,28 @@ int ide_device_add(u8 idx[4])
if (idx[i] == 0xff)
continue;

hwif = &ide_hwifs[idx[i]];
probe_hwif(&ide_hwifs[idx[i]]);
}

probe_hwif(hwif);
for (i = 0; i < 4; i++) {
if (idx[i] == 0xff)
continue;

hwif = &ide_hwifs[idx[i]];

if (hwif_init(hwif) == 0) {
printk(KERN_INFO "%s: failed to initialize IDE "
"interface\n", hwif->name);
rc = -1;
continue;
}
}

for (i = 0; i < 4; i++) {
if (idx[i] == 0xff)
continue;

hwif = &ide_hwifs[idx[i]];

if (hwif->present)
hwif_register_devices(hwif);
Expand Down

0 comments on commit 2e13093

Please sign in to comment.