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.

Revert "tty: n_gsm: replace kicktimer with delayed_work"

This reverts commit c9ab053e56ce13a949977398c8edc12e6c02fc95.

The above commit is reverted as it was a prerequisite for tx_mutex
introduction and tx_mutex has been removed as it does not correctly
work in order to protect tx data.

Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Daniel Starke <daniel.starke@siemens.com>
Link: https://lore.kernel.org/r/20221008110221.13645-3-pchelkin@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Fedor Pchelkin and committed by
Greg Kroah-Hartman
15743ae5 acdab4cb

+8 -8
+8 -8
drivers/tty/n_gsm.c
··· 272 272 struct list_head tx_data_list; /* Pending data packets */ 273 273 274 274 /* Control messages */ 275 - struct delayed_work kick_timeout; /* Kick TX queuing on timeout */ 275 + struct timer_list kick_timer; /* Kick TX queuing on timeout */ 276 276 struct timer_list t2_timer; /* Retransmit timer for commands */ 277 277 int cretries; /* Command retry counter */ 278 278 struct gsm_control *pending_cmd;/* Our current pending command */ ··· 1029 1029 gsm->tx_bytes += msg->len; 1030 1030 1031 1031 gsmld_write_trigger(gsm); 1032 - schedule_delayed_work(&gsm->kick_timeout, 10 * gsm->t1 * HZ / 100); 1032 + mod_timer(&gsm->kick_timer, jiffies + 10 * gsm->t1 * HZ / 100); 1033 1033 } 1034 1034 1035 1035 /** ··· 2022 2022 } 2023 2023 2024 2024 /** 2025 - * gsm_kick_timeout - transmit if possible 2026 - * @work: work contained in our gsm object 2025 + * gsm_kick_timer - transmit if possible 2026 + * @t: timer contained in our gsm object 2027 2027 * 2028 2028 * Transmit data from DLCIs if the queue is empty. We can't rely on 2029 2029 * a tty wakeup except when we filled the pipe so we need to fire off 2030 2030 * new data ourselves in other cases. 2031 2031 */ 2032 - static void gsm_kick_timeout(struct work_struct *work) 2032 + static void gsm_kick_timer(struct timer_list *t) 2033 2033 { 2034 - struct gsm_mux *gsm = container_of(work, struct gsm_mux, kick_timeout.work); 2034 + struct gsm_mux *gsm = from_timer(gsm, t, kick_timer); 2035 2035 unsigned long flags; 2036 2036 int sent = 0; 2037 2037 ··· 2496 2496 } 2497 2497 2498 2498 /* Finish outstanding timers, making sure they are done */ 2499 - cancel_delayed_work_sync(&gsm->kick_timeout); 2499 + del_timer_sync(&gsm->kick_timer); 2500 2500 del_timer_sync(&gsm->t2_timer); 2501 2501 2502 2502 /* Finish writing to ldisc */ ··· 2643 2643 kref_init(&gsm->ref); 2644 2644 INIT_LIST_HEAD(&gsm->tx_ctrl_list); 2645 2645 INIT_LIST_HEAD(&gsm->tx_data_list); 2646 - INIT_DELAYED_WORK(&gsm->kick_timeout, gsm_kick_timeout); 2646 + timer_setup(&gsm->kick_timer, gsm_kick_timer, 0); 2647 2647 timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0); 2648 2648 INIT_WORK(&gsm->tx_work, gsmld_write_task); 2649 2649 init_waitqueue_head(&gsm->event);