[PATCH 1/2] serial: lantiq: release the memory region in release_port

From: Arina Kharlamova via B4 Relay

Date: Tue Dec 01 2026 - 14:20:46 EST


From: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>

lqasc_request_port() requests the memory region with
devm_request_mem_region(), but lqasc_release_port() only unmaps the
registers. After TIOCSERCONFIG, which calls release_port and then
config_port, the region is still busy and lqasc_request_port() fails.
lqasc_config_port() ignores the error, and lqasc_startup() then
accesses the registers through a NULL membase.

Release the region in lqasc_release_port().

Fixes: 2f0fc4159a6a ("SERIAL: Lantiq: Add driver for MIPS Lantiq SOCs.")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>
---
drivers/tty/serial/lantiq.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c
index fc75476c0935..37f74ecae937 100644
--- a/drivers/tty/serial/lantiq.c
+++ b/drivers/tty/serial/lantiq.c
@@ -498,11 +498,17 @@ static void
lqasc_release_port(struct uart_port *port)
{
struct platform_device *pdev = to_platform_device(port->dev);
+ struct resource *res;

if (port->flags & UPF_IOREMAP) {
devm_iounmap(&pdev->dev, port->membase);
port->membase = NULL;
}
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (res)
+ devm_release_mem_region(&pdev->dev, res->start,
+ resource_size(res));
}

static int

--
Git-157)