ide: fix probing for hosts with serialized or IRQ sharing interfaces

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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent ba6560aa
...@@ -1382,9 +1382,14 @@ int ide_device_add(u8 idx[4]) ...@@ -1382,9 +1382,14 @@ int ide_device_add(u8 idx[4])
if (idx[i] == 0xff) if (idx[i] == 0xff)
continue; 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) { if (hwif_init(hwif) == 0) {
printk(KERN_INFO "%s: failed to initialize IDE " printk(KERN_INFO "%s: failed to initialize IDE "
...@@ -1392,6 +1397,13 @@ int ide_device_add(u8 idx[4]) ...@@ -1392,6 +1397,13 @@ int ide_device_add(u8 idx[4])
rc = -1; rc = -1;
continue; continue;
} }
}
for (i = 0; i < 4; i++) {
if (idx[i] == 0xff)
continue;
hwif = &ide_hwifs[idx[i]];
if (hwif->present) if (hwif->present)
hwif_register_devices(hwif); hwif_register_devices(hwif);
......
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