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

From: Adrian Hunter

Date: Thu Apr 16 2026 - 14:02:13 EST


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. For the suspend path, after software
reset the function returns early. 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.

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