From 2c838197751db19d08a00e633e33dce23a69fb0c Mon Sep 17 00:00:00 2001 From: Len Brown Date: Thu, 27 Dec 2007 23:55:13 -0500 Subject: increase PNP_MAX_PORT to 40 from 24 a7839e960675b549f06209d18283d5cee2ce9261 (PNP: increase the maximum number of resources) increased PNP_MAX_PORT to 24 from 8. It also added a test and a complaint when a machine exceeded the limit, causing: pnpacpi: exceeded the max number of IO resources: 24 http://bugzilla.kernel.org/show_bug.cgi?id=9535 We should have been squawking about this all along, as this is a potentially serious issue. For now, simply burn some dynamic bytes and increase the limit by another 16 to 40. There is no guarantee that this will satisfy every system on Earth. It probably will not, but it should be an improvement. In the future, PNPACPI should allocate resource structures as needed, rather than max-sized arrays. Signed-off-by: Len Brown --- include/linux/pnp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 0a0426c2867d..2a6d62c7d2d1 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -13,7 +13,7 @@ #include #include -#define PNP_MAX_PORT 24 +#define PNP_MAX_PORT 40 #define PNP_MAX_MEM 12 #define PNP_MAX_IRQ 2 #define PNP_MAX_DMA 2 -- cgit v1.2.3-59-g8ed1b From d1ec7298fcefd7e4d1ca612da402ce9e5d5e2c13 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Fri, 11 Jan 2008 00:24:55 -0500 Subject: ACPI: apply quirk_ich6_lpc_acpi to more ICH8 and ICH9 It is important that these resources be reserved to avoid conflicts with well known ACPI registers. Signed-off-by: Zhao Yakui Signed-off-by: Len Brown --- drivers/pci/quirks.c | 6 ++++++ include/linux/pci_ids.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 26cc4dcf4f0e..72e0bd5d80ac 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -465,6 +465,12 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, quirk DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0, quirk_ich6_lpc_acpi ); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2, quirk_ich6_lpc_acpi ); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3, quirk_ich6_lpc_acpi ); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_1, quirk_ich6_lpc_acpi ); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4, quirk_ich6_lpc_acpi ); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2, quirk_ich6_lpc_acpi ); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_4, quirk_ich6_lpc_acpi ); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7, quirk_ich6_lpc_acpi ); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_8, quirk_ich6_lpc_acpi ); /* * VIA ACPI: One IO region pointed to by longword at diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 023656d2f1da..7f2215139e9a 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2322,6 +2322,8 @@ #define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914 #define PCI_DEVICE_ID_INTEL_ICH9_5 0x2919 #define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930 +#define PCI_DEVICE_ID_INTEL_ICH9_7 0x2916 +#define PCI_DEVICE_ID_INTEL_ICH9_8 0x2918 #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 -- cgit v1.2.3-59-g8ed1b From 9f9adecd2d0e4f88fa0e8cb06c6ec207748df70a Mon Sep 17 00:00:00 2001 From: Len Brown Date: Thu, 13 Dec 2007 17:38:03 -0500 Subject: PM: ACPI and APM must not be enabled at the same time ACPI and APM used "pm_active" to guarantee that they would not be simultaneously active. But pm_active was recently moved under CONFIG_PM_LEGACY, so that without CONFIG_PM_LEGACY, pm_active became a NOP -- allowing ACPI and APM to both be simultaneously enabled. This caused unpredictable results, including boot hangs. Further, the code under CONFIG_PM_LEGACY is scheduled for removal. So replace pm_active with pm_flags. pm_flags depends only on CONFIG_PM, which is present for both CONFIG_APM and CONFIG_ACPI. http://bugzilla.kernel.org/show_bug.cgi?id=9194 Signed-off-by: Len Brown Signed-off-by: Rafael J. Wysocki --- arch/x86/kernel/apm_32.c | 10 +++------- drivers/acpi/bus.c | 7 ++----- include/linux/pm.h | 9 +++++++++ include/linux/pm_legacy.h | 6 ------ kernel/power/main.c | 3 +++ kernel/power/pm.c | 4 ---- 6 files changed, 17 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index 17089a041028..af045ca0f653 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c @@ -2256,14 +2256,12 @@ static int __init apm_init(void) apm_info.disabled = 1; return -ENODEV; } - if (PM_IS_ACTIVE()) { + if (pm_flags & PM_ACPI) { printk(KERN_NOTICE "apm: overridden by ACPI.\n"); apm_info.disabled = 1; return -ENODEV; } -#ifdef CONFIG_PM_LEGACY - pm_active = 1; -#endif + pm_flags |= PM_APM; /* * Set up a segment that references the real mode segment 0x40 @@ -2366,9 +2364,7 @@ static void __exit apm_exit(void) kthread_stop(kapmd_task); kapmd_task = NULL; } -#ifdef CONFIG_PM_LEGACY - pm_active = 0; -#endif + pm_flags &= ~PM_APM; } module_init(apm_init); diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 49d432d0a12c..d7a115c362d1 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #ifdef CONFIG_X86 @@ -764,16 +763,14 @@ static int __init acpi_init(void) result = acpi_bus_init(); if (!result) { -#ifdef CONFIG_PM_LEGACY - if (!PM_IS_ACTIVE()) - pm_active = 1; + if (!(pm_flags & PM_APM)) + pm_flags |= PM_ACPI; else { printk(KERN_INFO PREFIX "APM is already active, exiting\n"); disable_acpi(); result = -ENODEV; } -#endif } else disable_acpi(); diff --git a/include/linux/pm.h b/include/linux/pm.h index 09a309b7b5d2..b78e0295adf4 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -246,6 +246,15 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on) device_set_wakeup_enable(dev,val); \ } while(0) +/* + * Global Power Management flags + * Used to keep APM and ACPI from both being active + */ +extern unsigned int pm_flags; + +#define PM_APM 1 +#define PM_ACPI 2 + #endif /* __KERNEL__ */ #endif /* _LINUX_PM_H */ diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h index 514729a44688..446f4f42b952 100644 --- a/include/linux/pm_legacy.h +++ b/include/linux/pm_legacy.h @@ -4,10 +4,6 @@ #ifdef CONFIG_PM_LEGACY -extern int pm_active; - -#define PM_IS_ACTIVE() (pm_active != 0) - /* * Register a device with power management */ @@ -21,8 +17,6 @@ int __deprecated pm_send_all(pm_request_t rqst, void *data); #else /* CONFIG_PM_LEGACY */ -#define PM_IS_ACTIVE() 0 - static inline struct pm_dev *pm_register(pm_dev_t type, unsigned long id, pm_callback callback) diff --git a/kernel/power/main.c b/kernel/power/main.c index 3cdf95b1dc92..f71c9504a5c5 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -28,6 +28,9 @@ BLOCKING_NOTIFIER_HEAD(pm_chain_head); DEFINE_MUTEX(pm_mutex); +unsigned int pm_flags; +EXPORT_SYMBOL(pm_flags); + #ifdef CONFIG_SUSPEND /* This is just an arbitrary number */ diff --git a/kernel/power/pm.c b/kernel/power/pm.c index c50d15266c10..60c73fa670d5 100644 --- a/kernel/power/pm.c +++ b/kernel/power/pm.c @@ -27,8 +27,6 @@ #include #include -int pm_active; - /* * Locking notes: * pm_devs_lock can be a semaphore providing pm ops are not called @@ -204,6 +202,4 @@ int pm_send_all(pm_request_t rqst, void *data) EXPORT_SYMBOL(pm_register); EXPORT_SYMBOL(pm_send_all); -EXPORT_SYMBOL(pm_active); - -- cgit v1.2.3-59-g8ed1b