Re: [PATCH] SCSI midlayer power management

Benjamin Herrenschmidt
2004-08-12T23:17:49Z

On Fri, 2004-08-13 at 05:34, James Bottomley wrote:
> On Thu, 2004-08-12 at 15:11, Pavel Machek wrote:
> > Ok, but what happens on next resume? If coherent mbox is at exactly
> > same place at every boot I guess it could even work, but...
>
> Er, well this is a huge problem then. Even if DMA were stopped, the
> registers for all these locations need to be altered to change the
> location of the DMA mboxes. This isn't just a SCSI problem, it's a
> general device problem (most devices having mboxes programmed by
> register). If we can't rely on the resuming kernel setting up these
> registers for us to exactly what they were in the resume image, then
> we're in a bit of trouble.

Ugh ? What do you mean ? The suspend kernel will snapshot the kernel
memory at one point, after the device suspend call has been done. If
the device relies on some changes done after that, then it's broken
somewhat.

The resume will restore all memory, not MMIO of course, and it's up
to the driver to do whatever is necessary to restore operations
properly.

> Architecturally what you are trying to do is to re POST the SCSI card.
> Except it's the kernel's job to POST it, so the kernel init code needs
> to be re-run. I assume that's what the pci suspend/resume calls are
> supposed to do?

Yes.

The problem is the same with suspend-to-RAM basically.

Ben.