Re: [PATCH] i2c: designware: add reset control support in suspend/resume
From: Artem Shimko
Date: Mon Mar 23 2026 - 03:43:38 EST
Hi Andy,
On Wed, Mar 11, 2026 at 3:11 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> The second option is inline with the current approach in .prepare(),
> so at least it would be easier to sell to the maintainers.
>
> The first one will still require some ifdeffery if I am not mistaken.
> (Or at least the similar has_acpi_companion() check.)
Thank you very much for the review and for the suggestion.
I spent some time trying to implement the has_acpi_companion() approach.
has_acpi_companion() can be used inside the callbacks, but it cannot
change which callbacks (suspend vs. late_suspend)
are registered in the PM ops structure. For ACPI platforms, we must
keep LATE_SYSTEM_SLEEP_PM_OPS to support I2C operation
regions that may be accessed during suspend/resume of other devices
(as established by commit [1], found by my colleague). For DT
platforms,
LATE_SYSTEM_SLEEP_PM_OPS causes hangs because the reset controller is
not yet available at the late/early stage.
I agree that adding ifdefs is not ideal. I will prepare v2 that:
1. Moves reset control handling into runtime suspend/resume callbacks
(this makes sense and aligns better with the existing PM structure).
2. Keeps the conditional PM ops selection.
Let's look at the maintainers' opinion, maybe after that I will be
able to send v2.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20260317&id=541527728341b
--
Regards,
Artem