Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arina Kharlamova" <arina.kharlamova@mbzuai.ac.ae>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v2] serial: uartlite: Disable the clock after the port is removed
Date: Thu, 03 Dec 2026 11:23:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-247667@kernel.org> (raw)
In-Reply-To: <20261203-uartlite-remove-clk-v2-1-920d6ba90074@mbzuai.ac.ae>

> From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
> 
> ulite_remove() calls clk_disable_unprepare() before ulite_release().
> When the port is open, ulite_startup() holds a second clk_enable(), so
> the clock is unprepared while still enabled, and then
> uart_remove_one_port() runs ulite_shutdown(), which writes
> ULITE_CONTROL and calls clk_disable() on the unprepared clock. For a
> console port the clock is gated before the console is unregistered.
> 
> The device can also runtime suspend during the remove. The
> pm_runtime_put_sync() that the driver core calls before ->remove()
> arms the autosuspend timer, or suspends at once when
> autosuspend_delay_ms is 0. ulite_runtime_suspend() then disables the
> clock a second time, and after ulite_release() it dereferences the
> cleared drvdata.
> 
> Hold a runtime PM reference across ulite_release(), so the device is
> resumed and cannot suspend while the port is torn down. Disable the
> clock after runtime PM is disabled, and only if the device is not
> runtime suspended, then unprepare it.
> 
> Fixes: 14288befeb57 ("tty: serial: uartlite: Add clock adaptation")
> Fixes: 5bbe10a6942d ("tty: serial: uartlite: Add runtime pm support")
> Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-uartlite-remove-clk-v2-1-920d6ba90074@mbzuai.ac.ae?part=1

      reply	other threads:[~2026-12-03 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 11:09 [PATCH v2] serial: uartlite: Disable the clock after the port is removed Arina Kharlamova via B4 Relay
2026-12-03 11:23 ` 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-247667@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arina.kharlamova@mbzuai.ac.ae \
    --cc=linux-serial@vger.kernel.org \
    --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