* [PATCH] serial: qcom-geni: Add tracepoints for SE reg dump
@ 2026-10-19 3:32 Praveen Talari
2026-10-19 3:37 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Praveen Talari @ 2026-10-19 3:32 UTC (permalink / raw)
To: konrad.dybcio, Greg Kroah-Hartman, Jiri Slaby
Cc: chandana.chiluveru, mukesh.savaliya, linux-arm-msm, linux-kernel,
linux-serial, Praveen Talari
The GENI serial driver reports various transfer failures such as
M_CMD abort/cancel timeouts, DMA TX/RX FSM reset timeouts, RX FIFO
write errors, illegal command interrupts, and DMA parity errors.
However, diagnosing the root cause of these failures is difficult as
the hardware state is not captured when the error occurs.
Add trace_geni_se_regs() calls at critical serial error handling paths
to automatically capture GENI serial engine debug registers when
failures are detected. This includes:
- M_CMD abort/cancel timeout
- DMA TX/RX FSM reset timeout
- Unexpected zero-byte RX DMA completion
- RX FIFO write error and illegal command interrupt status
- RX DMA parity error
Dumping the SE debug registers at the time of failure provides
additional hardware context and significantly improves post-mortem
analysis of serial transfer issues without affecting normal
operation.
Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
---
drivers/tty/serial/qcom_geni_serial.c | 32 ++++++++++++++++++++++++--------
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index bfdc155c128d..34ab80e8cdbb 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -7,6 +7,8 @@
/* Disable MMIO tracing to prevent excessive logging of unwanted MMIO traces */
#define __DISABLE_TRACE_MMIO__
+#include <trace/events/qcom_geni_se.h>
+
#define CREATE_TRACE_POINTS
#include <trace/events/qcom_geni_serial.h>
@@ -811,8 +813,10 @@ static void qcom_geni_serial_stop_tx_dma(struct uart_port *uport)
if (port->tx_dma_addr) {
writel(1, uport->membase + SE_DMA_TX_FSM_RST);
if (!qcom_geni_serial_poll_bit(uport, SE_DMA_TX_IRQ_STAT,
- TX_RESET_DONE, true))
+ TX_RESET_DONE, true)) {
dev_err_ratelimited(uport->dev, "TX DMA reset failed");
+ trace_geni_se_regs(&port->se);
+ }
writel(TX_RESET_DONE | TX_DMA_DONE,
uport->membase + SE_DMA_TX_IRQ_CLR);
@@ -923,8 +927,11 @@ static void __qcom_geni_serial_cancel_tx_cmd(struct uart_port *uport)
if (!qcom_geni_serial_poll_bit(uport, SE_GENI_M_IRQ_STATUS,
M_CMD_CANCEL_EN, true)) {
geni_se_abort_m_cmd(&port->se);
- qcom_geni_serial_poll_bit(uport, SE_GENI_M_IRQ_STATUS,
- M_CMD_ABORT_EN, true);
+ if (!qcom_geni_serial_poll_bit(uport, SE_GENI_M_IRQ_STATUS,
+ M_CMD_ABORT_EN, true)) {
+ dev_err_ratelimited(uport->dev, "M_CMD_ABORT_EN not set");
+ trace_geni_se_regs(&port->se);
+ }
writel(M_CMD_ABORT_EN, uport->membase + SE_GENI_M_IRQ_CLEAR);
}
writel(M_CMD_CANCEL_EN, uport->membase + SE_GENI_M_IRQ_CLEAR);
@@ -1006,8 +1013,11 @@ static void qcom_geni_serial_stop_rx_dma(struct uart_port *uport)
qcom_geni_serial_abort_rx(uport);
writel(1, uport->membase + SE_DMA_RX_FSM_RST);
- qcom_geni_serial_poll_bit(uport, SE_DMA_RX_IRQ_STAT,
- RX_RESET_DONE, true);
+ if (!qcom_geni_serial_poll_bit(uport, SE_DMA_RX_IRQ_STAT,
+ RX_RESET_DONE, true)) {
+ dev_err_ratelimited(uport->dev, "RX DMA reset failed");
+ trace_geni_se_regs(&port->se);
+ }
writel(RX_RESET_DONE | RX_DMA_DONE,
uport->membase + SE_DMA_RX_IRQ_CLR);
}
@@ -1048,9 +1058,10 @@ static void qcom_geni_serial_handle_rx_dma(struct uart_port *uport, bool drop)
DMA_RX_BUF_SIZE, DMA_FROM_DEVICE);
rx_in = readl(uport->membase + SE_DMA_RX_LEN_IN);
- if (!rx_in)
+ if (!rx_in) {
dev_warn_ratelimited(uport->dev, "serial engine reports 0 RX bytes in!\n");
- else if (!drop) {
+ trace_geni_se_regs(&port->se);
+ } else if (!drop) {
trace_geni_serial_rx_data(uport->dev, port->rx_buf, rx_in);
handle_rx_uart(uport, rx_in);
}
@@ -1223,6 +1234,7 @@ static irqreturn_t qcom_geni_serial_isr(int isr, void *dev)
if (s_irq_status & S_RX_FIFO_WR_ERR_EN) {
uport->icount.overrun++;
tty_insert_flip_char(tport, 0, TTY_OVERRUN);
+ trace_geni_se_regs(&port->se);
}
if (s_irq_status & (S_GP_IRQ_0_EN | S_GP_IRQ_1_EN)) {
@@ -1246,8 +1258,11 @@ static irqreturn_t qcom_geni_serial_isr(int isr, void *dev)
writel(m_irq_status, uport->membase + SE_GENI_M_IRQ_CLEAR);
writel(dma_tx_status, uport->membase + SE_DMA_TX_IRQ_CLR);
- if (WARN_ON(m_irq_status & M_ILLEGAL_CMD_EN))
+ if (m_irq_status & M_ILLEGAL_CMD_EN) {
+ trace_geni_se_regs(&port->se);
+ WARN_ON(1);
goto handle_rx;
+ }
if (dma) {
if (dma_tx_status & TX_DMA_DONE) {
@@ -1270,6 +1285,7 @@ static irqreturn_t qcom_geni_serial_isr(int isr, void *dev)
if (dma_rx_status & RX_DMA_PARITY_ERR) {
uport->icount.parity++;
drop_rx = true;
+ trace_geni_se_regs(&port->se);
}
if (dma_rx_status & RX_DMA_BREAK)
---
base-commit: 2efb7a11f1aa4d2dc285fe2680cca22cb9f72f64
change-id: 20260927-add-tracepoints-for-se-reg-dump-uart-30d93639447a
Best regards,
--
Praveen Talari <praveen.talari@oss.qualcomm.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] serial: qcom-geni: Add tracepoints for SE reg dump
2026-10-19 3:32 [PATCH] serial: qcom-geni: Add tracepoints for SE reg dump Praveen Talari
@ 2026-10-19 3:37 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-10-19 3:37 UTC (permalink / raw)
To: Praveen Talari; +Cc: linux-serial
> The GENI serial driver reports various transfer failures such as
> M_CMD abort/cancel timeouts, DMA TX/RX FSM reset timeouts, RX FIFO
> write errors, illegal command interrupts, and DMA parity errors.
> However, diagnosing the root cause of these failures is difficult as
> the hardware state is not captured when the error occurs.
>
> Add trace_geni_se_regs() calls at critical serial error handling paths
> to automatically capture GENI serial engine debug registers when
> failures are detected. This includes:
>
> - M_CMD abort/cancel timeout
> - DMA TX/RX FSM reset timeout
> - Unexpected zero-byte RX DMA completion
> - RX FIFO write error and illegal command interrupt status
> - RX DMA parity error
>
> Dumping the SE debug registers at the time of failure provides
> additional hardware context and significantly improves post-mortem
> analysis of serial transfer issues without affecting normal
> operation.
>
> Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261019-add-tracepoints-for-se-reg-dump-uart-v1-1-1fb47b1605b9@oss.qualcomm.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-19 3:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 3:32 [PATCH] serial: qcom-geni: Add tracepoints for SE reg dump Praveen Talari
2026-10-19 3:37 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox