Skip to content

Commit 9175145

Browse files
committed
Merge branches 'acpi-scan', 'acpi-tables', 'acpi-misc' and 'acpi-pm'
* acpi-scan: ACPI / scan: Add labels for PNP button devices ACPI / scan: Simplify acpi_bus_extract_wakeup_device_power_package() * acpi-tables: ACPI / tables: Clean up whitespace * acpi-misc: ACPI / DPTF: Use dev_get_drvdata() ACPI: event: replace strcpy() by strscpy() ACPI: Fix comment typos * acpi-pm: ACPI: PM: Print debug messages when enabling GPEs for wakeup
5 parents 317e2ca + 5ceb5f0 + 2e018c5 + b0f65b9 + fbc9418 commit 9175145

File tree

12 files changed

+66
-75
lines changed

12 files changed

+66
-75
lines changed

drivers/acpi/acpi_dbg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static ssize_t acpi_aml_read_cmd(char *msg, size_t count)
390390
return size > 0 ? size : ret;
391391
}
392392

393-
static int acpi_aml_thread(void *unsed)
393+
static int acpi_aml_thread(void *unused)
394394
{
395395
acpi_osd_exec_callback function = NULL;
396396
void *context;

drivers/acpi/acpi_lpat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* LPAT conversion table
2323
*
2424
* @lpat_table: the temperature_raw mapping table structure
25-
* @raw: the raw value, used as a key to get the temerature from the
25+
* @raw: the raw value, used as a key to get the temperature from the
2626
* above mapping table
2727
*
2828
* A positive converted temperature value will be returned on success,

drivers/acpi/cppc_acpi.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ struct cppc_pcc_data {
8181
int refcount;
8282
};
8383

84-
/* Array to represent the PCC channel per subspace id */
84+
/* Array to represent the PCC channel per subspace ID */
8585
static struct cppc_pcc_data *pcc_data[MAX_PCC_SUBSPACES];
86-
/* The cpu_pcc_subspace_idx containsper CPU subspace id */
86+
/* The cpu_pcc_subspace_idx contains per CPU subspace ID */
8787
static DEFINE_PER_CPU(int, cpu_pcc_subspace_idx);
8888

8989
/*
@@ -436,7 +436,7 @@ int acpi_get_psd_map(struct cppc_cpudata **all_cpu_data)
436436
return -ENOMEM;
437437

438438
/*
439-
* Now that we have _PSD data from all CPUs, lets setup P-state
439+
* Now that we have _PSD data from all CPUs, let's setup P-state
440440
* domain info.
441441
*/
442442
for_each_possible_cpu(i) {
@@ -588,7 +588,7 @@ static int register_pcc_channel(int pcc_ss_idx)
588588
return -ENOMEM;
589589
}
590590

591-
/* Set flag so that we dont come here for each CPU. */
591+
/* Set flag so that we don't come here for each CPU. */
592592
pcc_data[pcc_ss_idx]->pcc_channel_acquired = true;
593593
}
594594

@@ -613,7 +613,7 @@ bool __weak cpc_ffh_supported(void)
613613
*
614614
* Check and allocate the cppc_pcc_data memory.
615615
* In some processor configurations it is possible that same subspace
616-
* is shared between multiple CPU's. This is seen especially in CPU's
616+
* is shared between multiple CPUs. This is seen especially in CPUs
617617
* with hardware multi-threading support.
618618
*
619619
* Return: 0 for success, errno for failure
@@ -711,7 +711,7 @@ static bool is_cppc_supported(int revision, int num_ent)
711711

712712
/**
713713
* acpi_cppc_processor_probe - Search for per CPU _CPC objects.
714-
* @pr: Ptr to acpi_processor containing this CPUs logical Id.
714+
* @pr: Ptr to acpi_processor containing this CPU's logical ID.
715715
*
716716
* Return: 0 for success or negative value for err.
717717
*/
@@ -728,7 +728,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
728728
acpi_status status;
729729
int ret = -EFAULT;
730730

731-
/* Parse the ACPI _CPC table for this cpu. */
731+
/* Parse the ACPI _CPC table for this CPU. */
732732
status = acpi_evaluate_object_typed(handle, "_CPC", NULL, &output,
733733
ACPI_TYPE_PACKAGE);
734734
if (ACPI_FAILURE(status)) {
@@ -840,7 +840,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
840840
if (ret)
841841
goto out_free;
842842

843-
/* Register PCC channel once for all PCC subspace id. */
843+
/* Register PCC channel once for all PCC subspace ID. */
844844
if (pcc_subspace_id >= 0 && !pcc_data[pcc_subspace_id]->pcc_channel_acquired) {
845845
ret = register_pcc_channel(pcc_subspace_id);
846846
if (ret)
@@ -860,7 +860,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
860860
goto out_free;
861861
}
862862

863-
/* Plug PSD data into this CPUs CPC descriptor. */
863+
/* Plug PSD data into this CPU's CPC descriptor. */
864864
per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr;
865865

866866
ret = kobject_init_and_add(&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj,
@@ -891,7 +891,7 @@ EXPORT_SYMBOL_GPL(acpi_cppc_processor_probe);
891891

892892
/**
893893
* acpi_cppc_processor_exit - Cleanup CPC structs.
894-
* @pr: Ptr to acpi_processor containing this CPUs logical Id.
894+
* @pr: Ptr to acpi_processor containing this CPU's logical ID.
895895
*
896896
* Return: Void
897897
*/
@@ -931,7 +931,7 @@ EXPORT_SYMBOL_GPL(acpi_cppc_processor_exit);
931931

932932
/**
933933
* cpc_read_ffh() - Read FFH register
934-
* @cpunum: cpu number to read
934+
* @cpunum: CPU number to read
935935
* @reg: cppc register information
936936
* @val: place holder for return value
937937
*
@@ -946,7 +946,7 @@ int __weak cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val)
946946

947947
/**
948948
* cpc_write_ffh() - Write FFH register
949-
* @cpunum: cpu number to write
949+
* @cpunum: CPU number to write
950950
* @reg: cppc register information
951951
* @val: value to write
952952
*
@@ -1093,7 +1093,7 @@ int cppc_get_desired_perf(int cpunum, u64 *desired_perf)
10931093
EXPORT_SYMBOL_GPL(cppc_get_desired_perf);
10941094

10951095
/**
1096-
* cppc_get_perf_caps - Get a CPUs performance capabilities.
1096+
* cppc_get_perf_caps - Get a CPU's performance capabilities.
10971097
* @cpunum: CPU from which to get capabilities info.
10981098
* @perf_caps: ptr to cppc_perf_caps. See cppc_acpi.h
10991099
*
@@ -1183,7 +1183,7 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps)
11831183
EXPORT_SYMBOL_GPL(cppc_get_perf_caps);
11841184

11851185
/**
1186-
* cppc_get_perf_ctrs - Read a CPUs performance feedback counters.
1186+
* cppc_get_perf_ctrs - Read a CPU's performance feedback counters.
11871187
* @cpunum: CPU from which to read counters.
11881188
* @perf_fb_ctrs: ptr to cppc_perf_fb_ctrs. See cppc_acpi.h
11891189
*
@@ -1210,7 +1210,7 @@ int cppc_get_perf_ctrs(int cpunum, struct cppc_perf_fb_ctrs *perf_fb_ctrs)
12101210
ctr_wrap_reg = &cpc_desc->cpc_regs[CTR_WRAP_TIME];
12111211

12121212
/*
1213-
* If refernce perf register is not supported then we should
1213+
* If reference perf register is not supported then we should
12141214
* use the nominal perf value
12151215
*/
12161216
if (!CPC_SUPPORTED(ref_perf_reg))
@@ -1263,7 +1263,7 @@ int cppc_get_perf_ctrs(int cpunum, struct cppc_perf_fb_ctrs *perf_fb_ctrs)
12631263
EXPORT_SYMBOL_GPL(cppc_get_perf_ctrs);
12641264

12651265
/**
1266-
* cppc_set_perf - Set a CPUs performance controls.
1266+
* cppc_set_perf - Set a CPU's performance controls.
12671267
* @cpu: CPU for which to set performance controls.
12681268
* @perf_ctrls: ptr to cppc_perf_ctrls. See cppc_acpi.h
12691269
*
@@ -1344,7 +1344,7 @@ int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
13441344
* executing the Phase-II.
13451345
* 2. Some other CPU has beaten this CPU to successfully execute the
13461346
* write_trylock and has already acquired the write_lock. We know for a
1347-
* fact it(other CPU acquiring the write_lock) couldn't have happened
1347+
* fact it (other CPU acquiring the write_lock) couldn't have happened
13481348
* before this CPU's Phase-I as we held the read_lock.
13491349
* 3. Some other CPU executing pcc CMD_READ has stolen the
13501350
* down_write, in which case, send_pcc_cmd will check for pending

drivers/acpi/device_pm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,9 @@ static int __acpi_device_wakeup_enable(struct acpi_device *adev,
728728
goto out;
729729
}
730730

731+
acpi_handle_debug(adev->handle, "GPE%2X enabled for wakeup\n",
732+
(unsigned int)wakeup->gpe_number);
733+
731734
inc:
732735
wakeup->enable_count++;
733736

drivers/acpi/dptf/dptf_power.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ static ssize_t name##_show(struct device *dev,\
3131
struct device_attribute *attr,\
3232
char *buf)\
3333
{\
34-
struct platform_device *pdev = to_platform_device(dev);\
35-
struct acpi_device *acpi_dev = platform_get_drvdata(pdev);\
34+
struct acpi_device *acpi_dev = dev_get_drvdata(dev);\
3635
unsigned long long val;\
3736
acpi_status status;\
3837
\

drivers/acpi/event.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ int acpi_bus_generate_netlink_event(const char *device_class,
131131
event = nla_data(attr);
132132
memset(event, 0, sizeof(struct acpi_genl_event));
133133

134-
strcpy(event->device_class, device_class);
135-
strcpy(event->bus_id, bus_id);
134+
strscpy(event->device_class, device_class, sizeof(event->device_class));
135+
strscpy(event->bus_id, bus_id, sizeof(event->bus_id));
136136
event->type = type;
137137
event->data = data;
138138

drivers/acpi/power.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,12 +535,12 @@ int acpi_device_sleep_wake(struct acpi_device *dev,
535535
/*
536536
* Try to execute _DSW first.
537537
*
538-
* Three agruments are needed for the _DSW object:
538+
* Three arguments are needed for the _DSW object:
539539
* Argument 0: enable/disable the wake capabilities
540540
* Argument 1: target system state
541541
* Argument 2: target device state
542542
* When _DSW object is called to disable the wake capabilities, maybe
543-
* the first argument is filled. The values of the other two agruments
543+
* the first argument is filled. The values of the other two arguments
544544
* are meaningless.
545545
*/
546546
in_arg[0].type = ACPI_TYPE_INTEGER;

drivers/acpi/pptt.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static struct acpi_pptt_cache *acpi_find_cache_level(struct acpi_table_header *t
164164
}
165165

166166
/**
167-
* acpi_count_levels() - Given a PPTT table, and a cpu node, count the caches
167+
* acpi_count_levels() - Given a PPTT table, and a CPU node, count the caches
168168
* @table_hdr: Pointer to the head of the PPTT table
169169
* @cpu_node: processor node we wish to count caches for
170170
*
@@ -235,7 +235,7 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr,
235235
/**
236236
* acpi_find_processor_node() - Given a PPTT table find the requested processor
237237
* @table_hdr: Pointer to the head of the PPTT table
238-
* @acpi_cpu_id: cpu we are searching for
238+
* @acpi_cpu_id: CPU we are searching for
239239
*
240240
* Find the subtable entry describing the provided processor.
241241
* This is done by iterating the PPTT table looking for processor nodes
@@ -456,21 +456,21 @@ static struct acpi_pptt_processor *acpi_find_processor_package_id(struct acpi_ta
456456

457457
static void acpi_pptt_warn_missing(void)
458458
{
459-
pr_warn_once("No PPTT table found, cpu and cache topology may be inaccurate\n");
459+
pr_warn_once("No PPTT table found, CPU and cache topology may be inaccurate\n");
460460
}
461461

462462
/**
463463
* topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
464464
* @table: Pointer to the head of the PPTT table
465-
* @cpu: Kernel logical cpu number
465+
* @cpu: Kernel logical CPU number
466466
* @level: A level that terminates the search
467467
* @flag: A flag which terminates the search
468468
*
469-
* Get a unique value given a cpu, and a topology level, that can be
469+
* Get a unique value given a CPU, and a topology level, that can be
470470
* matched to determine which cpus share common topological features
471471
* at that level.
472472
*
473-
* Return: Unique value, or -ENOENT if unable to locate cpu
473+
* Return: Unique value, or -ENOENT if unable to locate CPU
474474
*/
475475
static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
476476
unsigned int cpu, int level, int flag)
@@ -510,7 +510,7 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag)
510510
return -ENOENT;
511511
}
512512
retval = topology_get_acpi_cpu_tag(table, cpu, level, flag);
513-
pr_debug("Topology Setup ACPI cpu %d, level %d ret = %d\n",
513+
pr_debug("Topology Setup ACPI CPU %d, level %d ret = %d\n",
514514
cpu, level, retval);
515515
acpi_put_table(table);
516516

@@ -519,9 +519,9 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag)
519519

520520
/**
521521
* acpi_find_last_cache_level() - Determines the number of cache levels for a PE
522-
* @cpu: Kernel logical cpu number
522+
* @cpu: Kernel logical CPU number
523523
*
524-
* Given a logical cpu number, returns the number of levels of cache represented
524+
* Given a logical CPU number, returns the number of levels of cache represented
525525
* in the PPTT. Errors caused by lack of a PPTT table, or otherwise, return 0
526526
* indicating we didn't find any cache levels.
527527
*
@@ -534,7 +534,7 @@ int acpi_find_last_cache_level(unsigned int cpu)
534534
int number_of_levels = 0;
535535
acpi_status status;
536536

537-
pr_debug("Cache Setup find last level cpu=%d\n", cpu);
537+
pr_debug("Cache Setup find last level CPU=%d\n", cpu);
538538

539539
acpi_cpu_id = get_acpi_id_for_cpu(cpu);
540540
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
@@ -551,14 +551,14 @@ int acpi_find_last_cache_level(unsigned int cpu)
551551

552552
/**
553553
* cache_setup_acpi() - Override CPU cache topology with data from the PPTT
554-
* @cpu: Kernel logical cpu number
554+
* @cpu: Kernel logical CPU number
555555
*
556556
* Updates the global cache info provided by cpu_get_cacheinfo()
557557
* when there are valid properties in the acpi_pptt_cache nodes. A
558558
* successful parse may not result in any updates if none of the
559-
* cache levels have any valid flags set. Futher, a unique value is
559+
* cache levels have any valid flags set. Further, a unique value is
560560
* associated with each known CPU cache entry. This unique value
561-
* can be used to determine whether caches are shared between cpus.
561+
* can be used to determine whether caches are shared between CPUs.
562562
*
563563
* Return: -ENOENT on failure to find table, or 0 on success
564564
*/
@@ -567,7 +567,7 @@ int cache_setup_acpi(unsigned int cpu)
567567
struct acpi_table_header *table;
568568
acpi_status status;
569569

570-
pr_debug("Cache Setup ACPI cpu %d\n", cpu);
570+
pr_debug("Cache Setup ACPI CPU %d\n", cpu);
571571

572572
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
573573
if (ACPI_FAILURE(status)) {
@@ -582,8 +582,8 @@ int cache_setup_acpi(unsigned int cpu)
582582
}
583583

584584
/**
585-
* find_acpi_cpu_topology() - Determine a unique topology value for a given cpu
586-
* @cpu: Kernel logical cpu number
585+
* find_acpi_cpu_topology() - Determine a unique topology value for a given CPU
586+
* @cpu: Kernel logical CPU number
587587
* @level: The topological level for which we would like a unique ID
588588
*
589589
* Determine a topology unique ID for each thread/core/cluster/mc_grouping
@@ -596,7 +596,7 @@ int cache_setup_acpi(unsigned int cpu)
596596
* other levels beyond this use a generated value to uniquely identify
597597
* a topological feature.
598598
*
599-
* Return: -ENOENT if the PPTT doesn't exist, or the cpu cannot be found.
599+
* Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found.
600600
* Otherwise returns a value which represents a unique topological feature.
601601
*/
602602
int find_acpi_cpu_topology(unsigned int cpu, int level)
@@ -606,12 +606,12 @@ int find_acpi_cpu_topology(unsigned int cpu, int level)
606606

607607
/**
608608
* find_acpi_cpu_cache_topology() - Determine a unique cache topology value
609-
* @cpu: Kernel logical cpu number
609+
* @cpu: Kernel logical CPU number
610610
* @level: The cache level for which we would like a unique ID
611611
*
612612
* Determine a unique ID for each unified cache in the system
613613
*
614-
* Return: -ENOENT if the PPTT doesn't exist, or the cpu cannot be found.
614+
* Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found.
615615
* Otherwise returns a value which represents a unique topological feature.
616616
*/
617617
int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
@@ -643,17 +643,17 @@ int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
643643

644644

645645
/**
646-
* find_acpi_cpu_topology_package() - Determine a unique cpu package value
647-
* @cpu: Kernel logical cpu number
646+
* find_acpi_cpu_topology_package() - Determine a unique CPU package value
647+
* @cpu: Kernel logical CPU number
648648
*
649-
* Determine a topology unique package ID for the given cpu.
649+
* Determine a topology unique package ID for the given CPU.
650650
* This ID can then be used to group peers, which will have matching ids.
651651
*
652652
* The search terminates when either a level is found with the PHYSICAL_PACKAGE
653653
* flag set or we reach a root node.
654654
*
655-
* Return: -ENOENT if the PPTT doesn't exist, or the cpu cannot be found.
656-
* Otherwise returns a value which represents the package for this cpu.
655+
* Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found.
656+
* Otherwise returns a value which represents the package for this CPU.
657657
*/
658658
int find_acpi_cpu_topology_package(unsigned int cpu)
659659
{

0 commit comments

Comments
 (0)