Skip to content

serial: qcom-geni: Overhaul TX handling to fix crashes/hangs

Douglas Anderson linux-arm-msm linux-serial lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest8 patches 24 repliesIn review
  2. v37 patches 4 repliesSuperseded
  3. v27 patches 6 repliesSuperseded

Changes in v4 from the cover letter

- Add GP_LENGTH field definition.
- Fix indentation.
- GENMASK(31, 0) -> GP_LENGTH.
- Use uart_fifo_timeout_ms() for timeout.
- tty: serial: Add uart_fifo_timeout_ms()

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8soc: qcom: geni-se: Add GP_LENGTH/IRQ_EN_SET/IRQ_EN_CLEAR registersinclude/linux/soc/qcom/geni-se.h+9 -00 replies
2/8tty: serial: Add uart_fifo_timeout_ms()include/linux/serial_core.h+11 -44 replies
3/8serial: qcom-geni: Fix the timeout in qcom_geni_serial_poll_bit()drivers/tty/serial/qcom_geni_serial.c+18 -201 reply
4/8serial: qcom-geni: Fix arg types for qcom_geni_serial_poll_bit()drivers/tty/serial/qcom_geni_serial.c+1 -11 reply
5/8serial: qcom-geni: Introduce qcom_geni_serial_poll_bitfield()drivers/tty/serial/qcom_geni_serial.c+9 -31 reply
6/8serial: qcom-geni: Just set the watermark level oncedrivers/tty/serial/qcom_geni_serial.c+1 -40 replies
7/8serial: qcom-geni: Fix suspend while active UART xferdrivers/tty/serial/qcom_geni_serial.c+75 -225 replies
8/8serial: qcom-geni: Rework TX in FIFO mode to fix hangs/lockupsdrivers/tty/serial/qcom_geni_serial.c+94 -988 replies

Reviews trailers per patch

6 of 8 patches have a Reviewed-by or Acked-by.

PatchBjorn AnderssonKonrad DybcioNeil ArmstrongJohan HovoldNícolas F. R. A. Prado
SeriesT-b T-b T-b T-b
1/8A-b
2/8
3/8A-b
4/8R-b
5/8R-b
6/8
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/8] serial: qcom-geni: Overhaul TX handling to fix crashes/hangs

While trying to reproduce -EBUSY errors that our lab was getting in suspend/resume testing, I ended up finding a whole pile of problems with the Qualcomm GENI serial driver. I've posted a fix for the -EBUSY issue separately [1]. This series is fixing all of the Qualcomm GENI problems that I found.

As far as I can tell most of the problems have been in the Qualcomm GENI serial driver since inception, but it can be noted that the behavior got worse with the new kfifo changes. Previously when the OS took data out of the circular queue we'd just spit stale data onto the serial port. Now we'll hard lockup. :-P

I've tried to break this series up as much as possible to make it easier to understand but the final patch is still a lot of change at once. Hopefully it's OK.

[1] https://lore.kernel.org/r/20240530084841.v2.1.I2395e66cf70c6e67d774c56943825c289b9c13e4@changeid

Changes in v4:
- Add GP_LENGTH field definition.
- Fix indentation.
- GENMASK(31, 0) -> GP_LENGTH.
- Use uart_fifo_timeout_ms() for timeout.
- tty: serial: Add uart_fifo_timeout_ms()

Changes in v3:
- 0xffffffff => GENMASK(31, 0)
- Reword commit message.
- Use uart_fifo_timeout() for timeout.

Changes in v2:
- Totally rework / rename patch to handle suspend while active xfer
- serial: qcom-geni: Fix arg types for qcom_geni_serial_poll_bit()
- serial: qcom-geni: Fix the timeout in qcom_geni_serial_poll_bit()
- serial: qcom-geni: Introduce qcom_geni_serial_poll_bitfield()
- serial: qcom-geni: Just set the watermark level once
- serial: qcom-geni: Rework TX in FIFO mode to fix hangs/lockups
- soc: qcom: geni-se: Add GP_LENGTH/IRQ_EN_SET/IRQ_EN_CLEAR registers

Douglas Anderson (8):
soc: qcom: geni-se: Add GP_LENGTH/IRQ_EN_SET/IRQ_EN_CLEAR registers
tty: serial: Add uart_fifo_timeout_ms()
serial: qcom-geni: Fix the timeout in qcom_geni_serial_poll_bit()
serial: qcom-geni: Fix arg types for qcom_geni_serial_poll_bit()
serial: qcom-geni: Introduce qcom_geni_serial_poll_bitfield()
serial: qcom-geni: Just set the watermark level once
serial: qcom-geni: Fix suspend while active UART xfer
serial: qcom-geni: Rework TX in FIFO mode to fix hangs/lockups

 drivers/tty/serial/qcom_geni_serial.c | 322 +++++++++++++++-----------
 include/linux/serial_core.h           |  15 +-
 include/linux/soc/qcom/geni-se.h      |   9 +
 3 files changed, 206 insertions(+), 140 deletions(-)
Signature · 1 line
2.45.2.505.gda0bf45e8d-goog