[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ide
Subject:    [PATCH]: [RFC] Fix error handlnig in hwif-init and sgiioc4 driver
From:       Prarit Bhargava <prarit () sgi ! com>
Date:       2005-01-26 13:25:04
Message-ID: 41F79A30.4040900 () sgi ! com
[Download RAW message or body]

I didn't see any ACKs on this so I'm resubmitting....

I discovered an issue where a hwif_init failure lead to /proc/ide files 
being created for devices that failed probes.  This resulted in 
oops/WARN_ON/BUG_ON executions through the kernel depending on what 
actions were on going.

The first part of the fix (submitted to linux-ia64 and acpi-devel for 
review -- I'm including it for completeness) was to fix incorrect error 
handling in the ACPI layer:

===== drivers/acpi/pci_irq.c 1.35 vs edited =====
--- 1.35/drivers/acpi/pci_irq.c 2005-01-04 21:48:17 -05:00
+++ edited/drivers/acpi/pci_irq.c       2005-01-14 08:14:34 -05:00
@@ -487,10 +487,10 @@
        * If no PRT entry was found, we'll try to derive an IRQ from the
        * device's parent bridge.
        */
-       if (!gsi)
+       if (gsi == -1)
               gsi = acpi_pci_irq_derive(dev, pin,
                                         &edge_level, &active_high_low);
-       if (!gsi)
+       if (gsi == -1)
               return_VOID;

       /*

The second part of the fix is to the core IDE layer and to the SGI IOC4 
IDE driver which need to handle errors properly from failed hwif 
initializations.  This patch is attached for review.

["acpi-ide.patch" (text/plain)]

===== drivers/ide/ide-probe.c 1.90 vs edited =====
--- 1.90/drivers/ide/ide-probe.c	2004-12-10 14:12:14 -05:00
+++ edited/drivers/ide/ide-probe.c	2005-01-14 08:18:43 -05:00
@@ -841,7 +841,10 @@
 	if (fixup)
 		fixup(hwif);
 
-	hwif_init(hwif);
+	if (!hwif_init(hwif)) {
+		printk("%s: Failed to initialize IDE interface\n", hwif->name);
+		return -1;
+	}
 
 	if (hwif->present) {
 		u16 unit = 0;
===== drivers/ide/pci/sgiioc4.c 1.22 vs edited =====
--- 1.22/drivers/ide/pci/sgiioc4.c	2005-01-06 20:35:35 -05:00
+++ edited/drivers/ide/pci/sgiioc4.c	2005-01-14 08:18:56 -05:00
@@ -669,7 +669,10 @@
 		printk(KERN_INFO "%s: %s Bus-Master DMA disabled\n",
 		       hwif->name, d->name);
 
-	probe_hwif_init(hwif);
+	if (probe_hwif_init(hwif)) {
+		printk(KERN_INFO "%s: initialization failed\n", hwif->name);
+		return -EIO;
+	}
 
 	/* Create /proc/ide entries */
 	create_proc_ide_interfaces(); 

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic