patch-2.3.48 linux/arch/i386/kernel/acpi.c

Next file: linux/arch/i386/kernel/apm.c
Previous file: linux/arch/i386/defconfig
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.47/linux/arch/i386/kernel/acpi.c linux/arch/i386/kernel/acpi.c
@@ -34,6 +34,7 @@
 #include <linux/spinlock.h>
 #include <linux/ioport.h>
 #include <linux/slab.h>
+#include <linux/mm.h>
 #include <linux/pci.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -379,13 +380,14 @@
 				ioremap((unsigned long) addr, table_size);
 		}
 
-		if (!table) {
-			/* ioremap is a pain, it returns NULL if the
-			 * table starts within mapped physical memory.
-			 * Hopefully, no table straddles a mapped/unmapped
-			 * physical memory boundary, ugh
+		if (!table && addr < virt_to_phys(high_memory)) {
+			/* sometimes we see ACPI tables in low memory
+			 * and not reserved by the memory map (E820) code,
+			 * who is at fault for this?  BIOS?
 			 */
-			table = (struct acpi_table*) phys_to_virt(addr);
+			printk(KERN_ERR
+			       "ACPI: unreserved table memory @ 0x%p!\n",
+			       (void*) addr);
 		}
 	}
 	return table;
@@ -933,9 +935,9 @@
 	int status = 0;
 	
 	if (state == ACPI_D0)
-		status = pm_send_request(PM_RESUME, (void*) state);
+		status = pm_send_all(PM_RESUME, (void*) state);
 	else
-		status = pm_send_request(PM_SUSPEND, (void*) state);
+		status = pm_send_all(PM_SUSPEND, (void*) state);
 
 	return status;
 }
@@ -1333,10 +1335,7 @@
 
 	if (acpi_claim_ioports(acpi_facp)) {
 		printk(KERN_ERR "ACPI: I/O port allocation failed\n");
-		if (pci_driver_registered)
-			pci_unregister_driver(&acpi_driver);
-		acpi_destroy_tables();
-		return -ENODEV;
+		goto err_out;
 	}
 
 	if (acpi_facp->sci_int
@@ -1347,12 +1346,7 @@
 			   acpi_facp)) {
 		printk(KERN_ERR "ACPI: SCI (IRQ%d) allocation failed\n",
 		       acpi_facp->sci_int);
-
-		if (pci_driver_registered)
-			pci_unregister_driver(&acpi_driver);
-		acpi_destroy_tables();
-
-		return -ENODEV;
+		goto err_out;
 	}
 
 	acpi_sysctl = register_sysctl_table(acpi_dir_table, 1);
@@ -1379,6 +1373,13 @@
 		pm_idle = acpi_idle;
 
 	return 0;
+
+err_out:
+	if (pci_driver_registered)
+		pci_unregister_driver(&acpi_driver);
+	acpi_destroy_tables();
+
+	return -ENODEV;
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)