mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Crispin <john@phrozen.org>
To: arina.kharlamova@mbzuai.ac.ae, Jiri Slaby <jirislaby@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH 1/2] serial: lantiq: release the memory region in release_port
Date: Tue, 1 Dec 2026 21:01:56 +0100	[thread overview]
Message-ID: <a871cbc7-8e38-40de-8b8f-b50c2ec82701@phrozen.org> (raw)
In-Reply-To: <20261201-s2p-lpr-tty-v1-1-599ae5139f12@mbzuai.ac.ae>



On 01.12.26 20:20, Arina Kharlamova via B4 Relay wrote:
> From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
> 
> 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@vger.kernel.org
> Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
> ---
>  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
> 

The imbalance is there, but it only shows with TIOCSERCONFIG, which nobody runs on a SoC UART.

I do not think this is stable material, please drop the Cc: stable.

this feels like some rogue / fire and forget LLM report material



  reply	other threads:[~2026-12-01 20:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 19:20 [PATCH 0/2] serial: release the port resources " Arina Kharlamova via B4 Relay
2026-12-01 19:20 ` [PATCH 1/2] serial: lantiq: release the memory region " Arina Kharlamova via B4 Relay
2026-12-01 20:01   ` John Crispin [this message]
2026-12-01 19:20 ` [PATCH 2/2] serial: pic32_uart: unmap the registers " Arina Kharlamova via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a871cbc7-8e38-40de-8b8f-b50c2ec82701@phrozen.org \
    --to=john@phrozen.org \
    --cc=arina.kharlamova@mbzuai.ac.ae \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®