Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH] serial: pch_uart: allow DMA channel lookup with modular PCH DMA
@ 2026-12-04  2:34 Pengpeng Hou
  2026-12-04  2:52 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-12-04  2:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-kernel, linux-serial, Pengpeng Hou, Vinod Koul, Frank Li,
	dmaengine

When PCH DMA is built as a module, pch_uart_verify_port() returns
-EOPNOTSUPP before attempting to acquire a DMA channel.

Test IS_ENABLED instead. This lets the driver look for channels when the
DMA provider is modular. DMA mode is still enabled only after channel
acquisition and RX buffer allocation succeed.

The issue was found by our static-analysis tool and manually reviewed.

Fixes: 3c6a483275f4 ("Serial: EG20T: add PCH_UART driver")
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
The original patch was prepared with Gemini. Codex assisted with this
review and revision (Assisted-by: gpt 5).
Built pch_uart.o on x86-64 with GCC 11.4 and W=1
(CONFIG_SERIAL_PCH_UART=m, CONFIG_PCH_DMA=m). No runtime or hardware
test was performed.

 drivers/tty/serial/pch_uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 9505d255f09c522ce30d95021f549907eb025284..b37d4bfc60f6f47ae571c23a02f48879e3742083 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1418,7 +1418,7 @@ static int pch_uart_verify_port(struct uart_port *port,
 		priv->use_dma = 0;
 		serinfo->flags &= ~UPF_LOW_LATENCY;
 	} else {
-#ifndef CONFIG_PCH_DMA
+#if !IS_ENABLED(CONFIG_PCH_DMA)
 		dev_err(priv->port.dev, "%s : PCH DMA is not Loaded.\n",
 			__func__);
 		return -EOPNOTSUPP;

base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial: pch_uart: allow DMA channel lookup with modular PCH DMA
  2026-12-04  2:34 [PATCH] serial: pch_uart: allow DMA channel lookup with modular PCH DMA Pengpeng Hou
@ 2026-12-04  2:52 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-12-04  2:52 UTC (permalink / raw)
  To: Pengpeng Hou; +Cc: linux-serial

> When PCH DMA is built as a module, pch_uart_verify_port() returns
> -EOPNOTSUPP before attempting to acquire a DMA channel.
> 
> Test IS_ENABLED instead. This lets the driver look for channels when the
> DMA provider is modular. DMA mode is still enabled only after channel
> acquisition and RX buffer allocation succeed.
> 
> The issue was found by our static-analysis tool and manually reviewed.
> 
> Fixes: 3c6a483275f4 ("Serial: EG20T: add PCH_UART driver")
> Signed-off-by: Pengpeng Hou <hppiscas@163.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/179635165732.74470.15556338453226119146@163.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-04  2:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  2:34 [PATCH] serial: pch_uart: allow DMA channel lookup with modular PCH DMA Pengpeng Hou
2026-12-04  2:52 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox