Skip to contentSkip to conversation

S2RAM and PCI quirks

DISCUSSION Alan Cox 4 participants 5 messages Nov 8, 2006

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

I'm tracing down a case where suspend to ram/resume from RAM causes horrible corruption but not immediately. From a PCI dump it appears that we are not running the PCI quirks again on the S2RAM resume. Is this actually the case or am I missing something scanning through the code. If it is the case then we have multiple corruptors lurking because the PCI config restore doesn't cover the special registers that need poking in some cases.

Alan

#1 lore raw
Quoted 7 lines · Alan Cox

I'm tracing down a case where suspend to ram/resume from RAM causes horrible corruption but not immediately. From a PCI dump it appears that we are not running the PCI quirks again on the S2RAM resume. Is this actually the case or am I missing something scanning through the code. If it is the case then we have multiple corruptors lurking because the PCI config restore doesn't cover the special registers that need poking in some cases.

at the same time I'm not 100% convinced it's ok to always run all quirks at resume, for one the difference is that there now is a driver active owning the device... Almost sounds like having a per quirk flag stating "run at resume" is needed ;-(

(also I think the quirks are currently __init but that's relatively easy to fix)

Signature · 2 lines
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org
author
#2 lore raw

Ar Mer, 2006-11-08 am 16:48 +0100, ysgrifennodd Arjan van de Ven:

Quoted 4 lines

at the same time I'm not 100% convinced it's ok to always run all quirks at resume, for one the difference is that there now is a driver active owning the device... Almost sounds like having a per quirk flag stating "run at resume" is needed ;-(

We probably need a quirk class for resume in this situation. The kind of things that worry me if we are not doing the quirk handling, and what I suspect happened in the case I looked at are that chipset bug workarounds did not get restored, and in this case the older VIA chipset involved then corrupted DMA streams and trashed the users disk.

Quoted 2 lines

(also I think the quirks are currently __init but that's relatively easy to fix)

Some are yes, but not others.

Alan

#3 lore raw
Quoted 11 lines · Alan Cox

Ar Mer, 2006-11-08 am 16:48 +0100, ysgrifennodd Arjan van de Ven:

Quoted 4 lines

at the same time I'm not 100% convinced it's ok to always run all quirks at resume, for one the difference is that there now is a driver active owning the device... Almost sounds like having a per quirk flag stating "run at resume" is needed ;-(

We probably need a quirk class for resume in this situation. The kind of things that worry me if we are not doing the quirk handling, and what I suspect happened in the case I looked at are that chipset bug workarounds did not get restored, and in this case the older VIA chipset involved then corrupted DMA streams and trashed the users disk.

Now that would explain why many boxes resume from disk correctly, but don't resume from RAM by any means.

Greetings,
Rafael

Signature · 2 lines
You never change things by fighting the existing reality.
		R. Buckminster Fuller
#4 lore raw
Quoted 7 lines · Rafael J. Wysocki
Quoted 6 lines · Alan Cox

Ar Mer, 2006-11-08 am 16:48 +0100, ysgrifennodd Arjan van de Ven:

Quoted 4 lines

at the same time I'm not 100% convinced it's ok to always run all quirks at resume, for one the difference is that there now is a driver active owning the device... Almost sounds like having a per quirk flag stating "run at resume" is needed ;-(

Quoted 8 lines
Quoted 5 lines

We probably need a quirk class for resume in this situation. The kind of things that worry me if we are not doing the quirk handling, and what I suspect happened in the case I looked at are that chipset bug workarounds did not get restored, and in this case the older VIA chipset involved then corrupted DMA streams and trashed the users disk.

Now that would explain why many boxes resume from disk correctly, but don't resume from RAM by any means.

Well, there are other good reasons, too. (suspend-to-disk resume works with hardware in mostly-initialized state, while suspend-to-ram resume works with hardware in mostly-weird state). Yes, per-quirk "run me on resume-from-ram" is probably the way forward.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html