From: Jiri Slaby <jirislaby@kernel.org>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Emil Kronborg <emil.kronborg@protonmail.com>
Subject: Re: [PATCH 1/2] serial: core: introduce uart_port_tx_flags()
Date: Wed, 31 Jan 2024 13:17:16 +0100 [thread overview]
Message-ID: <2decb1ec-050d-45f5-b136-d39c59bf4e55@kernel.org> (raw)
In-Reply-To: <20240131121359.7855-1-jirislaby@kernel.org>
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@kernel.org>
> Cc: Emil Kronborg <emil.kronborg@protonmail.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
prev parent reply other threads:[~2024-01-31 12:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 12:13 [PATCH 1/2] serial: core: introduce uart_port_tx_flags() Jiri Slaby (SUSE)
2024-01-31 12:13 ` [PATCH 2/2] serial: mxs-auart: fix tx Jiri Slaby (SUSE)
2024-01-31 12:17 ` Jiri Slaby [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2decb1ec-050d-45f5-b136-d39c59bf4e55@kernel.org \
--to=jirislaby@kernel.org \
--cc=emil.kronborg@protonmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.