linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Handle PM_SUSPEND_TO_IDLE suspend_state_t
@ 2018-02-18 17:04 Hans de Goede
  2018-02-19 11:34 ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2018-02-18 17:04 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: Hans de Goede, linux-kernel

The regulator framework is used on x86 in some cases now and x86 has
a PM_SUSPEND_TO_IDLE suspend_state_t, treat this as PM_SUSPEND_STANDBY,
this fixes these errors on resume:

dpm_run_callback(): regulator_resume_early+0x0/0x60 returns -22
PM: Device regulator.0 failed to resume early: error -22

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/regulator/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index dd4708c58480..c980703ba705 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -333,6 +333,7 @@ regulator_get_suspend_state(struct regulator_dev *rdev, suspend_state_t state)
 		return NULL;
 
 	switch (state) {
+	case PM_SUSPEND_TO_IDLE:
 	case PM_SUSPEND_STANDBY:
 		return &rdev->constraints->state_standby;
 	case PM_SUSPEND_MEM:
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] regulator: core: Handle PM_SUSPEND_TO_IDLE suspend_state_t
  2018-02-18 17:04 [PATCH] regulator: core: Handle PM_SUSPEND_TO_IDLE suspend_state_t Hans de Goede
@ 2018-02-19 11:34 ` Mark Brown
  2018-02-19 20:59   ` Hans de Goede
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2018-02-19 11:34 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

On Sun, Feb 18, 2018 at 06:04:24PM +0100, Hans de Goede wrote:
> The regulator framework is used on x86 in some cases now and x86 has
> a PM_SUSPEND_TO_IDLE suspend_state_t, treat this as PM_SUSPEND_STANDBY,
> this fixes these errors on resume:

This was already fixed by Geert.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] regulator: core: Handle PM_SUSPEND_TO_IDLE suspend_state_t
  2018-02-19 11:34 ` Mark Brown
@ 2018-02-19 20:59   ` Hans de Goede
  2018-02-20 11:47     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2018-02-19 20:59 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, linux-kernel

Hi,

On 19-02-18 12:34, Mark Brown wrote:
> On Sun, Feb 18, 2018 at 06:04:24PM +0100, Hans de Goede wrote:
>> The regulator framework is used on x86 in some cases now and x86 has
>> a PM_SUSPEND_TO_IDLE suspend_state_t, treat this as PM_SUSPEND_STANDBY,
>> this fixes these errors on resume:
> 
> This was already fixed by Geert.

There are multiple callers of regulator_get_suspend_state() in
drivers/regulator/core.c, I assume you refer to this commit:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/regulator/core.c?id=57a0dd187956ea04870f4bbbf25a63c425ee7cad

Even with that commit I'm still seeing these errors on resume:

[  753.064002] dpm_run_callback(): regulator_resume_early+0x0/0x60 returns -22
[  753.064014] PM: Device regulator.0 failed to resume early: error -22

These are caused by the -EINVAL return after the
regulator_get_suspend_state() call in
_regulator_resume_early() and there are other callers
of regulator_get_suspend_state() which return -EINVAL
too.

I think just returning 0 in this case makes sense, but it
looks like that needs to be done in several places.

Regards,

Hans

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] regulator: core: Handle PM_SUSPEND_TO_IDLE suspend_state_t
  2018-02-19 20:59   ` Hans de Goede
@ 2018-02-20 11:47     ` Mark Brown
  2018-02-20 12:12       ` Hans de Goede
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2018-02-20 11:47 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 448 bytes --]

On Mon, Feb 19, 2018 at 09:59:13PM +0100, Hans de Goede wrote:
> On 19-02-18 12:34, Mark Brown wrote:

> There are multiple callers of regulator_get_suspend_state() in
> drivers/regulator/core.c, I assume you refer to this commit:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/regulator/core.c?id=57a0dd187956ea04870f4bbbf25a63c425ee7cad

No, he sent a second fix which isn't in Linus' tree yet, see my -next.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] regulator: core: Handle PM_SUSPEND_TO_IDLE suspend_state_t
  2018-02-20 11:47     ` Mark Brown
@ 2018-02-20 12:12       ` Hans de Goede
  2018-02-20 12:41         ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2018-02-20 12:12 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, linux-kernel

Hi,

On 20-02-18 12:47, Mark Brown wrote:
> On Mon, Feb 19, 2018 at 09:59:13PM +0100, Hans de Goede wrote:
>> On 19-02-18 12:34, Mark Brown wrote:
> 
>> There are multiple callers of regulator_get_suspend_state() in
>> drivers/regulator/core.c, I assume you refer to this commit:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/regulator/core.c?id=57a0dd187956ea04870f4bbbf25a63c425ee7cad
> 
> No, he sent a second fix which isn't in Linus' tree yet, see my -next.

I might just be looking at the wrong place and if so I'm sorry, but I
don't see any (additional) fixes related to this here:

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git/log/drivers/regulator?h=for-next

Regards,

Hans

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] regulator: core: Handle PM_SUSPEND_TO_IDLE suspend_state_t
  2018-02-20 12:12       ` Hans de Goede
@ 2018-02-20 12:41         ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2018-02-20 12:41 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

On Tue, Feb 20, 2018 at 01:12:08PM +0100, Hans de Goede wrote:

> I might just be looking at the wrong place and if so I'm sorry, but I
> don't see any (additional) fixes related to this here:

Seems to have got stuck somewhere, sorry - pushed now.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-20 12:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-18 17:04 [PATCH] regulator: core: Handle PM_SUSPEND_TO_IDLE suspend_state_t Hans de Goede
2018-02-19 11:34 ` Mark Brown
2018-02-19 20:59   ` Hans de Goede
2018-02-20 11:47     ` Mark Brown
2018-02-20 12:12       ` Hans de Goede
2018-02-20 12:41         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).