diff options
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/asus_acpi.c | 4 | ||||
-rw-r--r-- | drivers/acpi/pci_slot.c | 18 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 15 | ||||
-rw-r--r-- | drivers/acpi/processor_perflib.c | 21 | ||||
-rw-r--r-- | drivers/acpi/processor_throttling.c | 11 |
5 files changed, 39 insertions, 30 deletions
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index 44ad90c03c2e..d3d0886d637f 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c | |||
@@ -78,9 +78,9 @@ MODULE_LICENSE("GPL"); | |||
78 | static uid_t asus_uid; | 78 | static uid_t asus_uid; |
79 | static gid_t asus_gid; | 79 | static gid_t asus_gid; |
80 | module_param(asus_uid, uint, 0); | 80 | module_param(asus_uid, uint, 0); |
81 | MODULE_PARM_DESC(asus_uid, "UID for entries in /proc/acpi/asus.\n"); | 81 | MODULE_PARM_DESC(asus_uid, "UID for entries in /proc/acpi/asus"); |
82 | module_param(asus_gid, uint, 0); | 82 | module_param(asus_gid, uint, 0); |
83 | MODULE_PARM_DESC(asus_gid, "GID for entries in /proc/acpi/asus.\n"); | 83 | MODULE_PARM_DESC(asus_gid, "GID for entries in /proc/acpi/asus"); |
84 | 84 | ||
85 | /* For each model, all features implemented, | 85 | /* For each model, all features implemented, |
86 | * those marked with R are relative to HOTK, A for absolute */ | 86 | * those marked with R are relative to HOTK, A for absolute */ |
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index dd376f7ad090..d5b4ef898879 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c | |||
@@ -76,9 +76,9 @@ static struct acpi_pci_driver acpi_pci_slot_driver = { | |||
76 | }; | 76 | }; |
77 | 77 | ||
78 | static int | 78 | static int |
79 | check_slot(acpi_handle handle, int *device, unsigned long *sun) | 79 | check_slot(acpi_handle handle, unsigned long *sun) |
80 | { | 80 | { |
81 | int retval = 0; | 81 | int device = -1; |
82 | unsigned long adr, sta; | 82 | unsigned long adr, sta; |
83 | acpi_status status; | 83 | acpi_status status; |
84 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 84 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
@@ -89,32 +89,27 @@ check_slot(acpi_handle handle, int *device, unsigned long *sun) | |||
89 | if (check_sta_before_sun) { | 89 | if (check_sta_before_sun) { |
90 | /* If SxFy doesn't have _STA, we just assume it's there */ | 90 | /* If SxFy doesn't have _STA, we just assume it's there */ |
91 | status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); | 91 | status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); |
92 | if (ACPI_SUCCESS(status) && !(sta & ACPI_STA_DEVICE_PRESENT)) { | 92 | if (ACPI_SUCCESS(status) && !(sta & ACPI_STA_DEVICE_PRESENT)) |
93 | retval = -1; | ||
94 | goto out; | 93 | goto out; |
95 | } | ||
96 | } | 94 | } |
97 | 95 | ||
98 | status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); | 96 | status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); |
99 | if (ACPI_FAILURE(status)) { | 97 | if (ACPI_FAILURE(status)) { |
100 | dbg("_ADR returned %d on %s\n", status, (char *)buffer.pointer); | 98 | dbg("_ADR returned %d on %s\n", status, (char *)buffer.pointer); |
101 | retval = -1; | ||
102 | goto out; | 99 | goto out; |
103 | } | 100 | } |
104 | 101 | ||
105 | *device = (adr >> 16) & 0xffff; | ||
106 | |||
107 | /* No _SUN == not a slot == bail */ | 102 | /* No _SUN == not a slot == bail */ |
108 | status = acpi_evaluate_integer(handle, "_SUN", NULL, sun); | 103 | status = acpi_evaluate_integer(handle, "_SUN", NULL, sun); |
109 | if (ACPI_FAILURE(status)) { | 104 | if (ACPI_FAILURE(status)) { |
110 | dbg("_SUN returned %d on %s\n", status, (char *)buffer.pointer); | 105 | dbg("_SUN returned %d on %s\n", status, (char *)buffer.pointer); |
111 | retval = -1; | ||
112 | goto out; | 106 | goto out; |
113 | } | 107 | } |
114 | 108 | ||
109 | device = (adr >> 16) & 0xffff; | ||
115 | out: | 110 | out: |
116 | kfree(buffer.pointer); | 111 | kfree(buffer.pointer); |
117 | return retval; | 112 | return device; |
118 | } | 113 | } |
119 | 114 | ||
120 | struct callback_args { | 115 | struct callback_args { |
@@ -144,7 +139,8 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
144 | struct callback_args *parent_context = context; | 139 | struct callback_args *parent_context = context; |
145 | struct pci_bus *pci_bus = parent_context->pci_bus; | 140 | struct pci_bus *pci_bus = parent_context->pci_bus; |
146 | 141 | ||
147 | if (check_slot(handle, &device, &sun)) | 142 | device = check_slot(handle, &sun); |
143 | if (device < 0) | ||
148 | return AE_OK; | 144 | return AE_OK; |
149 | 145 | ||
150 | slot = kmalloc(sizeof(*slot), GFP_KERNEL); | 146 | slot = kmalloc(sizeof(*slot), GFP_KERNEL); |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index b7f2963693a7..283c08f5f4d4 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -1332,9 +1332,15 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) | |||
1332 | if (!pr->flags.power_setup_done) | 1332 | if (!pr->flags.power_setup_done) |
1333 | return -ENODEV; | 1333 | return -ENODEV; |
1334 | 1334 | ||
1335 | /* Fall back to the default idle loop */ | 1335 | /* |
1336 | pm_idle = pm_idle_save; | 1336 | * Fall back to the default idle loop, when pm_idle_save had |
1337 | synchronize_sched(); /* Relies on interrupts forcing exit from idle. */ | 1337 | * been initialized. |
1338 | */ | ||
1339 | if (pm_idle_save) { | ||
1340 | pm_idle = pm_idle_save; | ||
1341 | /* Relies on interrupts forcing exit from idle. */ | ||
1342 | synchronize_sched(); | ||
1343 | } | ||
1338 | 1344 | ||
1339 | pr->flags.power = 0; | 1345 | pr->flags.power = 0; |
1340 | result = acpi_processor_get_power_info(pr); | 1346 | result = acpi_processor_get_power_info(pr); |
@@ -1896,7 +1902,8 @@ int acpi_processor_power_exit(struct acpi_processor *pr, | |||
1896 | 1902 | ||
1897 | /* Unregister the idle handler when processor #0 is removed. */ | 1903 | /* Unregister the idle handler when processor #0 is removed. */ |
1898 | if (pr->id == 0) { | 1904 | if (pr->id == 0) { |
1899 | pm_idle = pm_idle_save; | 1905 | if (pm_idle_save) |
1906 | pm_idle = pm_idle_save; | ||
1900 | 1907 | ||
1901 | /* | 1908 | /* |
1902 | * We are about to unload the current idle thread pm callback | 1909 | * We are about to unload the current idle thread pm callback |
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index b4749969c6b4..0133af49cf06 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -64,7 +64,13 @@ static DEFINE_MUTEX(performance_mutex); | |||
64 | * policy is adjusted accordingly. | 64 | * policy is adjusted accordingly. |
65 | */ | 65 | */ |
66 | 66 | ||
67 | static unsigned int ignore_ppc = 0; | 67 | /* ignore_ppc: |
68 | * -1 -> cpufreq low level drivers not initialized -> _PSS, etc. not called yet | ||
69 | * ignore _PPC | ||
70 | * 0 -> cpufreq low level drivers initialized -> consider _PPC values | ||
71 | * 1 -> ignore _PPC totally -> forced by user through boot param | ||
72 | */ | ||
73 | static unsigned int ignore_ppc = -1; | ||
68 | module_param(ignore_ppc, uint, 0644); | 74 | module_param(ignore_ppc, uint, 0644); |
69 | MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \ | 75 | MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \ |
70 | "limited by BIOS, this should help"); | 76 | "limited by BIOS, this should help"); |
@@ -72,7 +78,7 @@ MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \ | |||
72 | #define PPC_REGISTERED 1 | 78 | #define PPC_REGISTERED 1 |
73 | #define PPC_IN_USE 2 | 79 | #define PPC_IN_USE 2 |
74 | 80 | ||
75 | static int acpi_processor_ppc_status = 0; | 81 | static int acpi_processor_ppc_status; |
76 | 82 | ||
77 | static int acpi_processor_ppc_notifier(struct notifier_block *nb, | 83 | static int acpi_processor_ppc_notifier(struct notifier_block *nb, |
78 | unsigned long event, void *data) | 84 | unsigned long event, void *data) |
@@ -81,13 +87,18 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb, | |||
81 | struct acpi_processor *pr; | 87 | struct acpi_processor *pr; |
82 | unsigned int ppc = 0; | 88 | unsigned int ppc = 0; |
83 | 89 | ||
84 | if (ignore_ppc) | 90 | if (event == CPUFREQ_START && ignore_ppc <= 0) { |
91 | ignore_ppc = 0; | ||
85 | return 0; | 92 | return 0; |
93 | } | ||
86 | 94 | ||
87 | mutex_lock(&performance_mutex); | 95 | if (ignore_ppc) |
96 | return 0; | ||
88 | 97 | ||
89 | if (event != CPUFREQ_INCOMPATIBLE) | 98 | if (event != CPUFREQ_INCOMPATIBLE) |
90 | goto out; | 99 | return 0; |
100 | |||
101 | mutex_lock(&performance_mutex); | ||
91 | 102 | ||
92 | pr = per_cpu(processors, policy->cpu); | 103 | pr = per_cpu(processors, policy->cpu); |
93 | if (!pr || !pr->performance) | 104 | if (!pr || !pr->performance) |
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index a2c3f9cfa549..a56fc6c4394b 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c | |||
@@ -827,7 +827,6 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr) | |||
827 | static int acpi_processor_get_throttling(struct acpi_processor *pr) | 827 | static int acpi_processor_get_throttling(struct acpi_processor *pr) |
828 | { | 828 | { |
829 | cpumask_t saved_mask; | 829 | cpumask_t saved_mask; |
830 | cpumask_of_cpu_ptr_declare(new_mask); | ||
831 | int ret; | 830 | int ret; |
832 | 831 | ||
833 | if (!pr) | 832 | if (!pr) |
@@ -839,8 +838,7 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr) | |||
839 | * Migrate task to the cpu pointed by pr. | 838 | * Migrate task to the cpu pointed by pr. |
840 | */ | 839 | */ |
841 | saved_mask = current->cpus_allowed; | 840 | saved_mask = current->cpus_allowed; |
842 | cpumask_of_cpu_ptr_next(new_mask, pr->id); | 841 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(pr->id)); |
843 | set_cpus_allowed_ptr(current, new_mask); | ||
844 | ret = pr->throttling.acpi_processor_get_throttling(pr); | 842 | ret = pr->throttling.acpi_processor_get_throttling(pr); |
845 | /* restore the previous state */ | 843 | /* restore the previous state */ |
846 | set_cpus_allowed_ptr(current, &saved_mask); | 844 | set_cpus_allowed_ptr(current, &saved_mask); |
@@ -989,7 +987,6 @@ static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr, | |||
989 | int acpi_processor_set_throttling(struct acpi_processor *pr, int state) | 987 | int acpi_processor_set_throttling(struct acpi_processor *pr, int state) |
990 | { | 988 | { |
991 | cpumask_t saved_mask; | 989 | cpumask_t saved_mask; |
992 | cpumask_of_cpu_ptr_declare(new_mask); | ||
993 | int ret = 0; | 990 | int ret = 0; |
994 | unsigned int i; | 991 | unsigned int i; |
995 | struct acpi_processor *match_pr; | 992 | struct acpi_processor *match_pr; |
@@ -1028,8 +1025,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state) | |||
1028 | * it can be called only for the cpu pointed by pr. | 1025 | * it can be called only for the cpu pointed by pr. |
1029 | */ | 1026 | */ |
1030 | if (p_throttling->shared_type == DOMAIN_COORD_TYPE_SW_ANY) { | 1027 | if (p_throttling->shared_type == DOMAIN_COORD_TYPE_SW_ANY) { |
1031 | cpumask_of_cpu_ptr_next(new_mask, pr->id); | 1028 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(pr->id)); |
1032 | set_cpus_allowed_ptr(current, new_mask); | ||
1033 | ret = p_throttling->acpi_processor_set_throttling(pr, | 1029 | ret = p_throttling->acpi_processor_set_throttling(pr, |
1034 | t_state.target_state); | 1030 | t_state.target_state); |
1035 | } else { | 1031 | } else { |
@@ -1060,8 +1056,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state) | |||
1060 | continue; | 1056 | continue; |
1061 | } | 1057 | } |
1062 | t_state.cpu = i; | 1058 | t_state.cpu = i; |
1063 | cpumask_of_cpu_ptr_next(new_mask, i); | 1059 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(i)); |
1064 | set_cpus_allowed_ptr(current, new_mask); | ||
1065 | ret = match_pr->throttling. | 1060 | ret = match_pr->throttling. |
1066 | acpi_processor_set_throttling( | 1061 | acpi_processor_set_throttling( |
1067 | match_pr, t_state.target_state); | 1062 | match_pr, t_state.target_state); |