diff mbox series

[V3,5/6] tty: serial: meson: meson_uart_shutdown omit clear AML_UART_TX_EN bit

Message ID 20211230102110.3861-6-yu.tu@amlogic.com (mailing list archive)
State New, archived
Headers show
Series the UART driver compatible with the Amlogic Meson | expand

Commit Message

Yu Tu Dec. 30, 2021, 10:21 a.m. UTC
This change is an improvement. The meson_uart_shutdown function
should have the opposite operation to the meson_uart_startup
function, but the meson_uart_shutdown of AML_UART_TX_EN is logically
missing.

Signed-off-by: Yu Tu <yu.tu@amlogic.com>
---
 drivers/tty/serial/meson_uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin Blumenstingl Dec. 30, 2021, 10:44 p.m. UTC | #1
On Thu, Dec 30, 2021 at 11:22 AM Yu Tu <yu.tu@amlogic.com> wrote:
[...]
>         val = readl(port->membase + AML_UART_CONTROL);
> -       val &= ~AML_UART_RX_EN;
> +       val &= ~(AML_UART_RX_EN | AML_UART_TX_EN);
>         val &= ~(AML_UART_RX_INT_EN | AML_UART_TX_INT_EN);
>         writel(val, port->membase + AML_UART_CONTROL);
This looks fine to me but I think it would be good to Cc the author of
commit 855ddcab352c15 ("ARM: meson: serial: only disable tx irq on
stop")
The meson_uart driver which Carlo added eight years ago did clear
AML_UART_TX_EN here, but it was changed with the commit I mentioned
above.


Best regards,
Martin
Yu Tu Dec. 31, 2021, 10:42 a.m. UTC | #2
On 2021/12/31 6:44, Martin Blumenstingl wrote:
> [ EXTERNAL EMAIL ]
> 
> On Thu, Dec 30, 2021 at 11:22 AM Yu Tu <yu.tu@amlogic.com> wrote:
> [...]
>>          val = readl(port->membase + AML_UART_CONTROL);
>> -       val &= ~AML_UART_RX_EN;
>> +       val &= ~(AML_UART_RX_EN | AML_UART_TX_EN);
>>          val &= ~(AML_UART_RX_INT_EN | AML_UART_TX_INT_EN);
>>          writel(val, port->membase + AML_UART_CONTROL);
> This looks fine to me but I think it would be good to Cc the author of
> commit 855ddcab352c15 ("ARM: meson: serial: only disable tx irq on
> stop")
> The meson_uart driver which Carlo added eight years ago did clear
> AML_UART_TX_EN here, but it was changed with the commit I mentioned
> above.
> 
I'm going to delete this change this time. Because there is no bug at 
present, if this is a bug encountered later, i will prepare to submit 
this change.
> 
> Best regards,
> Martin
>
diff mbox series

Patch

diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 07eb1f40aaaa..45e41f20cba3 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -140,7 +140,7 @@  static void meson_uart_shutdown(struct uart_port *port)
 	spin_lock_irqsave(&port->lock, flags);
 
 	val = readl(port->membase + AML_UART_CONTROL);
-	val &= ~AML_UART_RX_EN;
+	val &= ~(AML_UART_RX_EN | AML_UART_TX_EN);
 	val &= ~(AML_UART_RX_INT_EN | AML_UART_TX_INT_EN);
 	writel(val, port->membase + AML_UART_CONTROL);