8000 Merge branches 'acpi-dock', 'acpi-ec' and 'acpi-scan' · bsd-unix/linux@e0155a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit e0155a9

Browse files
committed
Merge branches 'acpi-dock', 'acpi-ec' and 'acpi-scan'
* acpi-dock: MAINTAINERS: remove maintainship entry of docking station driver * acpi-ec: ACPI / EC: fix NULL pointer dereference in acpi_ec_remove_query_handler() * acpi-scan: ACPI / scan: Add a scan handler for PRP0001 ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline()
4 parents 2363ccb + 78b9ae3 + 6b5eab5 + 7d28435 commit e0155a9

File tree

3 files changed

+34
-13
lines changed

3 files changed

+34
-13
lines changed

MAINTAINERS

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3272,12 +3272,6 @@ F: drivers/firmware/dmi-id.c
32723272
F: drivers/firmware/dmi_scan.c
32733273
F: include/linux/dmi.h
32743274

3275-
DOCKING STATION DRIVER
3276-
M: Shaohua Li <shaohua.li@intel.com>
3277-
L: linux-acpi@vger.kernel.org
3278-
S: Supported
3279-
F: drivers/acpi/dock.c
3280-
32813275
DOCUMENTATION
32823276
M: Jonathan Corbet <corbet@lwn.net>
32833277
L: linux-doc@vger.kernel.org

drivers/acpi/ec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit)
861861
}
862862
}
863863
mutex_unlock(&ec->mutex);
864-
list_for_each_entry(handler, &free_list, node)
864+
list_for_each_entry_safe(handler, tmp, &free_list, node)
865865
acpi_ec_put_query_handler(handler);
866866
}
867867
EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler);

drivers/acpi/scan.c

Lines changed: 33 additions & 6 deletions
< 10000 td data-grid-cell-id="diff-2e56fe74396573e933ce9e084a7fb78668c1c7939f516890e542a538bf14a460-2396-2397-1" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">2397
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,11 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)
375375
struct acpi_device_physical_node *pn;
376376
bool offline = true;
377377

378-
mutex_lock(&adev->physical_node_lock);
378+
/*
379+
* acpi_container_offline() calls this for all of the container's
380+
* children under the container's physical_node_lock lock.
381+
*/
382+
mutex_lock_nested(&adev->physical_node_lock, SINGLE_DEPTH_NESTING);
379383

380384
list_for_each_entry(pn, &adev->physical_node_list, node)
381385
if (device_supports_offline(pn->dev) && !pn->dev->offline) {
@@ -2388,9 +2392,6 @@ static void acpi_default_enumeration(struct acpi_device *device)
23882392
struct list_head resource_list;
23892393
bool is_spi_i2c_slave = false;
23902394

2391-
if (!device->pnp.type.platform_id || device->handler)
2392-
return;
2393-
23942395
/*
23952396
* Do not enemerate SPI/I2C slaves as they will be enuerated by their
2396
* respective parents.
@@ -2403,6 +2404,29 @@ static void acpi_default_enumeration(struct acpi_device *device)
24032404
acpi_create_platform_device(device);
24042405
}
24052406

2407+
static const struct acpi_device_id generic_device_ids[] = {
2408+
{"PRP0001", },
2409+
{"", },
2410+
};
2411+
2412+
static int acpi_generic_device_attach(struct acpi_device *adev,
2413+
const struct acpi_device_id *not_used)
2414+
{
2415+
/*
2416+
* Since PRP0001 is the only ID handled here, the test below can be
2417+
* unconditional.
2418+
*/
2419+
if (adev->data.of_compatible)
2420+
acpi_default_enumeration(adev);
2421+
2422+
return 1;
2423+
}
2424+
2425+
static struct acpi_scan_handler generic_device_handler = {
2426+
.ids = generic_device_ids,
2427+
.attach = acpi_generic_device_attach,
2428+
};
2429+
24062430
static int acpi_scan_attach_handler(struct acpi_device *device)
24072431
{
24082432
struct acpi_hardware_id *hwid;
@@ -2428,8 +2452,6 @@ static int acpi_scan_attach_handler(struct acpi_device *device)
24282452
break;
24292453
}
24302454
}
2431-
if (!ret)
2432-
acpi_default_enumeration(device);
24332455

24342456
return ret;
24352457
}
@@ -2471,6 +2493,9 @@ static void acpi_bus_attach(struct acpi_device *device)
24712493
ret = device_attach(&device->dev);
24722494
if (ret < 0)
24732495
return;
2496+
2497+
if (!ret && device->pnp.type.platform_id)
2498+
acpi_default_enumeration(device);
24742499
}
24752500
device->flags.visited = true;
24762501

@@ -2629,6 +2654,8 @@ int __init acpi_scan_init(void)
26292654
acpi_pnp_init();
26302655
acpi_int340x_thermal_init();
26312656

2657+
acpi_scan_add_handler(&generic_device_handler);
2658+
26322659
mutex_lock(&acpi_scan_lock);
26332660
/*
26342661
* Enumerate devices in the ACPI namespace.

0 commit comments

Comments
 (0)
0