[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aQjMt8ba7+7emopP@lizhi-Precision-Tower-5810>
Date: Mon, 3 Nov 2025 10:39:35 -0500
From: Frank Li <Frank.li@....com>
To: adrianhoyin.ng@...era.com
Cc: alexandre.belloni@...tlin.com, wsa+renesas@...g-engineering.com,
	robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
	dinguyen@...nel.org, linux-i3c@...ts.infradead.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 3/3] i3c: dw: Add runtime PM disable quirk for Altera
 Agilex5
On Mon, Nov 03, 2025 at 05:24:28PM +0800, adrianhoyin.ng@...era.com wrote:
> From: Adrian Ng Ho Yin <adrianhoyin.ng@...era.com>
>
> When running compliance tests on the Altera Agilex5 SoCFPGA platform,
> it was observed that the I3C bus could enter a hung state when a slave
> device issues an IBI after the DAA process completes. This occurs
> because the DesignWare I3C master controller enters runtime suspend
> once the DAA sequence finishes, causing it to stop driving the SCL
> line. As a result, the IBI transfer cannot complete, leaving the SDA
> line stuck low and the bus in a hung state.
>
> To address this, introduce a new compatible string,
> "altr,agilex5-dw-i3c-master", that applies a quirk to disable runtime
> PM for this platform. The quirk keeps the controller enabled by calling
> pm_runtime_get_noresume() during probe and balancing it with
> pm_runtime_put_noidle() during remove.
>
> This ensures that the controller remains active and avoids bus hangs
> triggered by IBIs while maintaining normal behavior for other platforms.
>
suggest commit message
i3c: dw: Disable runtime PM on Agilex5 to avoid bus hang on IBI
When running compliance tests on the Altera Agilex5 SoCFPGA platform,
the I3C bus can hang when a slave issues an IBI after the DAA process
completes. The DesignWare I3C master enters runtime suspend once DAA
finishes and stops driving SCL, preventing the IBI transfer from
completing and leaving SDA stuck low.
Add a new compatible string, "altr,agilex5-dw-i3c-master" and apply a quirk
that keep runtime PM always active on this platform by calling
pm_runtime_get_noresume() during probe.
Prevent bus hangs triggered by IBIs on Agilex5 while maintaining keep the
same behavior on other platforms.
> Signed-off-by: Adrian Ng Ho Yin <adrianhoyin.ng@...era.com>
> ---
>  drivers/i3c/master/dw-i3c-master.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index 9ceedf09c3b6..5913822648ca 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -228,6 +228,7 @@
>
>  /* List of quirks */
>  #define AMD_I3C_OD_PP_TIMING		BIT(1)
> +#define DW_I3C_DISABLE_RUNTIME_PM_QUIRK	BIT(2)
>
>  struct dw_i3c_cmd {
>  	u32 cmd_lo;
> @@ -1592,6 +1593,10 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
>
>  	master->quirks = (unsigned long)device_get_match_data(&pdev->dev);
>
> +	/* Keep controller enabled by preventing runtime suspend */
> +	if (master->quirks & DW_I3C_DISABLE_RUNTIME_PM_QUIRK)
> +		pm_runtime_get_noresume(&pdev->dev);
> +
>  	INIT_WORK(&master->hj_work, dw_i3c_hj_work);
>  	ret = i3c_master_register(&master->base, &pdev->dev,
>  				  &dw_mipi_i3c_ops, false);
> @@ -1617,6 +1622,10 @@ void dw_i3c_common_remove(struct dw_i3c_master *master)
>  	cancel_work_sync(&master->hj_work);
>  	i3c_master_unregister(&master->base);
>
> +	/* Balance pm_runtime_get_noresume() from probe() */
> +	if (master->quirks & DW_I3C_DISABLE_RUNTIME_PM_QUIRK)
> +		pm_runtime_put_noidle(master->dev);
> +
>  	pm_runtime_disable(master->dev);
>  	pm_runtime_set_suspended(master->dev);
>  	pm_runtime_dont_use_autosuspend(master->dev);
> @@ -1761,6 +1770,9 @@ static void dw_i3c_shutdown(struct platform_device *pdev)
>
>  static const struct of_device_id dw_i3c_master_of_match[] = {
>  	{ .compatible = "snps,dw-i3c-master-1.00a", },
> +	{ .compatible = "altr,agilex5-dw-i3c-master",
> +	  .data = (void *)DW_I3C_DISABLE_RUNTIME_PM_QUIRK,
> +	},
use const struct to get better extenable.
struct dw_i3c_drvdata {
	u32 flags;
}
const struct dw_i3c_drvdata altr_agilex5_drvdata = {
	.flags = DW_I3C_DISABLE_RUNTIME_PM_QUIRK,
};
...
{ .compatible = "altr,agilex5-dw-i3c-master", .data = &altr_agilex5_drvdata, }
Frank
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, dw_i3c_master_of_match);
> --
> 2.49.GIT
>
Powered by blists - more mailing lists