Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: psmouse - remove dedicated kpsmoused workqueue

The only user of psmouse_queue_work() and therefore kpsmoused workqueue
is psmouse-base itself, when it tries to schedule the resync work. Since
resyncing is not going to race with itself we no longer need the
dedicated ordered workqueue.

Remove it and switch to using regular (non-delayed) work structure
scheduled on the default workqueue.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+7 -27
+6 -24
drivers/input/mouse/psmouse-base.c
··· 113 113 */ 114 114 static DEFINE_MUTEX(psmouse_mutex); 115 115 116 - static struct workqueue_struct *kpsmoused_wq; 117 - 118 116 struct psmouse *psmouse_from_serio(struct serio *serio) 119 117 { 120 118 struct ps2dev *ps2dev = serio_get_drvdata(serio); ··· 236 238 input_sync(dev); 237 239 238 240 return PSMOUSE_FULL_PACKET; 239 - } 240 - 241 - void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work, 242 - unsigned long delay) 243 - { 244 - queue_delayed_work(kpsmoused_wq, work, delay); 245 241 } 246 242 247 243 /* ··· 371 379 psmouse->name, psmouse->phys, psmouse->pktcnt); 372 380 psmouse->badbyte = psmouse->packet[0]; 373 381 __psmouse_set_state(psmouse, PSMOUSE_RESYNCING); 374 - psmouse_queue_work(psmouse, &psmouse->resync_work, 0); 382 + schedule_work(&psmouse->resync_work); 375 383 return; 376 384 } 377 385 ··· 407 415 time_after(jiffies, psmouse->last + psmouse->resync_time * HZ)) { 408 416 psmouse->badbyte = psmouse->packet[0]; 409 417 __psmouse_set_state(psmouse, PSMOUSE_RESYNCING); 410 - psmouse_queue_work(psmouse, &psmouse->resync_work, 0); 418 + schedule_work(&psmouse->resync_work); 411 419 return; 412 420 } 413 421 ··· 1305 1313 static void psmouse_resync(struct work_struct *work) 1306 1314 { 1307 1315 struct psmouse *parent = NULL, *psmouse = 1308 - container_of(work, struct psmouse, resync_work.work); 1316 + container_of(work, struct psmouse, resync_work); 1309 1317 struct serio *serio = psmouse->ps2dev.serio; 1310 1318 psmouse_ret_t rc = PSMOUSE_GOOD_DATA; 1311 1319 bool failed = false, enabled = false; ··· 1458 1466 1459 1467 /* make sure we don't have a resync in progress */ 1460 1468 mutex_unlock(&psmouse_mutex); 1461 - disable_delayed_work_sync(&psmouse->resync_work); 1469 + disable_work_sync(&psmouse->resync_work); 1462 1470 mutex_lock(&psmouse_mutex); 1463 1471 1464 1472 if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) { ··· 1572 1580 1573 1581 ps2_init(&psmouse->ps2dev, serio, 1574 1582 psmouse_pre_receive_byte, psmouse_receive_byte); 1575 - INIT_DELAYED_WORK(&psmouse->resync_work, psmouse_resync); 1583 + INIT_WORK(&psmouse->resync_work, psmouse_resync); 1576 1584 psmouse->dev = input_dev; 1577 1585 scnprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys); 1578 1586 ··· 2014 2022 if (err) 2015 2023 return err; 2016 2024 2017 - kpsmoused_wq = alloc_ordered_workqueue("kpsmoused", 0); 2018 - if (!kpsmoused_wq) { 2019 - pr_err("failed to create kpsmoused workqueue\n"); 2020 - err = -ENOMEM; 2021 - goto err_smbus_exit; 2022 - } 2023 - 2024 2025 err = serio_register_driver(&psmouse_drv); 2025 2026 if (err) 2026 - goto err_destroy_wq; 2027 + goto err_smbus_exit; 2027 2028 2028 2029 return 0; 2029 2030 2030 - err_destroy_wq: 2031 - destroy_workqueue(kpsmoused_wq); 2032 2031 err_smbus_exit: 2033 2032 psmouse_smbus_module_exit(); 2034 2033 return err; ··· 2028 2045 static void __exit psmouse_exit(void) 2029 2046 { 2030 2047 serio_unregister_driver(&psmouse_drv); 2031 - destroy_workqueue(kpsmoused_wq); 2032 2048 psmouse_smbus_module_exit(); 2033 2049 } 2034 2050
+1 -3
drivers/input/mouse/psmouse.h
··· 90 90 void *private; 91 91 struct input_dev *dev; 92 92 struct ps2dev ps2dev; 93 - struct delayed_work resync_work; 93 + struct work_struct resync_work; 94 94 const char *vendor; 95 95 const char *name; 96 96 const struct psmouse_protocol *protocol; ··· 132 132 133 133 struct psmouse *psmouse_from_serio(struct serio *serio); 134 134 135 - void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work, 136 - unsigned long delay); 137 135 int psmouse_reset(struct psmouse *psmouse); 138 136 void psmouse_set_state(struct psmouse *psmouse, enum psmouse_state new_state); 139 137 void psmouse_set_resolution(struct psmouse *psmouse, unsigned int resolution);