diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:04 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:04 -0500 |
commit | 2e13093a834ddbbf92701d477e69c9018959a82c (patch) | |
tree | e21987d2548594fef87b809da462088acad7c58a /drivers/ide/ide-probe.c | |
parent | ba6560aa45fc498125b07130784ec5ca8a6922a6 (diff) |
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: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index bfcc8078b092..817564fba820 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -1382,9 +1382,14 @@ int ide_device_add(u8 idx[4]) | |||
1382 | if (idx[i] == 0xff) | 1382 | if (idx[i] == 0xff) |
1383 | continue; | 1383 | continue; |
1384 | 1384 | ||
1385 | hwif = &ide_hwifs[idx[i]]; | 1385 | probe_hwif(&ide_hwifs[idx[i]]); |
1386 | } | ||
1386 | 1387 | ||
1387 | probe_hwif(hwif); | 1388 | for (i = 0; i < 4; i++) { |
1389 | if (idx[i] == 0xff) | ||
1390 | continue; | ||
1391 | |||
1392 | hwif = &ide_hwifs[idx[i]]; | ||
1388 | 1393 | ||
1389 | if (hwif_init(hwif) == 0) { | 1394 | if (hwif_init(hwif) == 0) { |
1390 | printk(KERN_INFO "%s: failed to initialize IDE " | 1395 | printk(KERN_INFO "%s: failed to initialize IDE " |
@@ -1392,6 +1397,13 @@ int ide_device_add(u8 idx[4]) | |||
1392 | rc = -1; | 1397 | rc = -1; |
1393 | continue; | 1398 | continue; |
1394 | } | 1399 | } |
1400 | } | ||
1401 | |||
1402 | for (i = 0; i < 4; i++) { | ||
1403 | if (idx[i] == 0xff) | ||
1404 | continue; | ||
1405 | |||
1406 | hwif = &ide_hwifs[idx[i]]; | ||
1395 | 1407 | ||
1396 | if (hwif->present) | 1408 | if (hwif->present) |
1397 | hwif_register_devices(hwif); | 1409 | hwif_register_devices(hwif); |