mbox series

[v2,0/6] serial: sc16is7xx: regmap fixes and improvements

Message ID 20231211171353.2901416-1-hugo@hugovil.com
Headers show
Series serial: sc16is7xx: regmap fixes and improvements | expand

Message

Hugo Villeneuve Dec. 11, 2023, 5:13 p.m. UTC
From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

Hello,
this patch series brings fixes and improvements related to regmap access
for the sc16is7xx driver.

Most of the patches are related to commit 3837a0379533 ("serial: sc16is7xx: improve regmap debugfs by using one regmap per port").

I did not originally add a "Cc: stable" tag for the above mentioned commit,
as it was intended only to improve debugging using debugfs. But since then,
I have been able to confirm that it also fixes a long standing bug in our
system where the Tx interrupt are no longer enabled at some point when
transmitting large RS-485 paquets that completely fill the FIFO and thus
require multiple and subsequent writes to the FIFO once space in it becomes
available. I have been investigating why, but so far I haven't found the
exact cause, altough I suspect it has something to do with regmap caching.
Therefore, I have added this commit as a prerequisite for some of the
patches in this series so that it is automatically added to the stable
kernels.

I have tested the changes on a custom board with two SC16IS752 DUART over
a SPI interface using a Variscite IMX8MN NANO SOM. The four UARTs are
configured in RS-485 mode.

I did not test the change on a SC16is7xx using I2C interface, as my custom
board is only using SPI.

Thank you.

Link: [v1] https://lore.kernel.org/all/20231130191050.3165862-1-hugo@hugovil.com

Changes for V2:
 - Refactor patch 1 to avoid a truncation warning when using "%u" in
   snprintf.
 - Keep only fixing patches in this series. Non-fixes patches will be
   resubmitted in a new separate series.
 - Add 3 new fixing patches (4 to 6).

Hugo Villeneuve (6):
  serial: sc16is7xx: remove wasteful static buffer in
    sc16is7xx_regmap_name()
  serial: sc16is7xx: remove global regmap from struct sc16is7xx_port
  serial: sc16is7xx: remove unused line structure member
  serial: sc16is7xx: change EFR lock to operate on each channels
  serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions for
    FIFO
  serial: sc16is7xx: fix unconditional activation of THRI interrupt

 drivers/tty/serial/sc16is7xx.c | 104 ++++++++++++++++++---------------
 1 file changed, 56 insertions(+), 48 deletions(-)


base-commit: e045e18dbf3eaac32cdeb2799a5ec84fa694636c