From: Li Shaohua <shaohua.li@intel.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Andrew Morton <akpm@osdl.org>,
rjw@sisk.pl, lkml <linux-kernel@vger.kernel.org>,
Len Brown <len.brown@intel.com>
Subject: Re: 2.6.12-rc1-mm1: Kernel BUG at pci:389
Date: Tue, 22 Mar 2005 11:14:13 +0800 [thread overview]
Message-ID: <1111461253.18927.15.camel@sli10-desk.sh.intel.com> (raw)
In-Reply-To: <20050322013535.GA1421@elf.ucw.cz>
On Tue, 2005-03-22 at 09:35, Pavel Machek wrote:
> Hi!
>
> > > and that says:
> > >
> > > #define PMSG_FREEZE ((__force pm_message_t) 3)
> > >
> > > ... I certainly have _FREEZE defined as 1 in my local tree, but I
> do
> > > not see that change in -mm yet.
> >
> > Both 2.6.12-rc1-mm1 and 2.6.12-rc1 have:
> >
> > #define PMSG_FREEZE ((__force pm_message_t) 3)
> > #define PMSG_SUSPEND ((__force pm_message_t) 3)
> > #define PMSG_ON ((__force pm_message_t) 0)
> >
> > which looks odd.
>
> Yes, but it is needed. There are many drivers, and they look at
> numerical value of PMSG_*. I'm proceeding in steps. I hopefully killed
> all direct accesses to the constants, and will switch constants to
> something else... But that is going to be tommorow (need some sleep).
The patches are going to acquire correct PCI device sleep state for
suspend/resume. We discussed the issue several months ago. My plan is we
first introduce 'platform_pci_set_power_state', then merge the
'platform_pci_choose_state' patch after Pavel's pm_message_t conversion
finished. Maybe Len mislead my comments.
Anyway for the callback, my intend is platform_pci_choose_state accept
the pm_message_t parameter, and it return an 'int', since platform
method possibly failed and then pci_choose_state translate the return
value to pci_power_t.
> > > I reproduced it here.. I do not know who introduced
> > > platform_pci_choose_state, but it is *very* wrong. It returns
> > > it. Should it return pci_power_t? It probably should to match
> > > pci_choose_state, but that int is retyped to pm_message_t. Oops.
> >
> > That change came from Len. I've appended the two relevant patches
> below.
> >
> > So hm. We have incompatible changes in flight. That doesn't happen
> very
> > often.
> >
> > Could I suggest that you prepare a fixup against 2.6.12-rc1-mm1 and
> send
> > that to Len and myself? If that fixup is not suitable for a
> 2.6.12-rc1
> > based tree then I can look after it until things get flushed out.
>
> Could you just revert those two patches? First one is very
> wrong. Second one might be fixed, but... See comments below.
I think the platform_pci_set_power_state should be ok, did you see it
causes oops?
>
> And they are both "dangerous" -- they introduce new and untested
> functionality while I'm trying to transition from int to
> pm_message_t. They also affect all the drivers.
>
> Len, please Cc me on patches that affect suspend.
>
> > @@ -17,6 +17,7 @@
> > #include <acpi/acpi_bus.h>
> >
> > #include <linux/pci-acpi.h>
> > +#include "pci.h"
>
>
> Should be <linux/pci.h>?
I suppose it's not exported out side of PCI, so I used 'pci.h'
>
> > +static int acpi_pci_choose_state(struct pci_dev *pdev, pm_message_t
> state)
> > +{
>
> Should return pci_power_t, probably.
Should return int as I said above.
>
> > + char dstate_str[] = "_S0D";
> > + acpi_status status;
> > + unsigned long val;
> > + struct device *dev = &pdev->dev;
> > +
> > + /* Fixme: the check is wrong after pm_message_t is a struct */
>
> Exactly.
>
> > + if ((state >= PM_SUSPEND_MAX) || !DEVICE_ACPI_HANDLE(dev))
>
> PM_SUSPEND_MAX and friends is going to disappear.
Yep, this should be fixed.
>
> > + return -EINVAL;
> > + dstate_str[2] += state; /* _S1D, _S2D, _S3D, _S4D */
>
> Ugh, assumes numerical values of states actually meaning anything. It
> definitely should not. Should be switch(state.event), but that code
> is not merged, yet.... => I'll send code that switches pm_message_t to
> struct, tommorow. But it may compile-time break some obscure
> drivers...
>
> > diff -Nru a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> > --- a/drivers/pci/pci-acpi.c 2005-03-21 17:02:38 -08:00
> > +++ b/drivers/pci/pci-acpi.c 2005-03-21 17:02:38 -08:00
> > @@ -253,6 +253,24 @@
> > return -ENODEV;
> > }
> >
> > +static int acpi_pci_set_power_state(struct pci_dev *dev,
> pci_power_t state)
> > +{
> > + acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
> > + static int state_conv[] = {
> > + [0] = 0,
> > + [1] = 1,
> > + [2] = 2,
> > + [3] = 3,
> > + [4] = 3
> > + };
> > + int acpi_state = state_conv[(int __force) state];
>
> The table should be
> [PCI_D0] = 0,
> ...
Ok, please revert the 'platform_pci_choose_pci' patch, I will add it
after Pavel's conversion is finished. Or after Pavel's is done, I can
send a quick fix.
Thanks,
Shaohua
next prev parent reply other threads:[~2005-03-22 3:18 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-21 10:51 2.6.12-rc1-mm1 Andrew Morton
2005-03-21 17:05 ` 2.6.12-rc1-mm1 Brice Goglin
2005-03-21 17:09 ` 2.6.12-rc1-mm1 Jesse Barnes
2005-03-21 17:15 ` 2.6.12-rc1-mm1 Jesse Barnes
2005-03-21 20:25 ` 2.6.12-rc1-mm1 Adrian Bunk
2005-03-22 0:42 ` 2.6.12-rc1-mm1 Jesse Barnes
2005-03-22 6:50 ` 2.6.12-rc1-mm1 Arjan van de Ven
2005-03-22 9:18 ` 2.6.12-rc1-mm1 Adrian Bunk
2005-03-22 16:50 ` 2.6.12-rc1-mm1 Jesse Barnes
2005-03-21 20:20 ` 2.6.12-rc1-mm1 Russell King
2005-03-21 20:41 ` 2.6.12-rc1-mm1 Andrew Morton
2005-03-21 21:26 ` PCMCIA bugs in buglist [Was: Re: 2.6.12-rc1-mm1] Dominik Brodowski
2005-03-22 3:51 ` ALSA bugs in list [was " Lee Revell
2005-03-22 4:10 ` Andrew Morton
2005-03-22 4:16 ` Lee Revell
2005-03-22 4:23 ` Andrew Morton
2005-03-22 4:30 ` Lee Revell
2005-03-22 10:05 ` Takashi Iwai
2005-03-22 10:06 ` Jaroslav Kysela
2005-03-21 22:43 ` 2.6.12-rc1-mm1: Kernel BUG at pci:389 Rafael J. Wysocki
2005-03-22 0:03 ` Andrew Morton
2005-03-22 0:44 ` Pavel Machek
2005-03-22 1:06 ` Andrew Morton
2005-03-22 1:35 ` Pavel Machek
2005-03-22 1:49 ` Pavel Machek
2005-03-22 1:52 ` Andrew Morton
2005-03-22 2:07 ` Pavel Machek
2005-03-22 2:27 ` Andrew Morton
2005-03-22 7:21 ` Greg KH
2005-03-22 12:22 ` pm_message_t to struct conversion [was Re: 2.6.12-rc1-mm1: Kernel BUG at pci:389] Pavel Machek
2005-03-22 3:14 ` Li Shaohua [this message]
2005-03-22 4:04 ` 2.6.12-rc1-mm1: Kernel BUG at pci:389 Len Brown
2005-03-22 11:01 ` Pavel Machek
2005-03-22 21:49 ` 2.6.12-rc1-mm1: resume regression (was: Re: 2.6.12-rc1-mm1: Kernel BUG at pci:389) Rafael J. Wysocki
2005-03-23 22:29 ` 2.6.12-rc1-mm1: resume regression [update] " Rafael J. Wysocki
2005-03-23 22:39 ` Pavel Machek
2005-03-23 23:49 ` Rafael J. Wysocki
2005-03-24 1:03 ` Len Brown
2005-03-24 1:27 ` 2.6.12-rc1-mm1: resume regression [update] (was: " Li Shaohua
2005-03-24 13:42 ` Rafael J. Wysocki
2005-03-25 0:49 ` Li Shaohua
2005-03-25 11:19 ` Rafael J. Wysocki
2005-03-24 23:14 ` 2.6.12-rc1-mm1: resume regression [update] (was: Re: 2.6.12-rc1-mm1: " Rafael J. Wysocki
2005-03-22 11:00 ` 2.6.12-rc1-mm1: Kernel BUG at pci:389 Pavel Machek
2005-03-22 2:02 ` Dave Jones
2005-03-22 0:53 ` Pavel Machek
2005-03-22 12:22 ` [2.6 patch] fix net/ipv4/route.c with gcc 3.4 Adrian Bunk
2005-03-22 16:33 ` 2.6.12-rc1-mm1: hostap stack usage Adrian Bunk
2005-03-23 4:59 ` Jouni Malinen
2005-03-22 17:13 ` 2.6.12-rc1-mm1: REISER4_FS <-> 4KSTACKS Adrian Bunk
2005-03-22 17:50 ` Hans Reiser
2005-03-22 19:21 ` Adrian Bunk
2005-03-22 19:30 ` Jörn Engel
2005-03-22 20:15 ` Hans Reiser
2005-03-22 18:16 ` Arjan van de Ven
2005-03-22 18:56 ` Jörn Engel
2005-03-22 19:09 ` Jörn Engel
2005-03-22 19:17 ` Adrian Bunk
2005-03-24 3:10 ` [-mm patch] drivers/net/chelsio/osdep.h: small cleanups Adrian Bunk
2005-03-24 3:37 ` Christoph Lameter
2005-03-24 5:23 ` Randy.Dunlap
2005-03-24 5:32 ` Christoph Lameter
2005-03-24 5:36 ` Jeff Garzik
2005-03-22 12:13 2.6.12-rc1-mm1: Kernel BUG at pci:389 Li, Shaohua
2005-03-22 12:20 ` Pavel Machek
2005-03-24 1:29 ` Li Shaohua
2005-03-24 9:26 ` 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=1111461253.18927.15.camel@sli10-desk.sh.intel.com \
--to=shaohua.li@intel.com \
--cc=akpm@osdl.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--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
all inboxes | Powered by JetHome®