Am Donnerstag, 1. August 2024, 17:31:33 CEST schrieb Dmitry Osipenko:
On 7/30/24 21:05, Sebastian Reichel wrote:
- /*
* Currently the Rockchip SPI driver always sleeps when doing SPI
* transfers. This is not allowed in the SYS_OFF_MODE_POWER_OFF
* handler, so we are using the prepare handler as a workaround.
* This should be removed once the Rockchip SPI driver has been
* adapted.
*/
- if (is_spi)
pwr_off_mode = SYS_OFF_MODE_POWER_OFF_PREPARE;
This prevents the syscore_shutdown() step from execution. Is it better than not powering off?
I'd rather skip registration of the power-off handlers in a case of SPI :)
Or blasphemous thought, we could live with the warning-splash for a bit.
From Sebastian's log I assume the WARNING comes from the wait_for_completion() in spi_transfer_wait(), and I guess the transfer with the poweroff command itself will already have happened then?
So the device is most likely still powered off in that case? Not sure how much of "bad taste" that thought is though ;-)
Heiko
[0] https://elixir.bootlin.com/linux/v6.10.2/source/drivers/spi/spi.c#L1671