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
Unified · Split
| @@ -2294,7 +2294,8 @@ static int acpi_ec_init_workqueues(void) · 2293 unmodified lines | |||
| 2294 | ec_wq = alloc_ordered_workqueue("kec", 0); | 2294 | ec_wq = alloc_ordered_workqueue("kec", 0); |
| 2295 | 2295 | ||
| 2296 | if (!ec_query_wq) | 2296 | if (!ec_query_wq) |
| 2297 | ec_query_wq = alloc_workqueue("kec_query", 0, ec_max_queries); | 2297 | ec_query_wq = alloc_workqueue("kec_query", WQ_PERCPU, |
| 2298 | ec_max_queries); | ||
| 2298 | 2299 | ||
| 2299 | if (!ec_wq || !ec_query_wq) { | 2300 | if (!ec_wq || !ec_query_wq) { |
| 2300 | acpi_ec_destroy_workqueues(); | 2301 | acpi_ec_destroy_workqueues(); |
| @@ -398,7 +398,7 @@ static void acpi_os_drop_map_ref(struct acpi_ioremap *map) · 397 unmodified lines | |||
| 398 | list_del_rcu(&map->list); | 398 | list_del_rcu(&map->list); |
| 399 | 399 | ||
| 400 | INIT_RCU_WORK(&map->track.rwork, acpi_os_map_remove); | 400 | INIT_RCU_WORK(&map->track.rwork, acpi_os_map_remove); |
| 401 | queue_rcu_work(system_wq, &map->track.rwork); | 401 | queue_rcu_work(system_percpu_wq, &map->track.rwork); |
| 402 | } | 402 | } |
| 403 | 403 | ||
| 404 | /** | 404 | /** |
| @@ -1694,8 +1694,8 @@ acpi_status __init acpi_os_initialize(void) · 1289 unmodified lines | |||
| 1694 | 1694 | ||
| 1695 | acpi_status __init acpi_os_initialize1(void) | 1695 | acpi_status __init acpi_os_initialize1(void) |
| 1696 | { | 1696 | { |
| 1697 | kacpid_wq = alloc_workqueue("kacpid", 0, 1); | 1697 | kacpid_wq = alloc_workqueue("kacpid", WQ_PERCPU, 1); |
| 1698 | kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 0); | 1698 | kacpi_notify_wq = alloc_workqueue("kacpi_notify", WQ_PERCPU, 0); |
| 1699 | kacpi_hotplug_wq = alloc_ordered_workqueue("kacpi_hotplug", 0); | 1699 | kacpi_hotplug_wq = alloc_ordered_workqueue("kacpi_hotplug", 0); |
| 1700 | BUG_ON(!kacpid_wq); | 1700 | BUG_ON(!kacpid_wq); |
| 1701 | BUG_ON(!kacpi_notify_wq); | 1701 | BUG_ON(!kacpi_notify_wq); |
| @@ -2397,7 +2397,7 @@ static bool acpi_scan_clear_dep_queue(struct acpi_device *adev) · 2396 unmodified lines | |||
| 2397 | * initial enumeration of devices is complete, put it into the unbound | 2397 | * initial enumeration of devices is complete, put it into the unbound |
| 2398 | * workqueue. | 2398 | * workqueue. |
| 2399 | */ | 2399 | */ |
| 2400 | queue_work(system_unbound_wq, &cdw->work); | 2400 | queue_work(system_dfl_wq, &cdw->work); |
| 2401 | 2401 | ||
| 2402 | return true; | 2402 | return true; |
| 2403 | } | 2403 | } |
| @@ -642,7 +642,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) · 641 unmodified lines | |||
| 642 | /* | 642 | /* |
| 643 | * Disable all GPE and clear their status bits before interrupts are | 643 | * Disable all GPE and clear their status bits before interrupts are |
| 644 | * enabled. Some GPEs (like wakeup GPEs) have no handlers and this can | 644 | * enabled. Some GPEs (like wakeup GPEs) have no handlers and this can |
| 645 | * prevent them from producing spurious interrups. | 645 | * prevent them from producing spurious interrupts. |
| 646 | * | 646 | * |
| 647 | * acpi_leave_sleep_state() will reenable specific GPEs later. | 647 | * acpi_leave_sleep_state() will reenable specific GPEs later. |
| 648 | * | 648 | * |
| @@ -1060,7 +1060,8 @@ static int __init acpi_thermal_init(void) · 1059 unmodified lines | |||
| 1060 | } | 1060 | } |
| 1061 | 1061 | ||
| 1062 | acpi_thermal_pm_queue = alloc_workqueue("acpi_thermal_pm", | 1062 | acpi_thermal_pm_queue = alloc_workqueue("acpi_thermal_pm", |
| 1063 | WQ_HIGHPRI | WQ_MEM_RECLAIM, 0); | 1063 | WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_PERCPU, |
| 1064 | 0); | ||
| 1064 | if (!acpi_thermal_pm_queue) | 1065 | if (!acpi_thermal_pm_queue) |
| 1065 | return -ENODEV; | 1066 | return -ENODEV; |
| 1066 | 1067 | ||
| @@ -181,7 +181,7 @@ static void byt_i2c_setup(struct lpss_private_data *pdata) · 180 unmodified lines | |||
| 181 | acpi_status status; | 181 | acpi_status status; |
| 182 | u64 uid; | 182 | u64 uid; |
| 183 | 183 | ||
| 184 | /* Expected to always be successfull, but better safe then sorry */ | 184 | /* Expected to always be successful, but better safe then sorry */ |
| 185 | if (!acpi_dev_uid_to_integer(pdata->adev, &uid) && uid) { | 185 | if (!acpi_dev_uid_to_integer(pdata->adev, &uid) && uid) { |
| 186 | /* Detect I2C bus shared with PUNIT and ignore its d3 status */ | 186 | /* Detect I2C bus shared with PUNIT and ignore its d3 status */ |
| 187 | status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host); | 187 | status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host); |
| @@ -150,6 +150,24 @@ static void pnp_device_shutdown(struct device *dev) · 149 unmodified lines | |||
| 150 | drv->shutdown(pnp_dev); | 150 | drv->shutdown(pnp_dev); |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | static int pnp_uevent(const struct device *dev, struct kobj_uevent_env *env) | ||
| 154 | { | ||
| 155 | struct pnp_id *pos; | ||
| 156 | const struct pnp_dev *pnp_dev = to_pnp_dev(dev); | ||
| 157 | |||
| 158 | if (!dev) | ||
| 159 | return -ENODEV; | ||
| 160 | |||
| 161 | pos = pnp_dev->id; | ||
| 162 | while (pos) { | ||
| 163 | if (add_uevent_var(env, "MODALIAS=pnp:d%s", pos->id)) | ||
| 164 | return -ENOMEM; | ||
| 165 | pos = pos->next; | ||
| 166 | } | ||
| 167 | |||
| 168 | return 0; | ||
| 169 | } | ||
| 170 | |||
| 153 | static int pnp_bus_match(struct device *dev, const struct device_driver *drv) | 171 | static int pnp_bus_match(struct device *dev, const struct device_driver *drv) |
| 154 | { | 172 | { |
| 155 | struct pnp_dev *pnp_dev = to_pnp_dev(dev); | 173 | struct pnp_dev *pnp_dev = to_pnp_dev(dev); |
| @@ -259,6 +277,7 @@ static const struct dev_pm_ops pnp_bus_dev_pm_ops = { · 103 unmodified lines | |||
| 259 | const struct bus_type pnp_bus_type = { | 277 | const struct bus_type pnp_bus_type = { |
| 260 | .name = "pnp", | 278 | .name = "pnp", |
| 261 | .match = pnp_bus_match, | 279 | .match = pnp_bus_match, |
| 280 | .uevent = pnp_uevent, | ||
| 262 | .probe = pnp_device_probe, | 281 | .probe = pnp_device_probe, |
| 263 | .remove = pnp_device_remove, | 282 | .remove = pnp_device_remove, |
| 264 | .shutdown = pnp_device_shutdown, | 283 | .shutdown = pnp_device_shutdown, |
| @@ -39,9 +39,7 @@ impl DeviceId { · 38 unmodified lines | |||
| 39 | pub const fn new(id: &'static CStr) -> Self { | 39 | pub const fn new(id: &'static CStr) -> Self { |
| 40 | let src = id.to_bytes_with_nul(); | 40 | let src = id.to_bytes_with_nul(); |
| 41 | build_assert!(src.len() <= Self::ACPI_ID_LEN, "ID exceeds 16 bytes"); | 41 | build_assert!(src.len() <= Self::ACPI_ID_LEN, "ID exceeds 16 bytes"); |
| 42 | // Replace with `bindings::acpi_device_id::default()` once stabilized for `const`. | 42 | let mut acpi: bindings::acpi_device_id = pin_init::zeroed(); |
| 43 | // SAFETY: FFI type is valid to be zero-initialized. | ||
| 44 | let mut acpi: bindings::acpi_device_id = unsafe { core::mem::zeroed() }; | ||
| 45 | let mut i = 0; | 43 | let mut i = 0; |
| 46 | while i < src.len() { | 44 | while i < src.len() { |
| 47 | acpi.id[i] = src[i]; | 45 | acpi.id[i] = src[i]; |