Skip to content

Commit 6f15818

Browse files
committed
Merge branches 'acpi-pm', 'acpi-processor', 'acpi-ec' and 'acpi-video'
Make ACPI power management changes, ACPI processor driver updates, ACPI EC driver quirk and ACPI backlight driver updates for 6.2-rc1: - Print full name paths of ACPI power resources objects during enumeration (Kane Chen). - Eliminate a compiler warning regarding a missing function prototype in the ACPI power management code (Sudeep Holla). - Fix and clean up the ACPI processor driver (Rafael Wysocki, Li Zhong, Colin Ian King, Sudeep Holla). - Add quirk for the HP Pavilion Gaming 15-cx0041ur to the ACPI EC driver (Mia Kanashi). - Add some mew ACPI backlight handling quirks and update some existing ones (Hans de Goede). - Make the ACPI backlight driver prefer the native backlight control over vendor backlight control when possible (Hans de Goede). * acpi-pm: ACPI: PM: Silence missing prototype warning ACPI: PM: Print full name path while adding power resource * acpi-processor: ACPI: processor: perflib: Adjust acpi_processor_notify_smm() return value ACPI: processor: perflib: Rearrange acpi_processor_notify_smm() ACPI: processor: perflib: Rearrange unregistration routine ACPI: processor: perflib: Drop redundant parentheses ACPI: processor: perflib: Adjust white space ACPI: processor: idle: Drop unnecessary statements and parens ACPI: processor: Silence missing prototype warnings ACPI: processor_idle: Silence missing prototype warnings ACPI: processor: throttling: remove variable count ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value * acpi-ec: ACPI: EC: Add quirk for the HP Pavilion Gaming 15-cx0041ur * acpi-video: ACPI: video: Prefer native over vendor ACPI: video: Simplify __acpi_video_get_backlight_type() ACPI: video: Add force_native quirk for Sony Vaio VPCY11S1E ACPI: video: Add force_vendor quirk for Sony Vaio PCG-FRV35 ACPI: video: Change Sony Vaio VPCEH3U1E quirk to force_native ACPI: video: Change GIGABYTE GB-BXBT-2807 quirk to force_none ACPI: video: Add a few bugtracker links to DMI quirks
5 parents 45494d7 + d96d30d + f1a70ba + b423f24 + fb1836c commit 6f15818

File tree

8 files changed

+136
-111
lines changed

8 files changed

+136
-111
lines changed

drivers/acpi/ec.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,6 +1874,16 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = {
18741874
DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Gaming Laptop 15-cx0xxx"),
18751875
},
18761876
},
1877+
{
1878+
/*
1879+
* HP Pavilion Gaming Laptop 15-cx0041ur
1880+
*/
1881+
.callback = ec_honor_dsdt_gpe,
1882+
.matches = {
1883+
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
1884+
DMI_MATCH(DMI_PRODUCT_NAME, "HP 15-cx0041ur"),
1885+
},
1886+
},
18771887
{
18781888
/*
18791889
* Samsung hardware

drivers/acpi/power.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle)
967967
if (acpi_power_get_state(resource, &state_dummy))
968968
__acpi_power_on(resource);
969969

970-
pr_info("%s [%s]\n", acpi_device_name(device), acpi_device_bid(device));
970+
acpi_handle_info(handle, "New power resource\n");
971971

972972
result = acpi_tie_acpi_dev(device);
973973
if (result)

drivers/acpi/processor_idle.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
324324
* the erratum), but this is known to disrupt certain ISA
325325
* devices thus we take the conservative approach.
326326
*/
327-
else if (errata.piix4.fdma) {
327+
if (errata.piix4.fdma) {
328328
acpi_handle_debug(pr->handle,
329329
"C3 not supported on PIIX4 with Type-F DMA\n");
330330
return;
@@ -384,8 +384,6 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
384384
* handle BM_RLD is to set it and leave it set.
385385
*/
386386
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, 1);
387-
388-
return;
389387
}
390388

391389
static int acpi_cst_latency_cmp(const void *a, const void *b)
@@ -459,7 +457,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
459457

460458
lapic_timer_propagate_broadcast(pr);
461459

462-
return (working);
460+
return working;
463461
}
464462

465463
static int acpi_processor_get_cstate_info(struct acpi_processor *pr)
@@ -1134,6 +1132,9 @@ static int acpi_processor_get_lpi_info(struct acpi_processor *pr)
11341132
status = acpi_get_parent(handle, &pr_ahandle);
11351133
while (ACPI_SUCCESS(status)) {
11361134
d = acpi_fetch_acpi_dev(pr_ahandle);
1135+
if (!d)
1136+
break;
1137+
11371138
handle = pr_ahandle;
11381139

11391140
if (strcmp(acpi_device_hid(d), ACPI_PROCESSOR_CONTAINER_HID))

drivers/acpi/processor_perflib.c

Lines changed: 45 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
142142
pr = per_cpu(processors, cpu);
143143
if (!pr || !pr->performance || !pr->performance->state_count)
144144
return -ENODEV;
145+
145146
*limit = pr->performance->states[pr->performance_platform_limit].
146147
core_frequency * 1000;
147148
return 0;
@@ -201,8 +202,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
201202
}
202203

203204
pct = (union acpi_object *)buffer.pointer;
204-
if (!pct || (pct->type != ACPI_TYPE_PACKAGE)
205-
|| (pct->package.count != 2)) {
205+
if (!pct || pct->type != ACPI_TYPE_PACKAGE || pct->package.count != 2) {
206206
pr_err("Invalid _PCT data\n");
207207
result = -EFAULT;
208208
goto end;
@@ -214,9 +214,8 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
214214

215215
obj = pct->package.elements[0];
216216

217-
if ((obj.type != ACPI_TYPE_BUFFER)
218-
|| (obj.buffer.length < sizeof(struct acpi_pct_register))
219-
|| (obj.buffer.pointer == NULL)) {
217+
if (!obj.buffer.pointer || obj.type != ACPI_TYPE_BUFFER ||
218+
obj.buffer.length < sizeof(struct acpi_pct_register)) {
220219
pr_err("Invalid _PCT data (control_register)\n");
221220
result = -EFAULT;
222221
goto end;
@@ -230,9 +229,8 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
230229

231230
obj = pct->package.elements[1];
232231

233-
if ((obj.type != ACPI_TYPE_BUFFER)
234-
|| (obj.buffer.length < sizeof(struct acpi_pct_register))
235-
|| (obj.buffer.pointer == NULL)) {
232+
if (!obj.buffer.pointer || obj.type != ACPI_TYPE_BUFFER ||
233+
obj.buffer.length < sizeof(struct acpi_pct_register)) {
236234
pr_err("Invalid _PCT data (status_register)\n");
237235
result = -EFAULT;
238236
goto end;
@@ -260,8 +258,8 @@ static void amd_fixup_frequency(struct acpi_processor_px *px, int i)
260258
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
261259
return;
262260

263-
if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
264-
|| boot_cpu_data.x86 == 0x11) {
261+
if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10) ||
262+
boot_cpu_data.x86 == 0x11) {
265263
rdmsr(MSR_AMD_PSTATE_DEF_BASE + index, lo, hi);
266264
/*
267265
* MSR C001_0064+:
@@ -300,7 +298,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
300298
}
301299

302300
pss = buffer.pointer;
303-
if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {
301+
if (!pss || pss->type != ACPI_TYPE_PACKAGE) {
304302
pr_err("Invalid _PSS data\n");
305303
result = -EFAULT;
306304
goto end;
@@ -353,8 +351,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
353351
* Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq
354352
*/
355353
if (!px->core_frequency ||
356-
((u32)(px->core_frequency * 1000) !=
357-
(px->core_frequency * 1000))) {
354+
(u32)(px->core_frequency * 1000) != px->core_frequency * 1000) {
358355
pr_err(FW_BUG
359356
"Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n",
360357
pr->id, px->core_frequency);
@@ -456,50 +453,49 @@ int acpi_processor_pstate_control(void)
456453
int acpi_processor_notify_smm(struct module *calling_module)
457454
{
458455
static int is_done;
459-
int result;
456+
int result = 0;
460457

461458
if (!acpi_processor_cpufreq_init)
462459
return -EBUSY;
463460

464461
if (!try_module_get(calling_module))
465462
return -EINVAL;
466463

467-
/* is_done is set to negative if an error occurred,
468-
* and to postitive if _no_ error occurred, but SMM
469-
* was already notified. This avoids double notification
470-
* which might lead to unexpected results...
464+
/*
465+
* is_done is set to negative if an error occurs and to 1 if no error
466+
* occurrs, but SMM has been notified already. This avoids repeated
467+
* notification which might lead to unexpected results.
471468
*/
472-
if (is_done > 0) {
473-
module_put(calling_module);
474-
return 0;
475-
} else if (is_done < 0) {
476-
module_put(calling_module);
477-
return is_done;
478-
}
469+
if (is_done != 0) {
470+
if (is_done < 0)
471+
result = is_done;
479472

480-
is_done = -EIO;
473+
goto out_put;
474+
}
481475

482476
result = acpi_processor_pstate_control();
483-
if (!result) {
484-
pr_debug("No SMI port or pstate_control\n");
485-
module_put(calling_module);
486-
return 0;
487-
}
488-
if (result < 0) {
489-
module_put(calling_module);
490-
return result;
477+
if (result <= 0) {
478+
if (result) {
479+
is_done = result;
480+
} else {
481+
pr_debug("No SMI port or pstate_control\n");
482+
is_done = 1;
483+
}
484+
goto out_put;
491485
}
492486

493-
/* Success. If there's no _PPC, we need to fear nothing, so
494-
* we can allow the cpufreq driver to be rmmod'ed. */
495487
is_done = 1;
488+
/*
489+
* Success. If there _PPC, unloading the cpufreq driver would be risky,
490+
* so disallow it in that case.
491+
*/
492+
if (acpi_processor_ppc_in_use)
493+
return 0;
496494

497-
if (!acpi_processor_ppc_in_use)
498-
module_put(calling_module);
499-
500-
return 0;
495+
out_put:
496+
module_put(calling_module);
497+
return result;
501498
}
502-
503499
EXPORT_SYMBOL(acpi_processor_notify_smm);
504500

505501
int acpi_processor_get_psd(acpi_handle handle, struct acpi_psd_package *pdomain)
@@ -517,7 +513,7 @@ int acpi_processor_get_psd(acpi_handle handle, struct acpi_psd_package *pdomain)
517513
}
518514

519515
psd = buffer.pointer;
520-
if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) {
516+
if (!psd || psd->type != ACPI_TYPE_PACKAGE) {
521517
pr_err("Invalid _PSD data\n");
522518
result = -EFAULT;
523519
goto end;
@@ -532,8 +528,7 @@ int acpi_processor_get_psd(acpi_handle handle, struct acpi_psd_package *pdomain)
532528
state.length = sizeof(struct acpi_psd_package);
533529
state.pointer = pdomain;
534530

535-
status = acpi_extract_package(&(psd->package.elements[0]),
536-
&format, &state);
531+
status = acpi_extract_package(&(psd->package.elements[0]), &format, &state);
537532
if (ACPI_FAILURE(status)) {
538533
pr_err("Invalid _PSD data\n");
539534
result = -EFAULT;
@@ -716,9 +711,8 @@ int acpi_processor_preregister_performance(
716711
}
717712
EXPORT_SYMBOL(acpi_processor_preregister_performance);
718713

719-
int
720-
acpi_processor_register_performance(struct acpi_processor_performance
721-
*performance, unsigned int cpu)
714+
int acpi_processor_register_performance(struct acpi_processor_performance
715+
*performance, unsigned int cpu)
722716
{
723717
struct acpi_processor *pr;
724718

@@ -751,7 +745,6 @@ acpi_processor_register_performance(struct acpi_processor_performance
751745
mutex_unlock(&performance_mutex);
752746
return 0;
753747
}
754-
755748
EXPORT_SYMBOL(acpi_processor_register_performance);
756749

757750
void acpi_processor_unregister_performance(unsigned int cpu)
@@ -761,18 +754,15 @@ void acpi_processor_unregister_performance(unsigned int cpu)
761754
mutex_lock(&performance_mutex);
762755

763756
pr = per_cpu(processors, cpu);
764-
if (!pr) {
765-
mutex_unlock(&performance_mutex);
766-
return;
767-
}
757+
if (!pr)
758+
goto unlock;
768759

769760
if (pr->performance)
770761
kfree(pr->performance->states);
762+
771763
pr->performance = NULL;
772764

765+
unlock:
773766
mutex_unlock(&performance_mutex);
774-
775-
return;
776767
}
777-
778768
EXPORT_SYMBOL(acpi_processor_unregister_performance);

drivers/acpi/processor_throttling.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static int __acpi_processor_set_throttling(struct acpi_processor *pr,
5050

5151
static int acpi_processor_update_tsd_coord(void)
5252
{
53-
int count, count_target;
53+
int count_target;
5454
int retval = 0;
5555
unsigned int i, j;
5656
cpumask_var_t covered_cpus;
@@ -107,7 +107,6 @@ static int acpi_processor_update_tsd_coord(void)
107107

108108
/* Validate the Domain info */
109109
count_target = pdomain->num_processors;
110-
count = 1;
111110

112111
for_each_possible_cpu(j) {
113112
if (i == j)
@@ -140,7 +139,6 @@ static int acpi_processor_update_tsd_coord(void)
140139

141140
cpumask_set_cpu(j, covered_cpus);
142141
cpumask_set_cpu(j, pthrottling->shared_cpu_map);
143-
count++;
144142
}
145143
for_each_possible_cpu(j) {
146144
if (i == j)

0 commit comments

Comments
 (0)