On 12/17/24 02:36, Hugo Villeneuve wrote:
On Thu, 12 Dec 2024 22:00:00 +0800 Hui Wang hui.wang@canonical.com wrote:
On 12/12/24 21:44, Greg KH wrote:
On Wed, Dec 11, 2024 at 12:25:39PM +0800, Hui Wang wrote:
Recently we found the fifo_read() and fifo_write() are broken in our 5.15 kernel after rebase to the latest 5.15.y, the 5.15.y integrated the commit e635f652696e ("serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions for FIFO"), but it forgot to integrate a prerequisite commit 3837a0379533 ("serial: sc16is7xx: improve regmap debugfs by using one regmap per port").
And about the prerequisite commit, there are also 4 commits to fix it, So in total, I backported 5 patches to 5.15.y to fix this regression.
0002-xxx and 0004-xxx could be cleanly applied to 5.15.y, the remaining 3 patches need to resolve some conflict.
Hugo Villeneuve (5): serial: sc16is7xx: improve regmap debugfs by using one regmap per port 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
drivers/tty/serial/sc16is7xx.c | 185 +++++++++++++++++++-------------- 1 file changed, 107 insertions(+), 78 deletions(-)
How well did you test this series? It seems you forgot about commit 133f4c00b8b2 ("serial: sc16is7xx: fix TX fifo corruption"), right?
Please do better testing and resend a working set of patches.
Okay, got it.
Hi Hui / Greg, I am testing these changes on my RS-485 board, and I found out that this patch is required:
commit b4a778303ea0 ("serial: sc16is7xx: add missing support for rs485 devicetree properties")
With it, it now works (basic loopback test) on 5.15 branch and with my hardware.
As per Greg's suggestion, I have also tested (and reworked) commit 133f4c00b8b2 ("serial: sc16is7xx: fix TX fifo corruption"), with a prerequisite patch for it to apply more easily: 53a8c50802745 ("serial: sc16is7xx: refactor FIFO access functions to increase commonality").
And finally I have added commit c41698d1a04cb ("serial: sc16is7xx: fix invalid FIFO access with special register set").
I will submit these 4 patches to stable soon.
Hi Hugo,
Thanks for your help. I planned to do it, but It is blocked by backporting the commit 133f4c00b8b2 ("serial: sc16is7xx: fix TX fifo corruption"), it requires kfifo_out_linear_ptr() but this function is not in 5.15.y. It is great you could help.
Thanks,
Hui.