History

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

Rafael J. Wysocki committed 11 months ago

Commit af47d983 parents ba9aeba a508939 e96190d8 files · +30 −11Browse files

Unified · Split

8 files
  1. drivers/acpi/ec.c +2 −1
  2. drivers/acpi/osl.c +3 −3
  3. drivers/acpi/scan.c +1 −1
  4. drivers/acpi/sleep.c +1 −1
  5. drivers/acpi/thermal.c +2 −1
  6. drivers/acpi/x86/lpss.c +1 −1
  7. drivers/pnp/driver.c +19 −0
  8. rust/kernel/acpi.rs +1 −3
drivers/acpi/ec.c+2−1
@@ -2294,7 +2294,8 @@ static int acpi_ec_init_workqueues(void) · 2293 unmodified lines
22942294 ec_wq = alloc_ordered_workqueue("kec", 0);
22952295
22962296 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);
22982299
22992300 if (!ec_wq || !ec_query_wq) {
23002301 acpi_ec_destroy_workqueues();
drivers/acpi/osl.c+3−3
@@ -398,7 +398,7 @@ static void acpi_os_drop_map_ref(struct acpi_ioremap *map) · 397 unmodified lines
398398 list_del_rcu(&map->list);
399399
400400 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);
402402 }
403403
404404 /**
@@ -1694,8 +1694,8 @@ acpi_status __init acpi_os_initialize(void) · 1289 unmodified lines
16941694
16951695 acpi_status __init acpi_os_initialize1(void)
16961696 {
1697− kacpid_wq = alloc_workqueue("kacpid", 0, 1);
1698− kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 0);
1697+ kacpid_wq = alloc_workqueue("kacpid", WQ_PERCPU, 1);
1698+ kacpi_notify_wq = alloc_workqueue("kacpi_notify", WQ_PERCPU, 0);
16991699 kacpi_hotplug_wq = alloc_ordered_workqueue("kacpi_hotplug", 0);
17001700 BUG_ON(!kacpid_wq);
17011701 BUG_ON(!kacpi_notify_wq);
drivers/acpi/scan.c+1−1
@@ -2397,7 +2397,7 @@ static bool acpi_scan_clear_dep_queue(struct acpi_device *adev) · 2396 unmodified lines
23972397 * initial enumeration of devices is complete, put it into the unbound
23982398 * workqueue.
23992399 */
2400− queue_work(system_unbound_wq, &cdw->work);
2400+ queue_work(system_dfl_wq, &cdw->work);
24012401
24022402 return true;
24032403 }
drivers/acpi/sleep.c+1−1
@@ -642,7 +642,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) · 641 unmodified lines
642642 /*
643643 * Disable all GPE and clear their status bits before interrupts are
644644 * 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.
646646 *
647647 * acpi_leave_sleep_state() will reenable specific GPEs later.
648648 *
drivers/acpi/thermal.c+2−1
@@ -1060,7 +1060,8 @@ static int __init acpi_thermal_init(void) · 1059 unmodified lines
10601060 }
10611061
10621062 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);
10641065 if (!acpi_thermal_pm_queue)
10651066 return -ENODEV;
10661067
drivers/acpi/x86/lpss.c+1−1
@@ -181,7 +181,7 @@ static void byt_i2c_setup(struct lpss_private_data *pdata) · 180 unmodified lines
181181 acpi_status status;
182182 u64 uid;
183183
184− /* Expected to always be successfull, but better safe then sorry */
184+ /* Expected to always be successful, but better safe then sorry */
185185 if (!acpi_dev_uid_to_integer(pdata->adev, &uid) && uid) {
186186 /* Detect I2C bus shared with PUNIT and ignore its d3 status */
187187 status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host);
drivers/pnp/driver.c+19−0
@@ -150,6 +150,24 @@ static void pnp_device_shutdown(struct device *dev) · 149 unmodified lines
150150 drv->shutdown(pnp_dev);
151151 }
152152
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+
153171 static int pnp_bus_match(struct device *dev, const struct device_driver *drv)
154172 {
155173 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
259277 const struct bus_type pnp_bus_type = {
260278 .name = "pnp",
261279 .match = pnp_bus_match,
280+ .uevent = pnp_uevent,
262281 .probe = pnp_device_probe,
263282 .remove = pnp_device_remove,
264283 .shutdown = pnp_device_shutdown,
rust/kernel/acpi.rs+1−3
@@ -39,9 +39,7 @@ impl DeviceId { · 38 unmodified lines
3939 pub const fn new(id: &'static CStr) -> Self {
4040 let src = id.to_bytes_with_nul();
4141 build_assert!(src.len() <= Self::ACPI_ID_LEN, "ID exceeds 16 bytes");
42− // Replace with `bindings::acpi_device_id::default()` once stabilized for `const`.
43− // SAFETY: FFI type is valid to be zero-initialized.
44− let mut acpi: bindings::acpi_device_id = unsafe { core::mem::zeroed() };
42+ let mut acpi: bindings::acpi_device_id = pin_init::zeroed();
4543 let mut i = 0;
4644 while i < src.len() {
4745 acpi.id[i] = src[i];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t