lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2decb1ec-050d-45f5-b136-d39c59bf4e55@kernel.org>
Date: Wed, 31 Jan 2024 13:17:16 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: gregkh@...uxfoundation.org
Cc: linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
 Emil Kronborg <emil.kronborg@...tonmail.com>
Subject: Re: [PATCH 1/2] serial: core: introduce uart_port_tx_flags()

On 31. 01. 24, 13:13, Jiri Slaby (SUSE) wrote:
> And an enum with a flag: UART_TX_NOSTOP. To NOT call
> __port->ops->stop_tx() when the circular buffer is empty. mxs-uart needs
> this (see the next patch).
> 
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@...nel.org>
> Cc: Emil Kronborg <emil.kronborg@...tonmail.com>
> ---
>   include/linux/serial_core.h | 32 +++++++++++++++++++++++++++-----
>   1 file changed, 27 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 536b2581d3e2..edefb6d73604 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -748,8 +748,17 @@ struct uart_driver {
>   
>   void uart_write_wakeup(struct uart_port *port);
>   
> -#define __uart_port_tx(uport, ch, tx_ready, put_char, tx_done, for_test,      \
> -		for_post)						      \
> +/**
> + * enum UART_TX_FLAGS -- flags for uart_port_tx_flags()
> + *
> + * @UART_TX_NOSTOP: don't call port->ops->stop_tx() on empty buffer
> + */
> +enum UART_TX_FLAGS {
> +	UART_TX_NOSTOP = BIT(0),
> +};
> +
> +#define __uart_port_tx(uport, ch, flags, tx_ready, put_char, tx_done,	      \
> +		       for_test, for_post)				      \
>   ({									      \
>   	struct uart_port *__port = (uport);				      \
>   	struct circ_buf *xmit = &__port->state->xmit;			      \
> @@ -777,7 +786,7 @@ void uart_write_wakeup(struct uart_port *port);
>   	if (pending < WAKEUP_CHARS) {					      \
>   		uart_write_wakeup(__port);				      \
>   									      \
> -		if (pending == 0)					      \
> +		if (((flags) & UART_TX_NOSTOP) && pending == 0)		      \

Hold on, this is obviously inverted!

-- 
js
suse labs


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ