From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: michal.k.k.piotrowski@gmail.com, rbrito@gmail.com,
krh@redhat.com, linux-kernel@vger.kernel.org, rjw@sisk.pl,
linuxppc-dev@ozlabs.org, debian-powerpc@lists.debian.org,
linux-pm@lists.linux-foundation.org, rael@edge.ping.de
Subject: Re: Sleep problems with kernels >= 2.6.21 on powerpc
Date: Wed, 5 Sep 2007 22:12:17 +0200 (CEST) [thread overview]
Message-ID: <tkrat.29a16d2ec8698ff2@s5r6.in-berlin.de> (raw)
In-Reply-To: <20070905124411.bc15f48c.akpm@linux-foundation.org>
On 5 Sep, Andrew Morton wrote:
>> On Wed, 05 Sep 2007 19:47:42 +0200 Stefan Richter <stefanr@s5r6.in-berlin.de> wrote:
>> >>> Trying to free already-free IRQ 40
>> >>> pci_set_power_state(): 0002:20:0e.0: state=3, current state=5
>> >>> firewire_ohci: pci_set_power_state failed with -22<3>pci_device_suspend(): pci_suspend+0x0/0x9c [firewire_ohci]() returns -22
...
>> The old ohci1394.c used to ignore pci_set_power_state's return value.
>> In the pre 2.6.19-rc1 commit ea6104c22468239083857fa07425c312b1ecb424, I
>> added a fail-on-error. This was toned down to a printk-on-err by pre
>> 2.6.19-rc4 commit 346f5c7ee7fa4ebee0e4c96415a7e59716bfa1d0.
>
> OK.
>
>> This was because of Benjamin Herrenschmidt's regression report:
>> http://lkml.org/lkml/2006/10/24/13
>
> It's not clear _why_ pci_set_power_state() is failing.
The only -22 error path in pci_set_power_state is this:
/* Validate current state:
* Can enter D0 from any state, but if we can only go deeper
* to sleep if we're already in a low power state
*/
if (state != PCI_D0 && dev->current_state > state) {
printk(KERN_ERR "%s(): %s: state=%d, current state=%d\n",
__FUNCTION__, pci_name(dev), state, dev->current_state);
return -EINVAL;
} [...else...]
(There seems to be one "if" too many in the comment.)
dev->current_state was PCI_UNKNOWN, and this is not properly handled by
pci_set_power_state. Some checks later, there is
switch (dev->current_state) {
case PCI_D0:
case PCI_D1:
case PCI_D2:
pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
pmcsr |= state;
break;
case PCI_UNKNOWN: /* Boot-up */
if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot
&& !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET))
need_restore = 1;
/* Fall-through: force to D0 */
default:
pmcsr = 0;
break;
}
But the PCI_UNKNOWN branch will never be reached because of the if ()
clause quoted above.
Also, this FireWire controller here surely had left the boot-up phase
already long ago when the reporter tried to suspend the machine.
--
Stefan Richter
-=====-=-=== =--= --=-=
http://arcgraph.de/sr/
next prev parent reply other threads:[~2007-09-05 20:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-26 2:37 Sleep problems with kernels >= 2.6.21 on powerpc Rogério Brito
2007-08-26 23:21 ` Michal Piotrowski
2007-08-27 6:52 ` Rogério Brito
2007-08-27 7:14 ` Tim Teulings
2007-08-30 20:42 ` Tim Teulings
2007-09-05 17:07 ` Andrew Morton
2007-09-05 17:28 ` Randy Dunlap
2007-09-05 17:43 ` Stefan Richter
2007-09-05 17:58 ` Randy Dunlap
2007-09-05 17:47 ` Stefan Richter
2007-09-05 18:06 ` [PATCH] " Stefan Richter
2007-09-05 18:24 ` Stefan Richter
2007-09-05 19:01 ` firewire in prebuilt kernel packages (was Re: Sleep problems with kernels >= 2.6.21 on powerpc) Stefan Richter
2007-09-05 19:44 ` Sleep problems with kernels >= 2.6.21 on powerpc Andrew Morton
2007-09-05 20:12 ` Stefan Richter [this message]
2007-09-06 7:50 ` [PATCH update] " Stefan Richter
2007-08-27 8:37 ` Michel Dänzer
2007-08-27 9:55 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tkrat.29a16d2ec8698ff2@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=akpm@linux-foundation.org \
--cc=debian-powerpc@lists.debian.org \
--cc=krh@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=michal.k.k.piotrowski@gmail.com \
--cc=rael@edge.ping.de \
--cc=rbrito@gmail.com \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).