Re: [PATCH] spi: Gracefully handle power supplies with disabled PM

From: Mark Brown
Date: Mon Sep 17 2018 - 12:27:42 EST


On Mon, Sep 17, 2018 at 02:10:41PM +0200, Lubomir Rintel wrote:
> This allows use of SPI when power management is disables, such as on
> early boot;
>
> See also: commit 31eb74318054 ("PM / runtime: Fix handling of suppliers
> with disabled runtime PM")

> if (!was_busy && ctlr->auto_runtime_pm) {
> ret = pm_runtime_get_sync(ctlr->dev.parent);
> - if (ret < 0) {
> + if (ret < 0 && ret != -EACCES) {

No, this is not at all clever. If the device uses runtime PM and
doesn't get resumed then there is every likelyhood that the device won't
even be clocked. If users want to disable power management it's going
to need rather more work than just setting a flag.

Attachment: signature.asc
Description: PGP signature