linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 10/21] ide: fix probing for hosts with serialized or IRQ sharing interfaces
@ 2007-11-18 22:22 Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; only message in thread
From: Bartlomiej Zolnierkiewicz @ 2007-11-18 22:22 UTC (permalink / raw)
  To: linux-ide


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>
---
 drivers/ide/ide-probe.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1389,9 +1389,14 @@ 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 "
@@ -1399,6 +1404,13 @@ int ide_device_add(u8 idx[4])
 			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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-18 22:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-18 22:22 [PATCH 10/21] ide: fix probing for hosts with serialized or IRQ sharing interfaces Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).