Skip to content

Commit 8be2362

Browse files
committed
Merge branches 'acpi-extlog', 'acpi-memhotplug', 'acpi-button', 'acpi-tools' and 'acpi-pci'
* acpi-extlog: ACPI / extlog: Check for RDMSR failure * acpi-memhotplug: ACPI: memhotplug: Remove 'state' from struct acpi_memory_device * acpi-button: ACPI: button: fix handling lid state changes when input device closed * acpi-tools: tools/power/acpi: Serialize Makefile * acpi-pci: ACPI: PCI: update kernel-doc line comments
6 parents 5d2a3ca + 7cecb47 + c18483a + 21988a8 + 05c36e5 + 8e8883c commit 8be2362

5 files changed

Lines changed: 14 additions & 21 deletions

File tree

drivers/acpi/acpi_extlog.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ static int __init extlog_init(void)
222222
u64 cap;
223223
int rc;
224224

225-
rdmsrl(MSR_IA32_MCG_CAP, cap);
226-
227-
if (!(cap & MCG_ELOG_P) || !extlog_get_l1addr())
225+
if (rdmsrl_safe(MSR_IA32_MCG_CAP, &cap) ||
226+
!(cap & MCG_ELOG_P) ||
227+
!extlog_get_l1addr())
228228
return -ENODEV;
229229

230230
rc = -EINVAL;

drivers/acpi/acpi_memhotplug.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ static const struct acpi_device_id memory_device_ids[] = {
2929

3030
#ifdef CONFIG_ACPI_HOTPLUG_MEMORY
3131

32-
/* Memory Device States */
33-
#define MEMORY_INVALID_STATE 0
34-
#define MEMORY_POWER_ON_STATE 1
35-
#define MEMORY_POWER_OFF_STATE 2
36-
3732
static int acpi_memory_device_add(struct acpi_device *device,
3833
const struct acpi_device_id *not_used);
3934
static void acpi_memory_device_remove(struct acpi_device *device);
@@ -57,8 +52,7 @@ struct acpi_memory_info {
5752
};
5853

5954
struct acpi_memory_device {
60-
struct acpi_device * device;
61-
unsigned int state; /* State of the memory device */
55+
struct acpi_device *device;
6256
struct list_head res_list;
6357
};
6458

@@ -226,7 +220,6 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
226220
}
227221
if (!num_enabled) {
228222
dev_err(&mem_device->device->dev, "add_memory failed\n");
229-
mem_device->state = MEMORY_INVALID_STATE;
230223
return -EINVAL;
231224
}
232225
/*
@@ -297,9 +290,6 @@ static int acpi_memory_device_add(struct acpi_device *device,
297290
return result;
298291
}
299292

300-
/* Set the device state */
301-
mem_device->state = MEMORY_POWER_ON_STATE;
302-
303293
result = acpi_memory_check_device(mem_device);
304294
if (result) {
305295
acpi_memory_device_free(mem_device);

drivers/acpi/button.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ struct acpi_button {
153153
int last_state;
154154
ktime_t last_time;
155155
bool suspended;
156+
bool lid_state_initialized;
156157
};
157158

158159
static struct acpi_device *lid_device;
@@ -383,6 +384,8 @@ static int acpi_lid_update_state(struct acpi_device *device,
383384

384385
static void acpi_lid_initialize_state(struct acpi_device *device)
385386
{
387+
struct acpi_button *button = acpi_driver_data(device);
388+
386389
switch (lid_init_state) {
387390
case ACPI_BUTTON_LID_INIT_OPEN:
388391
(void)acpi_lid_notify_state(device, 1);
@@ -394,13 +397,14 @@ static void acpi_lid_initialize_state(struct acpi_device *device)
394397
default:
395398
break;
396399
}
400+
401+
button->lid_state_initialized = true;
397402
}
398403

399404
static void acpi_button_notify(struct acpi_device *device, u32 event)
400405
{
401406
struct acpi_button *button = acpi_driver_data(device);
402407
struct input_dev *input;
403-
int users;
404408

405409
switch (event) {
406410
case ACPI_FIXED_HARDWARE_EVENT:
@@ -409,10 +413,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
409413
case ACPI_BUTTON_NOTIFY_STATUS:
410414
input = button->input;
411415
if (button->type == ACPI_BUTTON_TYPE_LID) {
412-
mutex_lock(&button->input->mutex);
413-
users = button->input->users;
414-
mutex_unlock(&button->input->mutex);
415-
if (users)
416+
if (button->lid_state_initialized)
416417
acpi_lid_update_state(device, true);
417418
} else {
418419
int keycode;
@@ -457,7 +458,7 @@ static int acpi_button_resume(struct device *dev)
457458
struct acpi_button *button = acpi_driver_data(device);
458459

459460
button->suspended = false;
460-
if (button->type == ACPI_BUTTON_TYPE_LID && button->input->users) {
461+
if (button->type == ACPI_BUTTON_TYPE_LID) {
461462
button->last_state = !!acpi_lid_evaluate_state(device);
462463
button->last_time = ktime_get();
463464
acpi_lid_initialize_state(device);

drivers/acpi/pci_root.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static DEFINE_MUTEX(osc_lock);
6060

6161
/**
6262
* acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge
63-
* @handle - the ACPI CA node in question.
63+
* @handle: the ACPI CA node in question.
6464
*
6565
* Note: we could make this API take a struct acpi_device * instead, but
6666
* for now, it's more convenient to operate on an acpi_handle.

tools/power/acpi/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
include ../../scripts/Makefile.include
99

10+
.NOTPARALLEL:
11+
1012
all: acpidbg acpidump ec
1113
clean: acpidbg_clean acpidump_clean ec_clean
1214
install: acpidbg_install acpidump_install ec_install

0 commit comments

Comments
 (0)