Re: [PATCH 01/16] i3c: mipi-i3c-hci: Fix suspend behavior when bus disable falls back to software reset

From: Frank Li

Date: Fri Apr 17 2026 - 02:37:36 EST


On Thu, Apr 16, 2026 at 08:56:49PM +0300, Adrian Hunter wrote:
> Software reset was introduced as a fallback if bus disable failed. The
> change was made in 2 places: the cleanup path and the suspend path.
>
> For the cleanup path, after software reset the function continues to do
> cleanup for the current I/O mode.

Suppose this function,

static void i3c_hci_bus_cleanup(struct i3c_master_controller *m)
{
struct i3c_hci *hci = to_i3c_hci(m);

if (i3c_hci_bus_disable(hci))
i3c_hci_software_reset(hci);
hci->io->cleanup(hci);
}

"For the i3c_hci_bus_cleanup() ... "

> For the suspend path, after software
> reset the function returns early.

"But in i3c_hci_rpm_suspend() ..."

> However software reset does not reset
> any Ring Headers in the Host Controller, so returning early is not the
> right thing to do.
>
> Instead, continue to call suspend for the current I/O mode, which for DMA
> mode will reset any Ring Headers.
>
> Note, although Ring Headers should not be active at this stage, performing
> this reset follows the procedure defined by the specification and keeps
> the suspend path consistent with the cleanup path.

after your patch

i3c_hci_rpm_suspend()
{
ret = i3c_hci_bus_disable(hci);
if (ret)
ret = i3c_hci_software_reset(hci);
}

look like only remove call "i3c_hci_sync_irq_inactive()", how to make
consistent with the cleanup path and why remove this call is safe.

Frank
>
> Fixes: 9a258d1336f7 ("i3c: mipi-i3c-hci: Fallback to software reset when bus disable fails")
> Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> ---
> drivers/i3c/master/mipi-i3c-hci/core.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
> index b781dbed2165..bb8f2d830b0d 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
> @@ -765,16 +765,14 @@ int i3c_hci_rpm_suspend(struct device *dev)
> int ret;
>
> ret = i3c_hci_bus_disable(hci);
> - if (ret) {
> - /* Fall back to software reset to disable the bus */
> +
> + /* Fall back to software reset to disable the bus */
> + if (ret)
> ret = i3c_hci_software_reset(hci);
> - i3c_hci_sync_irq_inactive(hci);
> - return ret;
> - }
>
> hci->io->suspend(hci);
>
> - return 0;
> + return ret;
> }
> EXPORT_SYMBOL_GPL(i3c_hci_rpm_suspend);
>
> --
> 2.51.0
>