On Sunday 26 September 2004 2:10 am, Pavel Machek wrote:
> Hi!
>
> > > > > The meaning of the power states is unclear, particularly for
> > > > > buses that don't support all the PCI states.
> > > >
> > > > Well, in suspend I'm currently only using 0/3, where 0 is on, and 3 is
> > > > suspended.
> >
> > You should be using PM_SUSPEND_ON and PM_SUSPEND_DISK,
> > not 0/3 ... PM_SUSPEND_MEM is used in other parts of suspend.
> > See the attached patch, resolving a pmcore abuse of the
> > PCI selective suspend routines ...
>
> You are patching against very old kernel. Take a look at -mm...
Since when is "current Linus BK" getting called "very old" ?? :)
>
> enum suspend_state {
> PM_SUSPEND_ON = 0,
> PM_SUSPEND_STANDBY = 1,
With the next one being a problem, since it gets passed
through the PCI layer as PCI D2 and interepreted globally.
The enum values still need to be changed ...
> PM_SUSPEND_MEM = 2,
> PM_SUSPEND_DISK = 3,
> PM_SUSPEND_MAX,
> };
>
>
> > > > What should be done is convert that interface to enums or
> > > > some kind of structure, probably solving per-device suspend at the
> > > > same time. I'd prefer drivers to ignore that parameter for now.
> >
> > Too late for that. PCI drivers have been using it since 2.4 ... though
> > not all of them. Just enough to make lots of trouble. :)
>
> Well, ok, but try not to create any new users. I believe that with
> change above, we made all of them reasonably happy.
Erm, no. Switching to enums is fine; but it's essentially just a doc
fix. But the problems noted in the patch comments are going to
be there until the enum VALUES get fixed ... you showed they aren't.
> > Changes the PM_SUSPEND_MEM (and PM_SUSPEND_DISK) enum values so that
> > they make sense as PCI device power states.
>
> > (a) Fixes bugs whereby PCI drivers are being given bogus values.
> > The should resolve OSDL bugid 2886 without changing the PCI
> > API (its PM calls still act as on 2.4 kernels).
> >
> > (b) Doesn't change the awkward assumption in the 2.6 PMcore that
> > the /sys/bus/*/devices/power/state, /proc/acpi/sleep,
> > dev->power.power_state, and dev->detach_state files share
> > the same numeric codes ... even for busses very unlike PCI,
> > or systems with several "on" policies as well as STD and STR.
> >
> > Really we need to move away from "u32" codes that are easily confused
> > with each other, towards typed values (probably struct pointers), but
> > this is the simplest comprehensive fix for the PCI problem.
> >
> > Signed-off-by: David Brownell <[EMAIL PROTECTED]>
>
> Please take a look at latest -mm kernel. It should have most issues
> solved.
Clearly not the "enum values" issue. You can't otherwise fix (a)
without breaking (b), which makes for a lot of subtle bugs. I think
Patrick had said he was going to merge the enum change (Linus
liked the idea), but there was an armload of swsusp/pmdisk merge
updates that were floating in Andrew's patches but which weren't
yet merged in the bk-power.patch. I got the impression that would
be an obstacle to merging the bk-power patchset into Linus' tree.
- Dave
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel