mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 11:06:41 -05:00
Merge branches 'acpi-misc' and 'pnp'
Merge miscellaneous ACPI support updates and a PNP update for 6.19-rc1: - Replace `core::mem::zeroed` with `pin_init::zeroed` in the ACPI Rust code (Siyuan Huang) - Update the ACPI code to use the new style of allocating workqueues and new global workqueues (Marco Crivellari) - Fix two spelling mistakes in the ACPI code (Chu Guangqing) - Fix ISAPNP to generate uevents to auto-load modules (René Rebe) * acpi-misc: ACPI: PM: Fix a spelling mistake ACPI: LPSS: Fix a spelling mistake ACPI: thermal: Add WQ_PERCPU to alloc_workqueue() users ACPI: OSL: Add WQ_PERCPU to alloc_workqueue() users ACPI: EC: Add WQ_PERCPU to alloc_workqueue() users ACPI: OSL: replace use of system_wq with system_percpu_wq ACPI: scan: replace use of system_unbound_wq with system_dfl_wq rust: acpi: replace `core::mem::zeroed` with `pin_init::zeroed` * pnp: PNP: Fix ISAPNP to generate uevents to auto-load modules
This commit is contained in:
@@ -2294,7 +2294,8 @@ static int acpi_ec_init_workqueues(void)
|
||||
ec_wq = alloc_ordered_workqueue("kec", 0);
|
||||
|
||||
if (!ec_query_wq)
|
||||
ec_query_wq = alloc_workqueue("kec_query", 0, ec_max_queries);
|
||||
ec_query_wq = alloc_workqueue("kec_query", WQ_PERCPU,
|
||||
ec_max_queries);
|
||||
|
||||
if (!ec_wq || !ec_query_wq) {
|
||||
acpi_ec_destroy_workqueues();
|
||||
|
||||
@@ -398,7 +398,7 @@ static void acpi_os_drop_map_ref(struct acpi_ioremap *map)
|
||||
list_del_rcu(&map->list);
|
||||
|
||||
INIT_RCU_WORK(&map->track.rwork, acpi_os_map_remove);
|
||||
queue_rcu_work(system_wq, &map->track.rwork);
|
||||
queue_rcu_work(system_percpu_wq, &map->track.rwork);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1694,8 +1694,8 @@ acpi_status __init acpi_os_initialize(void)
|
||||
|
||||
acpi_status __init acpi_os_initialize1(void)
|
||||
{
|
||||
kacpid_wq = alloc_workqueue("kacpid", 0, 1);
|
||||
kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 0);
|
||||
kacpid_wq = alloc_workqueue("kacpid", WQ_PERCPU, 1);
|
||||
kacpi_notify_wq = alloc_workqueue("kacpi_notify", WQ_PERCPU, 0);
|
||||
kacpi_hotplug_wq = alloc_ordered_workqueue("kacpi_hotplug", 0);
|
||||
BUG_ON(!kacpid_wq);
|
||||
BUG_ON(!kacpi_notify_wq);
|
||||
|
||||
@@ -2397,7 +2397,7 @@ static bool acpi_scan_clear_dep_queue(struct acpi_device *adev)
|
||||
* initial enumeration of devices is complete, put it into the unbound
|
||||
* workqueue.
|
||||
*/
|
||||
queue_work(system_unbound_wq, &cdw->work);
|
||||
queue_work(system_dfl_wq, &cdw->work);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -642,7 +642,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
|
||||
/*
|
||||
* Disable all GPE and clear their status bits before interrupts are
|
||||
* enabled. Some GPEs (like wakeup GPEs) have no handlers and this can
|
||||
* prevent them from producing spurious interrups.
|
||||
* prevent them from producing spurious interrupts.
|
||||
*
|
||||
* acpi_leave_sleep_state() will reenable specific GPEs later.
|
||||
*
|
||||
|
||||
@@ -1060,7 +1060,8 @@ static int __init acpi_thermal_init(void)
|
||||
}
|
||||
|
||||
acpi_thermal_pm_queue = alloc_workqueue("acpi_thermal_pm",
|
||||
WQ_HIGHPRI | WQ_MEM_RECLAIM, 0);
|
||||
WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_PERCPU,
|
||||
0);
|
||||
if (!acpi_thermal_pm_queue)
|
||||
return -ENODEV;
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ static void byt_i2c_setup(struct lpss_private_data *pdata)
|
||||
acpi_status status;
|
||||
u64 uid;
|
||||
|
||||
/* Expected to always be successfull, but better safe then sorry */
|
||||
/* Expected to always be successful, but better safe then sorry */
|
||||
if (!acpi_dev_uid_to_integer(pdata->adev, &uid) && uid) {
|
||||
/* Detect I2C bus shared with PUNIT and ignore its d3 status */
|
||||
status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host);
|
||||
|
||||
@@ -150,6 +150,24 @@ static void pnp_device_shutdown(struct device *dev)
|
||||
drv->shutdown(pnp_dev);
|
||||
}
|
||||
|
||||
static int pnp_uevent(const struct device *dev, struct kobj_uevent_env *env)
|
||||
{
|
||||
struct pnp_id *pos;
|
||||
const struct pnp_dev *pnp_dev = to_pnp_dev(dev);
|
||||
|
||||
if (!dev)
|
||||
return -ENODEV;
|
||||
|
||||
pos = pnp_dev->id;
|
||||
while (pos) {
|
||||
if (add_uevent_var(env, "MODALIAS=pnp:d%s", pos->id))
|
||||
return -ENOMEM;
|
||||
pos = pos->next;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pnp_bus_match(struct device *dev, const struct device_driver *drv)
|
||||
{
|
||||
struct pnp_dev *pnp_dev = to_pnp_dev(dev);
|
||||
@@ -259,6 +277,7 @@ static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
|
||||
const struct bus_type pnp_bus_type = {
|
||||
.name = "pnp",
|
||||
.match = pnp_bus_match,
|
||||
.uevent = pnp_uevent,
|
||||
.probe = pnp_device_probe,
|
||||
.remove = pnp_device_remove,
|
||||
.shutdown = pnp_device_shutdown,
|
||||
|
||||
@@ -39,9 +39,7 @@ impl DeviceId {
|
||||
pub const fn new(id: &'static CStr) -> Self {
|
||||
let src = id.to_bytes_with_nul();
|
||||
build_assert!(src.len() <= Self::ACPI_ID_LEN, "ID exceeds 16 bytes");
|
||||
// Replace with `bindings::acpi_device_id::default()` once stabilized for `const`.
|
||||
// SAFETY: FFI type is valid to be zero-initialized.
|
||||
let mut acpi: bindings::acpi_device_id = unsafe { core::mem::zeroed() };
|
||||
let mut acpi: bindings::acpi_device_id = pin_init::zeroed();
|
||||
let mut i = 0;
|
||||
while i < src.len() {
|
||||
acpi.id[i] = src[i];
|
||||
|
||||
Reference in New Issue
Block a user