From: Mukesh Savaliya <mukesh.savaliya@oss.qualcomm.com>
To: Praveen Talari <praveen.talari@oss.qualcomm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
bjorn.andersson@oss.qualcomm.com,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: aniket.randive@oss.qualcomm.com,
chandana.chiluveru@oss.qualcomm.com,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: qcom-geni: add force suspend/resume to system sleep callbacks
Date: Wed, 1 Jul 2026 20:47:32 +0530 [thread overview]
Message-ID: <73243e36-175c-4fe3-a448-b30eef9c44ee@oss.qualcomm.com> (raw)
In-Reply-To: <20260701-add_force_suspend_resume_to_system_sleep_callbacks-v1-1-38c9a721a462@oss.qualcomm.com>
On 7/1/2026 11:27 AM, Praveen Talari wrote:
> During system sleep the hardware resources (clocks, interconnect) are
> not gated because the runtime-suspend callback is never invoked from
> the system sleep path. This prevents the platform from reaching its
> lowest idle state.
>
> The system sleep callbacks qcom_geni_serial_suspend() and
> qcom_geni_serial_resume() rely solely on uart_suspend_port() /
> uart_resume_port() to manage power. uart_suspend_port() drives the
> UART PM state machine to UART_PM_STATE_OFF, which in turn calls
> pm_runtime_put_sync() and eventually the runtime-suspend callback.
> However, if the runtime-PM usage count is still elevated at the time
> of system sleep (e.g. the port is held active by an open file
> descriptor), the runtime-suspend callback is never invoked and the
> hardware resources (clocks, interconnect) remain enabled across
> suspend, preventing the platform from reaching its lowest idle state.
>
> Fix this by calling pm_runtime_force_suspend() at the end of
> qcom_geni_serial_suspend() so that the runtime-suspend callback is
> always executed regardless of the usage count, and by calling
> pm_runtime_force_resume() at the start of qcom_geni_serial_resume()
> to restore those resources before uart_resume_port() re-opens the
> port.
>
> Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
> ---
[...]
> @@ -1963,7 +1964,19 @@ static int qcom_geni_serial_suspend(struct device *dev)
> geni_icc_set_tag(&port->se, QCOM_ICC_TAG_ACTIVE_ONLY);
> geni_icc_set_bw(&port->se);
> }
> - return uart_suspend_port(private_data->drv, uport);
> +
> + ret = uart_suspend_port(private_data->drv, uport);
> + if (ret)
> + return ret;
> +
> + /*
> + * When no_console_suspend is set the console must remain active
> + * across system sleep, so skip the force suspend path.
> + */
> + if (uart_console(uport) && !uport->suspended)
> + return 0;
Rather use console_suspend_enabled and take action to go force suspend.
Here, it sounds opposite, if port is resumed, you don't go to suspend
within suspend function.
> +
> + return pm_runtime_force_suspend(dev);
Is this really required ? if uart_suspend_port() successful, what will
happen with this ?
> }
>
[...]
next prev parent reply other threads:[~2026-07-01 15:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 5:57 [PATCH] serial: qcom-geni: add force suspend/resume to system sleep callbacks Praveen Talari
2026-07-01 15:17 ` Mukesh Savaliya [this message]
2026-07-02 2:48 ` Praveen Talari
2026-07-02 9:17 ` Mukesh Savaliya
2026-07-02 9:49 ` Praveen Talari
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=73243e36-175c-4fe3-a448-b30eef9c44ee@oss.qualcomm.com \
--to=mukesh.savaliya@oss.qualcomm.com \
--cc=aniket.randive@oss.qualcomm.com \
--cc=bjorn.andersson@oss.qualcomm.com \
--cc=chandana.chiluveru@oss.qualcomm.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=praveen.talari@oss.qualcomm.com \
/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