From: Frank Li <Frank.li@nxp.com>
To: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Cc: git@amd.com, alexandre.belloni@bootlin.com,
wsa+renesas@sang-engineering.com, quic_msavaliy@quicinc.com,
Shyam-sundar.S-k@amd.com, xiaopei01@kylinos.cn,
billy_tsai@aspeedtech.com, linux-i3c@lists.infradead.org,
linux-kernel@vger.kernel.org, michal.simek@amd.com,
radhey.shyam.pandey@amd.com, srinivas.goud@amd.com,
shubhrajyoti.datta@amd.com, manion05gk@gmail.com
Subject: Re: [PATCH] i3c: dw: Add shutdown support to dw_i3c_master driver
Date: Tue, 29 Jul 2025 10:14:38 -0400 [thread overview]
Message-ID: <aIjXTiLHoCo2cJFi@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20250728104425.3878770-1-manikanta.guntupalli@amd.com>
On Mon, Jul 28, 2025 at 04:14:25PM +0530, Manikanta Guntupalli wrote:
> Add shutdown handler to the Synopsys DesignWare I3C master driver,
> ensuring the device is gracefully disabled during system shutdown.
>
> The shutdown handler cancels any pending hot-join work and disables
> interrupts.
>
> Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
> ---
> drivers/i3c/master/dw-i3c-master.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index ae1992665673..6769def5580a 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1762,6 +1762,29 @@ static const struct dev_pm_ops dw_i3c_pm_ops = {
> SET_RUNTIME_PM_OPS(dw_i3c_master_runtime_suspend, dw_i3c_master_runtime_resume, NULL)
> };
>
> +static void dw_i3c_shutdown(struct platform_device *pdev)
> +{
> + struct dw_i3c_master *master = platform_get_drvdata(pdev);
> + int ret;
> +
> + ret = pm_runtime_resume_and_get(master->dev);
> + if (ret < 0) {
> + dev_err(master->dev,
> + "<%s> cannot resume i3c bus master, err: %d\n",
> + __func__, ret);
> + return;
> + }
> +
> + cancel_work_sync(&master->hj_work);
> +
> + /* Disable interrupts */
> + writel((u32)~INTR_ALL, master->regs + INTR_STATUS_EN);
> + writel((u32)~INTR_ALL, master->regs + INTR_SIGNAL_EN);
> +
> + pm_runtime_mark_last_busy(master->dev);
Needn't call pm_runtime_mark_last_busy() now
See: https://lore.kernel.org/linux-pm/20250704075225.3212486-1-sakari.ailus@linux.intel.com/
Frank
> + pm_runtime_put_autosuspend(master->dev);
> +}
> +
> static const struct of_device_id dw_i3c_master_of_match[] = {
> { .compatible = "snps,dw-i3c-master-1.00a", },
> {},
> @@ -1777,6 +1800,7 @@ MODULE_DEVICE_TABLE(acpi, amd_i3c_device_match);
> static struct platform_driver dw_i3c_driver = {
> .probe = dw_i3c_probe,
> .remove = dw_i3c_remove,
> + .shutdown = dw_i3c_shutdown,
> .driver = {
> .name = "dw-i3c-master",
> .of_match_table = dw_i3c_master_of_match,
> --
> 2.34.1
>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
prev parent reply other threads:[~2025-07-29 14:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-28 10:44 [PATCH] i3c: dw: Add shutdown support to dw_i3c_master driver Manikanta Guntupalli
2025-07-29 14:14 ` Frank Li [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=aIjXTiLHoCo2cJFi@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=alexandre.belloni@bootlin.com \
--cc=billy_tsai@aspeedtech.com \
--cc=git@amd.com \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manikanta.guntupalli@amd.com \
--cc=manion05gk@gmail.com \
--cc=michal.simek@amd.com \
--cc=quic_msavaliy@quicinc.com \
--cc=radhey.shyam.pandey@amd.com \
--cc=shubhrajyoti.datta@amd.com \
--cc=srinivas.goud@amd.com \
--cc=wsa+renesas@sang-engineering.com \
--cc=xiaopei01@kylinos.cn \
/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