* [PATCH 02/15] ACPI / PM: Do not refcount power resources that can't be turned on
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 03/15] ACPI ac: update AC status upon sysfs query Len Brown
` (12 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Rafael J. Wysocki, Len Brown
From: Rafael J. Wysocki <rjw@sisk.pl>
If turning on a power resource fails, do not reference count it,
since it cannot be in use in that case.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/power.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 792a830..4c9c2fb 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -213,11 +213,13 @@ static int acpi_power_on(acpi_handle handle)
resource->name));
} else {
result = __acpi_power_on(resource);
+ if (result)
+ resource->ref_count--;
}
mutex_unlock(&resource->resource_lock);
- return 0;
+ return result;
}
static int acpi_power_off_device(acpi_handle handle)
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 03/15] ACPI ac: update AC status upon sysfs query
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
2010-12-11 7:06 ` [PATCH 02/15] ACPI / PM: Do not refcount power resources that can't be turned on Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 04/15] ACPI battery: update " Len Brown
` (11 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Zhang Rui, Len Brown
From: Zhang Rui <rui.zhang@intel.com>
http://marc.info/?l=linux-acpi&m=128855015826728&w=2
https://bugzilla.kernel.org/show_bug.cgi?id=21722
Tested_by: Seblu <seblu@seblu.net>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/ac.c | 46 +++++++++++++++++++++++++++++-----------------
1 files changed, 29 insertions(+), 17 deletions(-)
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index ba9afea..25d3aae 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -100,24 +100,7 @@ static const struct file_operations acpi_ac_fops = {
.release = single_release,
};
#endif
-static int get_ac_property(struct power_supply *psy,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- struct acpi_ac *ac = to_acpi_ac(psy);
- switch (psp) {
- case POWER_SUPPLY_PROP_ONLINE:
- val->intval = ac->state;
- break;
- default:
- return -EINVAL;
- }
- return 0;
-}
-static enum power_supply_property ac_props[] = {
- POWER_SUPPLY_PROP_ONLINE,
-};
/* --------------------------------------------------------------------------
AC Adapter Management
-------------------------------------------------------------------------- */
@@ -140,6 +123,35 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
return 0;
}
+/* --------------------------------------------------------------------------
+ sysfs I/F
+ -------------------------------------------------------------------------- */
+static int get_ac_property(struct power_supply *psy,
+ enum power_supply_property psp,
+ union power_supply_propval *val)
+{
+ struct acpi_ac *ac = to_acpi_ac(psy);
+
+ if (!ac)
+ return -ENODEV;
+
+ if (acpi_ac_get_state(ac))
+ return -ENODEV;
+
+ switch (psp) {
+ case POWER_SUPPLY_PROP_ONLINE:
+ val->intval = ac->state;
+ break;
+ default:
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static enum power_supply_property ac_props[] = {
+ POWER_SUPPLY_PROP_ONLINE,
+};
+
#ifdef CONFIG_ACPI_PROCFS_POWER
/* --------------------------------------------------------------------------
FS Interface (/proc)
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 04/15] ACPI battery: update status upon sysfs query
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
2010-12-11 7:06 ` [PATCH 02/15] ACPI / PM: Do not refcount power resources that can't be turned on Len Brown
2010-12-11 7:06 ` [PATCH 03/15] ACPI ac: update AC status upon sysfs query Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 05/15] ACPI: EC: Add another dmi match entry for MSI hardware Len Brown
` (10 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Zhang Rui, Len Brown
From: Zhang Rui <rui.zhang@intel.com>
Sometimes the Battery driver doesn't get notifications when it's
plugged/unplugged. And this results in the incorrect Battery
status reported by the power supply sysfs I/F.
Update Battery status first when querying from sysfs.
http://marc.info/?l=linux-acpi&m=128855015826728&w=2
Tested_by: Seblu <seblu@seblu.net>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/battery.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 95649d3..9fb9d5a 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -130,6 +130,8 @@ struct acpi_battery {
unsigned long flags;
};
+static int acpi_battery_update(struct acpi_battery *battery);
+
#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);
inline int acpi_battery_present(struct acpi_battery *battery)
@@ -184,6 +186,9 @@ static int acpi_battery_get_property(struct power_supply *psy,
int ret = 0;
struct acpi_battery *battery = to_acpi_battery(psy);
+ if (acpi_battery_update(battery))
+ return -ENODEV;
+
if (acpi_battery_present(battery)) {
/* run battery update only if it is present */
acpi_battery_get_state(battery);
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 05/15] ACPI: EC: Add another dmi match entry for MSI hardware
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (2 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 04/15] ACPI battery: update " Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 06/15] acpi: fix _OSI string setup regression Len Brown
` (9 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Alexey Starikovskiy, stable, Len Brown
From: Alexey Starikovskiy <astarikovskiy@suse.de>
http://bugzilla.kernel.org/show_bug.cgi?id=15418
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
cc: stable@kernel.org
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/ec.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 372ff80..302b31e 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -934,6 +934,9 @@ static struct dmi_system_id __initdata ec_dmi_table[] = {
ec_flag_msi, "MSI hardware", {
DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL},
{
+ ec_flag_msi, "MSI hardware", {
+ DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR")}, NULL},
+ {
ec_validate_ecdt, "ASUS hardware", {
DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL},
{},
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 06/15] acpi: fix _OSI string setup regression
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (3 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 05/15] ACPI: EC: Add another dmi match entry for MSI hardware Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 07/15] ACPI: fix allowing to add/remove multiple _OSI strings Len Brown
` (8 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Lin Ming, Len Brown
From: Lin Ming <ming.m.lin@intel.com>
commit b0ed7a91(ACPICA/ACPI: Add new host interfaces for _OSI suppor)
introduced a regression that _OSI string setup fails.
There are 2 paths to setup _OSI string.
DMI:
acpi_dmi_osi_linux -> set_osi_linux -> acpi_osi_setup -> copy _OSI
string to osi_setup_string
Boot command line:
acpi_osi_setup -> copy _OSI string to osi_setup_string
Later, acpi_osi_setup_late will be called to handle osi_setup_string.
If _OSI string is "Linux" or "!Linux", then the call path is,
acpi_osi_setup_late -> acpi_cmdline_osi_linux -> set_osi_linux ->
acpi_osi_setup -> copy _OSI string to osi_setup_string
This actually never installs _OSI string(acpi_install_interface not
called), but just copy the _OSI string to osi_setup_string.
This patch fixes the regression.
Reported-and-tested-by: Lukas Hejtmanek <xhejtman@ics.muni.cz>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/osl.c | 59 ++++++++++++++++++++++++++++----------------------
include/linux/acpi.h | 2 +-
2 files changed, 34 insertions(+), 27 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 966fedd..6867443 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -152,8 +152,7 @@ static struct osi_linux {
unsigned int enable:1;
unsigned int dmi:1;
unsigned int cmdline:1;
- unsigned int known:1;
-} osi_linux = { 0, 0, 0, 0};
+} osi_linux = {0, 0, 0};
static u32 acpi_osi_handler(acpi_string interface, u32 supported)
{
@@ -1055,13 +1054,22 @@ static int __init acpi_os_name_setup(char *str)
__setup("acpi_os_name=", acpi_os_name_setup);
+void __init acpi_osi_setup(char *str)
+{
+ if (!acpi_gbl_create_osi_method)
+ return;
+
+ if (str == NULL || *str == '\0') {
+ printk(KERN_INFO PREFIX "_OSI method disabled\n");
+ acpi_gbl_create_osi_method = FALSE;
+ } else
+ strncpy(osi_setup_string, str, OSI_STRING_LENGTH_MAX);
+}
+
static void __init set_osi_linux(unsigned int enable)
{
- if (osi_linux.enable != enable) {
+ if (osi_linux.enable != enable)
osi_linux.enable = enable;
- printk(KERN_NOTICE PREFIX "%sed _OSI(Linux)\n",
- enable ? "Add": "Delet");
- }
if (osi_linux.enable)
acpi_osi_setup("Linux");
@@ -1073,7 +1081,8 @@ static void __init set_osi_linux(unsigned int enable)
static void __init acpi_cmdline_osi_linux(unsigned int enable)
{
- osi_linux.cmdline = 1; /* cmdline set the default */
+ osi_linux.cmdline = 1; /* cmdline set the default and override DMI */
+ osi_linux.dmi = 0;
set_osi_linux(enable);
return;
@@ -1081,15 +1090,12 @@ static void __init acpi_cmdline_osi_linux(unsigned int enable)
void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d)
{
- osi_linux.dmi = 1; /* DMI knows that this box asks OSI(Linux) */
-
printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
if (enable == -1)
return;
- osi_linux.known = 1; /* DMI knows which OSI(Linux) default needed */
-
+ osi_linux.dmi = 1; /* DMI knows that this box asks OSI(Linux) */
set_osi_linux(enable);
return;
@@ -1105,36 +1111,37 @@ void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d)
static void __init acpi_osi_setup_late(void)
{
char *str = osi_setup_string;
+ acpi_status status;
if (*str == '\0')
return;
- if (!strcmp("!Linux", str)) {
- acpi_cmdline_osi_linux(0); /* !enable */
- } else if (*str == '!') {
- if (acpi_remove_interface(++str) == AE_OK)
+ if (*str == '!') {
+ status = acpi_remove_interface(++str);
+
+ if (ACPI_SUCCESS(status))
printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
- } else if (!strcmp("Linux", str)) {
- acpi_cmdline_osi_linux(1); /* enable */
} else {
- if (acpi_install_interface(str) == AE_OK)
+ status = acpi_install_interface(str);
+
+ if (ACPI_SUCCESS(status))
printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
}
}
-int __init acpi_osi_setup(char *str)
+static int __init osi_setup(char *str)
{
- if (str == NULL || *str == '\0') {
- printk(KERN_INFO PREFIX "_OSI method disabled\n");
- acpi_gbl_create_osi_method = FALSE;
- } else {
- strncpy(osi_setup_string, str, OSI_STRING_LENGTH_MAX);
- }
+ if (str && !strcmp("Linux", str))
+ acpi_cmdline_osi_linux(1);
+ else if (str && !strcmp("!Linux", str))
+ acpi_cmdline_osi_linux(0);
+ else
+ acpi_osi_setup(str);
return 1;
}
-__setup("acpi_osi=", acpi_osi_setup);
+__setup("acpi_osi=", osi_setup);
/* enable serialization to combat AE_ALREADY_EXISTS errors */
static int __init acpi_serialize_setup(char *str)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 050a7bc..67c91b4 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -219,7 +219,7 @@ static inline int acpi_video_display_switch_support(void)
extern int acpi_blacklisted(void);
extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d);
-extern int acpi_osi_setup(char *str);
+extern void acpi_osi_setup(char *str);
#ifdef CONFIG_ACPI_NUMA
int acpi_get_pxm(acpi_handle handle);
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 07/15] ACPI: fix allowing to add/remove multiple _OSI strings
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (4 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 06/15] acpi: fix _OSI string setup regression Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 08/15] ACPI: video: fix build for VIDEO_OUTPUT_CONTROL=n Len Brown
` (7 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Lin Ming, Len Brown
From: Lin Ming <ming.m.lin@intel.com>
commit b0ed7a91(ACPICA/ACPI: Add new host interfaces for _OSI suppor)
introduced another regression that only one _OSI string can be added or
removed.
Now multiple _OSI strings can be added or removed, for example
acpi_osi=Linux acpi_osi=FreeBSD acpi_osi="!Windows 2006"
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/osl.c | 66 +++++++++++++++++++++++++++++++++++++++------------
1 files changed, 50 insertions(+), 16 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 6867443..d0a1bb5 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -110,9 +110,6 @@ struct acpi_ioremap {
static LIST_HEAD(acpi_ioremaps);
static DEFINE_SPINLOCK(acpi_ioremap_lock);
-#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */
-static char osi_setup_string[OSI_STRING_LENGTH_MAX];
-
static void __init acpi_osi_setup_late(void);
/*
@@ -1054,16 +1051,47 @@ static int __init acpi_os_name_setup(char *str)
__setup("acpi_os_name=", acpi_os_name_setup);
+#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */
+#define OSI_STRING_ENTRIES_MAX 16 /* arbitrary */
+
+struct osi_setup_entry {
+ char string[OSI_STRING_LENGTH_MAX];
+ bool enable;
+};
+
+static struct osi_setup_entry __initdata osi_setup_entries[OSI_STRING_ENTRIES_MAX];
+
void __init acpi_osi_setup(char *str)
{
+ struct osi_setup_entry *osi;
+ bool enable = true;
+ int i;
+
if (!acpi_gbl_create_osi_method)
return;
if (str == NULL || *str == '\0') {
printk(KERN_INFO PREFIX "_OSI method disabled\n");
acpi_gbl_create_osi_method = FALSE;
- } else
- strncpy(osi_setup_string, str, OSI_STRING_LENGTH_MAX);
+ return;
+ }
+
+ if (*str == '!') {
+ str++;
+ enable = false;
+ }
+
+ for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) {
+ osi = &osi_setup_entries[i];
+ if (!strcmp(osi->string, str)) {
+ osi->enable = enable;
+ break;
+ } else if (osi->string[0] == '\0') {
+ osi->enable = enable;
+ strncpy(osi->string, str, OSI_STRING_LENGTH_MAX);
+ break;
+ }
+ }
}
static void __init set_osi_linux(unsigned int enable)
@@ -1110,22 +1138,28 @@ void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d)
*/
static void __init acpi_osi_setup_late(void)
{
- char *str = osi_setup_string;
+ struct osi_setup_entry *osi;
+ char *str;
+ int i;
acpi_status status;
- if (*str == '\0')
- return;
+ for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) {
+ osi = &osi_setup_entries[i];
+ str = osi->string;
- if (*str == '!') {
- status = acpi_remove_interface(++str);
+ if (*str == '\0')
+ break;
+ if (osi->enable) {
+ status = acpi_install_interface(str);
- if (ACPI_SUCCESS(status))
- printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
- } else {
- status = acpi_install_interface(str);
+ if (ACPI_SUCCESS(status))
+ printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
+ } else {
+ status = acpi_remove_interface(str);
- if (ACPI_SUCCESS(status))
- printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
+ if (ACPI_SUCCESS(status))
+ printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
+ }
}
}
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 08/15] ACPI: video: fix build for VIDEO_OUTPUT_CONTROL=n
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (5 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 07/15] ACPI: fix allowing to add/remove multiple _OSI strings Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 09/15] ACPI: video: fix build for CONFIG_ACPI=n Len Brown
` (6 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Len Brown
From: Len Brown <len.brown@intel.com>
drivers/built-in.o: In function `acpi_video_bus_put_devices':
video.c:(.text+0x79663): undefined reference to
`video_output_unregister'
drivers/built-in.o: In function `acpi_video_bus_add':
video.c:(.text+0x7b0b3): undefined reference to `video_output_register'
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/linux/video_output.h | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/include/linux/video_output.h b/include/linux/video_output.h
index 2fb46bc..ed5cdeb 100644
--- a/include/linux/video_output.h
+++ b/include/linux/video_output.h
@@ -23,6 +23,7 @@
#ifndef _LINUX_VIDEO_OUTPUT_H
#define _LINUX_VIDEO_OUTPUT_H
#include <linux/device.h>
+#include <linux/err.h>
struct output_device;
struct output_properties {
int (*set_state)(struct output_device *);
@@ -34,9 +35,23 @@ struct output_device {
struct device dev;
};
#define to_output_device(obj) container_of(obj, struct output_device, dev)
+#if defined(CONFIG_VIDEO_OUTPUT_CONTROL) || defined(CONFIG_VIDEO_OUTPUT_CONTROL_MODULE)
struct output_device *video_output_register(const char *name,
struct device *dev,
void *devdata,
struct output_properties *op);
void video_output_unregister(struct output_device *dev);
+#else
+static struct output_device *video_output_register(const char *name,
+ struct device *dev,
+ void *devdata,
+ struct output_properties *op)
+{
+ return ERR_PTR(-ENODEV);
+}
+static void video_output_unregister(struct output_device *dev)
+{
+ return;
+}
+#endif
#endif
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 09/15] ACPI: video: fix build for CONFIG_ACPI=n
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (6 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 08/15] ACPI: video: fix build for VIDEO_OUTPUT_CONTROL=n Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 10/15] ACPI, APEI, use raw spinlock in ERST Len Brown
` (5 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Chris Wilson, Len Brown
From: Chris Wilson <chris@chris-wilson.co.uk>
In file included from drivers/gpu/drm/i915/intel_opregion.c:30:
include/acpi/video.h:22: warning: ‘struct acpi_device’ declared inside parameter list
...
include/acpi/video.h:24: error: ‘ENODEV’ undeclared (first use in this function)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
---
include/acpi/video.h | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/include/acpi/video.h b/include/acpi/video.h
index 551793c..0e98e67 100644
--- a/include/acpi/video.h
+++ b/include/acpi/video.h
@@ -1,6 +1,10 @@
#ifndef __ACPI_VIDEO_H
#define __ACPI_VIDEO_H
+#include <linux/errno.h> /* for ENODEV */
+
+struct acpi_device;
+
#define ACPI_VIDEO_DISPLAY_CRT 1
#define ACPI_VIDEO_DISPLAY_TV 2
#define ACPI_VIDEO_DISPLAY_DVI 3
@@ -26,4 +30,3 @@ static inline int acpi_video_get_edid(struct acpi_device *device, int type,
#endif
#endif
-
--
1.7.3.3.480.g2f76a
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 10/15] ACPI, APEI, use raw spinlock in ERST
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (7 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 09/15] ACPI: video: fix build for CONFIG_ACPI=n Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 11/15] ACPI: fix a section mismatch Len Brown
` (4 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Huang Ying, Len Brown
From: Huang Ying <ying.huang@intel.com>
ERST writing may be used in NMI or Machine Check Exception handler. So
it need to use raw spinlock instead of normal spinlock. This patch
fixes it.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/apei/erst.c | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 1211c03..5850d32 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -86,7 +86,7 @@ static struct erst_erange {
* It is used to provide exclusive accessing for ERST Error Log
* Address Range too.
*/
-static DEFINE_SPINLOCK(erst_lock);
+static DEFINE_RAW_SPINLOCK(erst_lock);
static inline int erst_errno(int command_status)
{
@@ -421,9 +421,9 @@ ssize_t erst_get_record_count(void)
if (erst_disable)
return -ENODEV;
- spin_lock_irqsave(&erst_lock, flags);
+ raw_spin_lock_irqsave(&erst_lock, flags);
count = __erst_get_record_count();
- spin_unlock_irqrestore(&erst_lock, flags);
+ raw_spin_unlock_irqrestore(&erst_lock, flags);
return count;
}
@@ -456,9 +456,9 @@ int erst_get_next_record_id(u64 *record_id)
if (erst_disable)
return -ENODEV;
- spin_lock_irqsave(&erst_lock, flags);
+ raw_spin_lock_irqsave(&erst_lock, flags);
rc = __erst_get_next_record_id(record_id);
- spin_unlock_irqrestore(&erst_lock, flags);
+ raw_spin_unlock_irqrestore(&erst_lock, flags);
return rc;
}
@@ -624,17 +624,17 @@ int erst_write(const struct cper_record_header *record)
return -EINVAL;
if (erst_erange.attr & ERST_RANGE_NVRAM) {
- if (!spin_trylock_irqsave(&erst_lock, flags))
+ if (!raw_spin_trylock_irqsave(&erst_lock, flags))
return -EBUSY;
rc = __erst_write_to_nvram(record);
- spin_unlock_irqrestore(&erst_lock, flags);
+ raw_spin_unlock_irqrestore(&erst_lock, flags);
return rc;
}
if (record->record_length > erst_erange.size)
return -EINVAL;
- if (!spin_trylock_irqsave(&erst_lock, flags))
+ if (!raw_spin_trylock_irqsave(&erst_lock, flags))
return -EBUSY;
memcpy(erst_erange.vaddr, record, record->record_length);
rcd_erange = erst_erange.vaddr;
@@ -642,7 +642,7 @@ int erst_write(const struct cper_record_header *record)
memcpy(&rcd_erange->persistence_information, "ER", 2);
rc = __erst_write_to_storage(0);
- spin_unlock_irqrestore(&erst_lock, flags);
+ raw_spin_unlock_irqrestore(&erst_lock, flags);
return rc;
}
@@ -696,9 +696,9 @@ ssize_t erst_read(u64 record_id, struct cper_record_header *record,
if (erst_disable)
return -ENODEV;
- spin_lock_irqsave(&erst_lock, flags);
+ raw_spin_lock_irqsave(&erst_lock, flags);
len = __erst_read(record_id, record, buflen);
- spin_unlock_irqrestore(&erst_lock, flags);
+ raw_spin_unlock_irqrestore(&erst_lock, flags);
return len;
}
EXPORT_SYMBOL_GPL(erst_read);
@@ -719,20 +719,20 @@ ssize_t erst_read_next(struct cper_record_header *record, size_t buflen)
if (erst_disable)
return -ENODEV;
- spin_lock_irqsave(&erst_lock, flags);
+ raw_spin_lock_irqsave(&erst_lock, flags);
rc = __erst_get_next_record_id(&record_id);
if (rc) {
- spin_unlock_irqrestore(&erst_lock, flags);
+ raw_spin_unlock_irqrestore(&erst_lock, flags);
return rc;
}
/* no more record */
if (record_id == APEI_ERST_INVALID_RECORD_ID) {
- spin_unlock_irqrestore(&erst_lock, flags);
+ raw_spin_unlock_irqrestore(&erst_lock, flags);
return 0;
}
len = __erst_read(record_id, record, buflen);
- spin_unlock_irqrestore(&erst_lock, flags);
+ raw_spin_unlock_irqrestore(&erst_lock, flags);
return len;
}
@@ -746,12 +746,12 @@ int erst_clear(u64 record_id)
if (erst_disable)
return -ENODEV;
- spin_lock_irqsave(&erst_lock, flags);
+ raw_spin_lock_irqsave(&erst_lock, flags);
if (erst_erange.attr & ERST_RANGE_NVRAM)
rc = __erst_clear_from_nvram(record_id);
else
rc = __erst_clear_from_storage(record_id);
- spin_unlock_irqrestore(&erst_lock, flags);
+ raw_spin_unlock_irqrestore(&erst_lock, flags);
return rc;
}
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 11/15] ACPI: fix a section mismatch
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (8 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 10/15] ACPI, APEI, use raw spinlock in ERST Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 12/15] ACPI thermal: remove two unused functions Len Brown
` (3 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Zhang Rui, Len Brown
From: Zhang Rui <rui.zhang@intel.com>
WARNING: drivers/acpi/acpi.o(.text+0xeda): Section mismatch in reference from the function acpi_os_initialize1() to the function .init.text:set_osi_linux()
The function acpi_os_initialize1() references
the function __init set_osi_linux().
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/osl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 966fedd..f7227e9 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -1530,7 +1530,7 @@ acpi_status __init acpi_os_initialize(void)
return AE_OK;
}
-acpi_status acpi_os_initialize1(void)
+acpi_status __init acpi_os_initialize1(void)
{
kacpid_wq = create_workqueue("kacpid");
kacpi_notify_wq = create_workqueue("kacpi_notify");
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 12/15] ACPI thermal: remove two unused functions
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (9 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 11/15] ACPI: fix a section mismatch Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 13/15] ACPI/PNP: avoid section mismatch warning Len Brown
` (2 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Zhang Rui, Len Brown
From: Zhang Rui <rui.zhang@intel.com>
When CONFIG_CPU_FREQ=n ...
drivers/acpi/processor_thermal.c:159:12: warning: ‘acpi_thermal_cpufreq_increase’ defined but not used
drivers/acpi/processor_thermal.c:163:12: warning: ‘acpi_thermal_cpufreq_decrease’ defined but not used
Remove unused declaration of ‘acpi_thermal_cpufreq_increase’ and
‘acpi_thermal_cpufreq_decrease’
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/processor_thermal.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index fde49b9..79cb653 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -156,15 +156,6 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state)
return 0;
}
-static int acpi_thermal_cpufreq_increase(unsigned int cpu)
-{
- return -ENODEV;
-}
-static int acpi_thermal_cpufreq_decrease(unsigned int cpu)
-{
- return -ENODEV;
-}
-
#endif
int acpi_processor_get_limit_info(struct acpi_processor *pr)
--
1.7.3.3.480.g2f76a
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 13/15] ACPI/PNP: avoid section mismatch warning
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (10 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 12/15] ACPI thermal: remove two unused functions Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 14/15] ACPI: eliminate unused variable warning for !ACPI_SLEEP Len Brown
2010-12-11 7:06 ` [PATCH 15/15] ACPI/HEST: adjust section selection Len Brown
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Jan Beulich, Jan Beulich, Len Brown
From: Jan Beulich <JBeulich@novell.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/pnp/pnpacpi/core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 2d73dfc..57313f4 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -180,7 +180,7 @@ struct pnp_protocol pnpacpi_protocol = {
};
EXPORT_SYMBOL(pnpacpi_protocol);
-static char *pnpacpi_get_id(struct acpi_device *device)
+static char *__init pnpacpi_get_id(struct acpi_device *device)
{
struct acpi_hardware_id *id;
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 14/15] ACPI: eliminate unused variable warning for !ACPI_SLEEP
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (11 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 13/15] ACPI/PNP: avoid section mismatch warning Len Brown
@ 2010-12-11 7:06 ` Len Brown
2010-12-11 7:06 ` [PATCH 15/15] ACPI/HEST: adjust section selection Len Brown
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Jan Beulich, Jan Beulich, Len Brown
From: Jan Beulich <JBeulich@novell.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/sleep.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 721d93b..2182c55 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -27,8 +27,6 @@
static u8 sleep_states[ACPI_S_STATE_COUNT];
-static u32 acpi_target_sleep_state = ACPI_STATE_S0;
-
static void acpi_sleep_tts_switch(u32 acpi_state)
{
union acpi_object in_arg = { ACPI_TYPE_INTEGER };
@@ -81,6 +79,8 @@ static int acpi_sleep_prepare(u32 acpi_state)
}
#ifdef CONFIG_ACPI_SLEEP
+static u32 acpi_target_sleep_state = ACPI_STATE_S0;
+
/*
* The ACPI specification wants us to save NVS memory regions during hibernation
* and to restore them during the subsequent resume. Windows does that also for
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH 15/15] ACPI/HEST: adjust section selection
2010-12-11 7:06 ` [PATCH 01/15] ACPI / PM: Check device state before refcounting power resources Len Brown
` (12 preceding siblings ...)
2010-12-11 7:06 ` [PATCH 14/15] ACPI: eliminate unused variable warning for !ACPI_SLEEP Len Brown
@ 2010-12-11 7:06 ` Len Brown
13 siblings, 0 replies; 16+ messages in thread
From: Len Brown @ 2010-12-11 7:06 UTC (permalink / raw)
To: linux-acpi; +Cc: Jan Beulich, Jan Beulich, Len Brown
From: Jan Beulich <JBeulich@novell.com>
Properly const-, __init-, and __read_mostly-annotate this code.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/apei/hest.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
index 1a3508a..daa7bc6 100644
--- a/drivers/acpi/apei/hest.c
+++ b/drivers/acpi/apei/hest.c
@@ -46,9 +46,9 @@ EXPORT_SYMBOL_GPL(hest_disable);
/* HEST table parsing */
-static struct acpi_table_hest *hest_tab;
+static struct acpi_table_hest *__read_mostly hest_tab;
-static int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
+static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
[ACPI_HEST_TYPE_IA32_CHECK] = -1, /* need further calculation */
[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
@@ -126,7 +126,7 @@ struct ghes_arr {
unsigned int count;
};
-static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
+static int __init hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
{
int *count = data;
@@ -135,7 +135,7 @@ static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
return 0;
}
-static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
+static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
{
struct platform_device *ghes_dev;
struct ghes_arr *ghes_arr = data;
@@ -165,7 +165,7 @@ err:
return rc;
}
-static int hest_ghes_dev_register(unsigned int ghes_count)
+static int __init hest_ghes_dev_register(unsigned int ghes_count)
{
int rc, i;
struct ghes_arr ghes_arr;
--
1.7.3.3.480.g2f76a
^ permalink raw reply related [flat|nested] 16+ messages in thread