[PATCH v3 0/2] firmware: exynos-acpm: allow use during system shutdown

André Draszik posted 2 patches 8 months, 3 weeks ago
drivers/firmware/samsung/exynos-acpm.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
[PATCH v3 0/2] firmware: exynos-acpm: allow use during system shutdown
Posted by André Draszik 8 months, 3 weeks ago
One user of this ACPM driver is a PMIC driver that needs to communicate
with the PMIC during late system shutdown [1] and at that time we are
not allowed to sleep anymore.

This series address this by switching the code to using udelay() in the
specific case of system shutdown. This approach was inspired by I2C's
i2c_in_atomic_xfer_mode(), which has to deal with a similar corner
case.

Link: https://lore.kernel.org/all/20250323-s2mpg10-v1-29-d08943702707@linaro.org/ [1]

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
Changes in v3:
- switch to unconditional udelay() (Krzysztof)
- Link to v2: https://lore.kernel.org/r/20250324-acpm-atomic-v2-0-7d87746e1765@linaro.org

Changes in v2:
- add missing ktime.h include
- switch to ktime_before() instead of !ktime_after()
- add link to user requiring this change to cover letter
- collect Tudor's Rb
- Link to v1: https://lore.kernel.org/r/20250321-acpm-atomic-v1-0-fb887bde7e61@linaro.org

---
André Draszik (2):
      firmware: exynos-acpm: use ktime APIs for timeout detection
      firmware: exynos-acpm: allow use during system shutdown

 drivers/firmware/samsung/exynos-acpm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
---
base-commit: 9388ec571cb1adba59d1cded2300eeb11827679c
change-id: 20250321-acpm-atomic-033775b051ef

Best regards,
-- 
André Draszik <andre.draszik@linaro.org>

Re: [PATCH v3 0/2] firmware: exynos-acpm: allow use during system shutdown
Posted by Krzysztof Kozlowski 8 months, 2 weeks ago
On Tue, 25 Mar 2025 09:46:06 +0000, André Draszik wrote:
> One user of this ACPM driver is a PMIC driver that needs to communicate
> with the PMIC during late system shutdown [1] and at that time we are
> not allowed to sleep anymore.
> 
> This series address this by switching the code to using udelay() in the
> specific case of system shutdown. This approach was inspired by I2C's
> i2c_in_atomic_xfer_mode(), which has to deal with a similar corner
> case.
> 
> [...]

Applied, thanks!

[1/2] firmware: exynos-acpm: use ktime APIs for timeout detection
      https://git.kernel.org/krzk/linux/c/d2098981eb7b7d20edd294a8431908f8a0d2f9c0
[2/2] firmware: exynos-acpm: allow use during system shutdown
      https://git.kernel.org/krzk/linux/c/2d14c680e92f09d18b984cd1a8fae437f9ebc2ab

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Re: [PATCH v3 0/2] firmware: exynos-acpm: allow use during system shutdown
Posted by André Draszik 8 months, 3 weeks ago
On Tue, 2025-03-25 at 09:46 +0000, André Draszik wrote:
> One user of this ACPM driver is a PMIC driver that needs to communicate
> with the PMIC during late system shutdown [1] and at that time we are
> not allowed to sleep anymore.
> 
> This series address this by switching the code to using udelay() in the
> specific case of system shutdown. This approach was inspired by I2C's
> i2c_in_atomic_xfer_mode(), which has to deal with a similar corner
> case.

Looks like I forgot to update the paragraph here. As of v3, we
now use udelay() unconditionally, instead of the fragile approach
inspired by I2C, as suggested by Krzysztof.

A.

> 
> Link: https://lore.kernel.org/all/20250323-s2mpg10-v1-29-d08943702707@linaro.org/ [1]
> 
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
> Changes in v3:
> - switch to unconditional udelay() (Krzysztof)
> - Link to v2: https://lore.kernel.org/r/20250324-acpm-atomic-v2-0-7d87746e1765@linaro.org
> 
> Changes in v2:
> - add missing ktime.h include
> - switch to ktime_before() instead of !ktime_after()
> - add link to user requiring this change to cover letter
> - collect Tudor's Rb
> - Link to v1: https://lore.kernel.org/r/20250321-acpm-atomic-v1-0-fb887bde7e61@linaro.org
> 
> ---
> André Draszik (2):
>       firmware: exynos-acpm: use ktime APIs for timeout detection
>       firmware: exynos-acpm: allow use during system shutdown
> 
>  drivers/firmware/samsung/exynos-acpm.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> ---
> base-commit: 9388ec571cb1adba59d1cded2300eeb11827679c
> change-id: 20250321-acpm-atomic-033775b051ef
> 
> Best regards,