* Re: [Proposal]Another way to save/restore PCI config space for suspend/resume
[not found] ` <1098766257.8433.7.camel-U5EdaLXB8smDugQYiPIPGdh3ngVCH38I@public.gmane.org>
@ 2004-10-26 5:11 ` Andi Kleen
2004-10-26 6:11 ` [ACPI] " Len Brown
[not found] ` <20041026051100.GA5844-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2004-10-26 9:21 ` Pavel Machek
` (2 subsequent siblings)
3 siblings, 2 replies; 13+ messages in thread
From: Andi Kleen @ 2004-10-26 5:11 UTC (permalink / raw)
To: Li Shaohua
Cc: ACPI-DEV, lkml, Len Brown, greg-U8xfFu+wG4EAvxtiuMwx3w,
Pavel Machek
On Tue, Oct 26, 2004 at 12:50:57PM +0800, Li Shaohua wrote:
> Hi,
> We suffer from PCI config space issue for a long time, which causes many
> system can't correctly resume. Current Linux mechanism isn't sufficient.
> Here is a another idea:
> Record all PCI writes in Linux kernel, and redo all the write after
> resume in order. The idea assumes Firmware will restore all PCI config
This won't work very well for some cases. e.g. on AMD x86-64 the
IOMMU is flushed by setting/clearing a bit in PCI config space.
AGP implementations work similar. You really don't want to track
all these flushes, it would be far too costly.
> space to the boot time state, which is true at least for IA32.
>
> Reason:
> 1. Current PCI save/restore routines only cover first 64 bytes
The driver could set a flag if it wants more.
> 2. No PCI bridge driver currently.
That could be fixed I guess?
> 3. Some special devices can't or are difficult to save/restore config
> space with current model. Such as PCI link device, it's a sysdev, but
> its resume code can't be invoked with irq disabled.
In this case it would be IMHO better to have specialized suspend/resume
functions in the drivers for these oddball devices.
Most likely they will require some special handling anyways
(like special delays etc.) that can't be done by the generic code
> 4. ACPI possibly changes special devices' config space, such as host
> bridge or LPC bridge. The special devices generally are vender specific,
> and possibly will not have a driver forever.
I didn't get that one.
-Andi
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [ACPI] [Proposal]Another way to save/restore PCI config space for suspend/resume
2004-10-26 5:11 ` Andi Kleen
@ 2004-10-26 6:11 ` Len Brown
2004-10-26 8:42 ` Arjan van de Ven
[not found] ` <20041026051100.GA5844-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
1 sibling, 1 reply; 13+ messages in thread
From: Len Brown @ 2004-10-26 6:11 UTC (permalink / raw)
To: Andi Kleen; +Cc: Li, Shaohua, ACPI-DEV, lkml, greg, Pavel Machek
What this comes down to is that extended config space is device-specific.
Generic solutions will fail. Only device drivers will work.
If there are no drivers for PCI bridges to properly save/restore
their config space, then should create them, even if this is all the
drivers do.
-Len
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [ACPI] [Proposal]Another way to save/restore PCI config space for suspend/resume
2004-10-26 6:11 ` [ACPI] " Len Brown
@ 2004-10-26 8:42 ` Arjan van de Ven
[not found] ` <1098780150.2789.19.camel-PDvaWZGbcxh0dKo7RnIATNi2O/JbrIOy@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Arjan van de Ven @ 2004-10-26 8:42 UTC (permalink / raw)
To: Len Brown; +Cc: Andi Kleen, Li, Shaohua, ACPI-DEV, lkml, greg, Pavel Machek
On Tue, 2004-10-26 at 02:11 -0400, Len Brown wrote:
> What this comes down to is that extended config space is device-specific.
> Generic solutions will fail. Only device drivers will work.
>
> If there are no drivers for PCI bridges to properly save/restore
> their config space, then should create them, even if this is all the
> drivers do.
note that by default, if there is no driver, the first 64 bytes of
config space are saved/restored.
--
^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20041026051100.GA5844-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>]
* Re: [Proposal]Another way to save/restore PCI config space for suspend/resume
[not found] ` <20041026051100.GA5844-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
@ 2004-10-26 9:09 ` Li Shaohua
0 siblings, 0 replies; 13+ messages in thread
From: Li Shaohua @ 2004-10-26 9:09 UTC (permalink / raw)
To: Andi Kleen
Cc: ACPI-DEV, lkml, Len Brown, greg-U8xfFu+wG4EAvxtiuMwx3w,
Pavel Machek
On Tue, 2004-10-26 at 13:11, Andi Kleen wrote:
> On Tue, Oct 26, 2004 at 12:50:57PM +0800, Li Shaohua wrote:
> > Hi,
> > We suffer from PCI config space issue for a long time, which causes many
> > system can't correctly resume. Current Linux mechanism isn't sufficient.
> > Here is a another idea:
> > Record all PCI writes in Linux kernel, and redo all the write after
> > resume in order. The idea assumes Firmware will restore all PCI config
>
> This won't work very well for some cases. e.g. on AMD x86-64 the
> IOMMU is flushed by setting/clearing a bit in PCI config space.
> AGP implementations work similar. You really don't want to track
> all these flushes, it would be far too costly.
Possibly we can consider some optimizations, such as a driver can
explicitly disable the 'pci record'. The main problem we encountered is
the correctness of suspend/resume.
>
> > space to the boot time state, which is true at least for IA32.
> >
> > Reason:
> > 1. Current PCI save/restore routines only cover first 64 bytes
>
> The driver could set a flag if it wants more.
Extend PCI config space is device specific, general code can't do it.
> > 2. No PCI bridge driver currently.
>
> That could be fixed I guess?
if all PCI devices and bridges have drivers, this could be fixed. But I
think it's far away. Another issue here is the hierarchy of devices. A
device in the below of device tree doesn't means it must be resumed
later. Such as a PCI IRQ router, it must resume before all PCI devices.
>
> > 3. Some special devices can't or are difficult to save/restore config
> > space with current model. Such as PCI link device, it's a sysdev, but
> > its resume code can't be invoked with irq disabled.
>
> In this case it would be IMHO better to have specialized suspend/resume
> functions in the drivers for these oddball devices.
>
> Most likely they will require some special handling anyways
> (like special delays etc.) that can't be done by the generic code
>
> > 4. ACPI possibly changes special devices' config space, such as host
> > bridge or LPC bridge. The special devices generally are vender specific,
> > and possibly will not have a driver forever.
>
> I didn't get that one.
One case here is the ASL code will disable/enable EHCI per current OS
(such as disable EHCI if OS isn't win) in some systems. The
disable/enable bit is in ICH.
Thanks,
Shaohua
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Proposal]Another way to save/restore PCI config space for suspend/resume
[not found] ` <1098766257.8433.7.camel-U5EdaLXB8smDugQYiPIPGdh3ngVCH38I@public.gmane.org>
2004-10-26 5:11 ` Andi Kleen
@ 2004-10-26 9:21 ` Pavel Machek
[not found] ` <20041026092106.GC28897-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-10-27 1:32 ` Hiroshi 2 Itoh
2004-10-27 20:14 ` Rajesh Shah
3 siblings, 1 reply; 13+ messages in thread
From: Pavel Machek @ 2004-10-26 9:21 UTC (permalink / raw)
To: Li Shaohua; +Cc: ACPI-DEV, lkml, Len Brown, greg-U8xfFu+wG4EAvxtiuMwx3w
Hi!
> We suffer from PCI config space issue for a long time, which causes many
> system can't correctly resume. Current Linux mechanism isn't sufficient.
> Here is a another idea:
> Record all PCI writes in Linux kernel, and redo all the write after
> resume in order. The idea assumes Firmware will restore all PCI config
> space to the boot time state, which is true at least for IA32.
That looks extremely ugly to me. If you want to do something special
in resume function, just do it there. It will probably share a lot of
code with your init function, anyway.
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [Proposal]Another way to save/restore PCI config space for suspend/resume
[not found] ` <1098766257.8433.7.camel-U5EdaLXB8smDugQYiPIPGdh3ngVCH38I@public.gmane.org>
2004-10-26 5:11 ` Andi Kleen
2004-10-26 9:21 ` Pavel Machek
@ 2004-10-27 1:32 ` Hiroshi 2 Itoh
[not found] ` <OF7E38C2D0.FC23B846-ON49256F3A.000672D1-49256F3A.0007BB88-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>
2004-10-27 20:14 ` Rajesh Shah
3 siblings, 1 reply; 13+ messages in thread
From: Hiroshi 2 Itoh @ 2004-10-27 1:32 UTC (permalink / raw)
To: Li Shaohua
Cc: ACPI-DEV, greg-U8xfFu+wG4EAvxtiuMwx3w, Len Brown, lkml,
Pavel Machek
Hi,
acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org wrote on 2004/10/26 13:50:57:
> Hi,
> We suffer from PCI config space issue for a long time, which causes many
> system can't correctly resume. Current Linux mechanism isn't sufficient.
> Here is a another idea:
> Record all PCI writes in Linux kernel, and redo all the write after
> resume in order. The idea assumes Firmware will restore all PCI config
> space to the boot time state, which is true at least for IA32.
>
I think a basic problem of current Linux device model is that there is no
effective message path from sibling devices to their root device.
Although the message direction from a root device to sibling devices is
natural from the viewpoint of device enumeration, the direction from
sibling devices to a root device is required for effective arbitration for
device configuration and power management.
The Windows driver model uses the direction from sibling drivers to a root
bus driver mainly, i.e. sibling drivers are layered on a root bus driver.
While we need a kind of callback mechanism from PCI (sibling) devices to
PCI bus (root) device instead because their normal call interface is from a
root device to sibling devices.
- Hiro.
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [Proposal]Another way to save/restore PCI config space for suspend/resume
[not found] ` <1098766257.8433.7.camel-U5EdaLXB8smDugQYiPIPGdh3ngVCH38I@public.gmane.org>
` (2 preceding siblings ...)
2004-10-27 1:32 ` Hiroshi 2 Itoh
@ 2004-10-27 20:14 ` Rajesh Shah
3 siblings, 0 replies; 13+ messages in thread
From: Rajesh Shah @ 2004-10-27 20:14 UTC (permalink / raw)
To: Li Shaohua
Cc: ACPI-DEV, lkml, Len Brown, greg-U8xfFu+wG4EAvxtiuMwx3w,
Pavel Machek
On Tue, Oct 26, 2004 at 12:50:57PM +0800, Li Shaohua wrote:
> Hi,
> We suffer from PCI config space issue for a long time, which causes many
> system can't correctly resume. Current Linux mechanism isn't sufficient.
> Here is a another idea:
> Record all PCI writes in Linux kernel, and redo all the write after
> resume in order. The idea assumes Firmware will restore all PCI config
> space to the boot time state, which is true at least for IA32.
>
A large percentage of them may be irrelevant with respect to
suspend/resume (e.g. pci device tree and resource scan...). Apart
from the performance problems, generic code doing device specific
config accesses may have correctness problems. For example, you
will not be able to capture/replay config cycles or other device
specific initialization (e.g. using memory mapped IO) that BIOS may
have done before boot. This may be required for correct access to
device specific areas. The same thing is true about device specific
config accesses that may have been done by the corresponding
driver after boot. Without device specific knowledge, we may see
unpredictable behavior and non-repeatable and hard to debug problems.
I don't see how generic code can do the right thing for device
specific accesses. Devices like p2p bridges that have standard
definitions can be handled separately.
Rajesh
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread