2022-08-25 09:42:30

by Ilpo Järvinen

[permalink] [raw]
Subject: [PATCH 0/3] serial: Add uart_xmit_advance() + fixes part (of a larger patch series)

Add uart_xmit_advance() helper to handle circular xmit buffer
advancement + accounting of Tx'ed bytes. Use it to fix a few drivers
that previously lacked to accounting for DMA Tx.

Greg,
I've a another series on top this which is tty-next material making the
rest of the drivers to use uart_xmit_advance(). That series obviously
depends on the patch 1/3 of this series so if you end up putting these
3 patches into tty-linus, I'll need it to be merged into tty-next at
some point (I'm not in a big hurry with this so if you choose to delay
the merge, it's not a big deal).

Ilpo Järvinen (3):
serial: Create uart_xmit_advance()
serial: tegra: Use uart_xmit_advance(), fixes icount.tx accounting
serial: tegra-tcu: Use uart_xmit_advance(), fixes icount.tx accounting

drivers/tty/serial/serial-tegra.c | 5 ++---
drivers/tty/serial/tegra-tcu.c | 2 +-
include/linux/serial_core.h | 17 +++++++++++++++++
3 files changed, 20 insertions(+), 4 deletions(-)

--
2.30.2


2022-08-26 16:09:38

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 0/3] serial: Add uart_xmit_advance() + fixes part (of a larger patch series)

On Thu, Aug 25, 2022 at 12:19 PM Ilpo Järvinen
<[email protected]> wrote:
>
> Add uart_xmit_advance() helper to handle circular xmit buffer
> advancement + accounting of Tx'ed bytes. Use it to fix a few drivers
> that previously lacked to accounting for DMA Tx.

For the whole series
Reviewed-by: Andy Shevchenko <[email protected]>
Thanks for fixing this issue.

> Greg,
> I've a another series on top this which is tty-next material making the
> rest of the drivers to use uart_xmit_advance(). That series obviously
> depends on the patch 1/3 of this series so if you end up putting these
> 3 patches into tty-linus, I'll need it to be merged into tty-next at
> some point (I'm not in a big hurry with this so if you choose to delay
> the merge, it's not a big deal).
>
> Ilpo Järvinen (3):
> serial: Create uart_xmit_advance()
> serial: tegra: Use uart_xmit_advance(), fixes icount.tx accounting
> serial: tegra-tcu: Use uart_xmit_advance(), fixes icount.tx accounting
>
> drivers/tty/serial/serial-tegra.c | 5 ++---
> drivers/tty/serial/tegra-tcu.c | 2 +-
> include/linux/serial_core.h | 17 +++++++++++++++++
> 3 files changed, 20 insertions(+), 4 deletions(-)
>
> --
> 2.30.2
>


--
With Best Regards,
Andy Shevchenko

2022-08-29 07:41:43

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 0/3] serial: Add uart_xmit_advance() + fixes part (of a larger patch series)

On 25. 08. 22, 11:17, Ilpo Järvinen wrote:
> Add uart_xmit_advance() helper to handle circular xmit buffer
> advancement + accounting of Tx'ed bytes. Use it to fix a few drivers
> that previously lacked to accounting for DMA Tx.
>
> Greg,
> I've a another series on top this which is tty-next material making the
> rest of the drivers to use uart_xmit_advance(). That series obviously
> depends on the patch 1/3 of this series so if you end up putting these
> 3 patches into tty-linus, I'll need it to be merged into tty-next at
> some point (I'm not in a big hurry with this so if you choose to delay
> the merge, it's not a big deal).

Hi,
could you hold off with the latter series? I'll send a v2 of TX path
cleanup shortly. You'd then need to update much less places (if my
series is accepted):
https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/commit/?h=devel&id=2d9ade0412f7e5edacc7f791ebbf773d6481b453
https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/commit/?h=devel&id=fd55062d74a8c137d30388c6e25ebd5c06a04517
https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/commit/?h=devel&id=a1df5129cc0cf174a8cd03e187c6a5e890d313e4

v1 was here (but was doing a call for every character):
https://lore.kernel.org/all/[email protected]/

> Ilpo Järvinen (3):
> serial: Create uart_xmit_advance()
> serial: tegra: Use uart_xmit_advance(), fixes icount.tx accounting
> serial: tegra-tcu: Use uart_xmit_advance(), fixes icount.tx accounting
>
> drivers/tty/serial/serial-tegra.c | 5 ++---
> drivers/tty/serial/tegra-tcu.c | 2 +-
> include/linux/serial_core.h | 17 +++++++++++++++++
> 3 files changed, 20 insertions(+), 4 deletions(-)
>

thanks,
--
js
suse labs

2022-08-29 07:51:08

by Ilpo Järvinen

[permalink] [raw]
Subject: Re: [PATCH 0/3] serial: Add uart_xmit_advance() + fixes part (of a larger patch series)

On Mon, 29 Aug 2022, Jiri Slaby wrote:

> On 25. 08. 22, 11:17, Ilpo Järvinen wrote:
> > Add uart_xmit_advance() helper to handle circular xmit buffer
> > advancement + accounting of Tx'ed bytes. Use it to fix a few drivers
> > that previously lacked to accounting for DMA Tx.
> >
> > Greg,
> > I've a another series on top this which is tty-next material making the
> > rest of the drivers to use uart_xmit_advance(). That series obviously
> > depends on the patch 1/3 of this series so if you end up putting these
> > 3 patches into tty-linus, I'll need it to be merged into tty-next at
> > some point (I'm not in a big hurry with this so if you choose to delay
> > the merge, it's not a big deal).
>
> Hi,
> could you hold off with the latter series? I'll send a v2 of TX path cleanup
> shortly. You'd then need to update much less places (if my series is
> accepted):
> https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/commit/?h=devel&id=2d9ade0412f7e5edacc7f791ebbf773d6481b453
> https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/commit/?h=devel&id=fd55062d74a8c137d30388c6e25ebd5c06a04517
> https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/commit/?h=devel&id=a1df5129cc0cf174a8cd03e187c6a5e890d313e4
>
> v1 was here (but was doing a call for every character):
> https://lore.kernel.org/all/[email protected]/

Sure, I can hold off a while (as long as we're speaking of reasonable
timescales :-)). Looking into your patches, they also seemed to lack that
icount.tx++ thing.

--
i.

> > Ilpo Järvinen (3):
> > serial: Create uart_xmit_advance()
> > serial: tegra: Use uart_xmit_advance(), fixes icount.tx accounting
> > serial: tegra-tcu: Use uart_xmit_advance(), fixes icount.tx accounting
> >
> > drivers/tty/serial/serial-tegra.c | 5 ++---
> > drivers/tty/serial/tegra-tcu.c | 2 +-
> > include/linux/serial_core.h | 17 +++++++++++++++++
> > 3 files changed, 20 insertions(+), 4 deletions(-)
> >
>
> thanks,
>

2022-08-29 08:23:20

by Ilpo Järvinen

[permalink] [raw]
Subject: Re: [PATCH 0/3] serial: Add uart_xmit_advance() + fixes part (of a larger patch series)

On Mon, 29 Aug 2022, Jiri Slaby wrote:

> On 29. 08. 22, 9:41, Ilpo Järvinen wrote:> Looking into your patches, they
> also seemed to lack that> icount.tx++ thing.
>
> Perhaps, you only overlooked it?
>
> + for (; (for_test) && (!tx_ready || tx_ready(port));
> + (for_post), port->icount.tx++) {

Ah, yes, I did (and its placement at the end of a multi-line for() didn't
help that much either for pick it up :-)).

--
i.

2022-08-29 08:24:48

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 0/3] serial: Add uart_xmit_advance() + fixes part (of a larger patch series)

On 29. 08. 22, 9:41, Ilpo Järvinen wrote:> Looking into your patches,
they also seemed to lack that> icount.tx++ thing.

Perhaps, you only overlooked it?

+ for (; (for_test) && (!tx_ready || tx_ready(port));
+ (for_post), port->icount.tx++) {

thanks,
--
js
suse labs