Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Phil Rosenthal" <phil@phil.gs>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: core: Shut down a suspended port on removal
Date: Wed, 14 Oct 2026 16:57:58 +0000	[thread overview]
Message-ID: <sashiko-outbox-171558@kernel.org> (raw)
In-Reply-To: <20261014-serial-remove-suspended-v1-1-fda644ab5f89@phil.gs>

> From: Phil Rosenthal <phil@phil.gs>
> 
> Commit 810d467c11f0 ("serial: core: shut down initialized port on
> removal") calls uart_shutdown() from serial_core_remove_one_port() only
> if the port is initialized.  A port that is removed while suspended is
> not: uart_suspend_port() clears its initialized flag, sets its suspended
> flag and keeps its transmit buffer.  Nothing clears the flag or frees
> the buffer on removal, so both stay in the line's uart_state.
> 
> If the line is reused, the next uart_resume_port() for the new port
> finds the suspended flag set and starts the port up although nobody has
> opened it.  If the uart_driver is unregistered instead, the buffer is
> leaked, as uart_unregister_driver() does not free it.
> 
> Call uart_shutdown() whether or not the port is initialized.  For a port
> that is not initialized it leaves the hardware alone, and it always
> clears the suspended flag and frees the transmit buffer.
> 
> Fixes: 810d467c11f0 ("serial: core: shut down initialized port on removal")
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/r/sashiko-outbox-164404@kernel.org
> Assisted-by: LLM sparse
> Signed-off-by: Phil Rosenthal <phil@phil.gs>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261014-serial-remove-suspended-v1-1-fda644ab5f89@phil.gs?part=1


      reply	other threads:[~2026-10-14 16:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 16:43 [PATCH] serial: core: Shut down a suspended port on removal Phil Rosenthal via B4 Relay
2026-10-14 16:57 ` sashiko-bot [this message]

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=sashiko-outbox-171558@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=phil@phil.gs \
    --cc=sashiko-reviews@lists.linux.dev \
    /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