... | ... | ||
---|---|---|---|
8 | The ->device_lock()/unlock() will provide the additional serilization | 8 | The ->device_lock()/unlock() will provide the additional serilization |
9 | necessary for ->write_thread() which is called from dedicated printing | 9 | necessary for ->write_thread() which is called from dedicated printing |
10 | thread. | 10 | thread. |
11 | 11 | ||
12 | Signed-off-by: Ryo Takakura <ryotkkr98@gmail.com> | 12 | Signed-off-by: Ryo Takakura <ryotkkr98@gmail.com> |
13 | Reviewed-by: John Ogness <john.ogness@linutronix.de> | ||
13 | --- | 14 | --- |
14 | 15 | ||
15 | Hi! | 16 | Changes since v1: |
17 | [0] https://lore.kernel.org/lkml/20250323060603.388621-1-ryotkkr98@gmail.com/ | ||
16 | 18 | ||
17 | I referred to the already converted console drivers 8250 [0], imx [1] | 19 | - Thank you John for the feedback! |
18 | and amba-pl011 [2]. I tested the patch for each of the NBCON priority | 20 | - Add a patch for synchronizing startup()/shutdown() vs write(). |
19 | (PANIC, EMERGENCY and NORMAL) on riscv qemu. | 21 | - Add <Reviewed-by> by John. |
20 | Hope to get feedbacks, thanks! | ||
21 | 22 | ||
22 | Sincerely, | 23 | Changes since v2: |
23 | Ryo Takakura | 24 | [1] https://lore.kernel.org/all/20250330003058.386447-1-ryotkkr98@gmail.com/ |
24 | 25 | ||
25 | [0] https://lore.kernel.org/lkml/20250107212702.169493-1-john.ogness@linutronix.de/ | 26 | - Add Cc stable for the first patch. |
26 | [1] https://lore.kernel.org/linux-arm-kernel/20240913-serial-imx-nbcon-v3-1-4c627302335b@geanix.com/ | 27 | |
27 | [2] https://lore.kernel.org/linux-serial/20250204044428.2191983-1-fj6611ie@aa.jp.fujitsu.com/ | 28 | Changes since v3: |
29 | [2] https://lore.kernel.org/all/20250330110957.392460-1-ryotkkr98@gmail.com/ | ||
30 | |||
31 | - Avoid using return statement on return-void function. Thanks Sebastian | ||
32 | for pointing out! | ||
33 | |||
34 | Changes since v4: | ||
35 | [3] https://lore.kernel.org/all/20250405043833.397020-1-ryotkkr98@gmail.com/ | ||
36 | |||
37 | - Send the 2 patches seperatly which used to be treated as a series. | ||
38 | The other patch which was sent as part of the series can be found [4]. | ||
39 | [4] https://lore.kernel.org/all/20250405132458.488942-1-ryotkkr98@gmail.com/ | ||
28 | 40 | ||
29 | --- | 41 | --- |
30 | drivers/tty/serial/sifive.c | 87 +++++++++++++++++++++++++++++++------ | 42 | drivers/tty/serial/sifive.c | 87 +++++++++++++++++++++++++++++++------ |
31 | 1 file changed, 74 insertions(+), 13 deletions(-) | 43 | 1 file changed, 74 insertions(+), 13 deletions(-) |
32 | 44 | ||
... | ... | ||
52 | + | 64 | + |
53 | +static void sifive_serial_device_lock(struct console *co, unsigned long *flags) | 65 | +static void sifive_serial_device_lock(struct console *co, unsigned long *flags) |
54 | +{ | 66 | +{ |
55 | + struct uart_port *up = &sifive_serial_console_ports[co->index]->port; | 67 | + struct uart_port *up = &sifive_serial_console_ports[co->index]->port; |
56 | + | 68 | + |
57 | + return __uart_port_lock_irqsave(up, flags); | 69 | + __uart_port_lock_irqsave(up, flags); |
58 | +} | 70 | +} |
59 | + | 71 | + |
60 | +static void sifive_serial_device_unlock(struct console *co, unsigned long flags) | 72 | +static void sifive_serial_device_unlock(struct console *co, unsigned long flags) |
61 | +{ | 73 | +{ |
62 | + struct uart_port *up = &sifive_serial_console_ports[co->index]->port; | 74 | + struct uart_port *up = &sifive_serial_console_ports[co->index]->port; |
63 | + | 75 | + |
64 | + return __uart_port_unlock_irqrestore(up, flags); | 76 | + __uart_port_unlock_irqrestore(up, flags); |
65 | } | 77 | } |
66 | 78 | ||
67 | -static void sifive_serial_console_write(struct console *co, const char *s, | 79 | -static void sifive_serial_console_write(struct console *co, const char *s, |
68 | - unsigned int count) | 80 | - unsigned int count) |
69 | +static void sifive_serial_console_write_atomic(struct console *co, | 81 | +static void sifive_serial_console_write_atomic(struct console *co, |
... | ... | diff view generated by jsdifflib |