Re: [PATCH] SCSI midlayer power management

From: James Bottomley
Date: Wed Aug 11 2004 - 08:39:44 EST


On Wed, 2004-08-11 at 08:13, Nathan Bryant wrote:
> No. Remember that DMA works differently under SCSI than it does under
> IDE. SCSI DMA is a host controller feature, whereas under IDE it is
> enabled/disabled at the drive level and the drives have special
> knowledge of DMA. Since generic_scsi_suspend() is the device level
> suspend routine, it is called before the host controller's suspend
> routine, (due to depth first traversal of device tree), which is
> responsible for disabling the PCI slot. Only after the host controller
> is suspended will there be no DMA, but if your real question is "can I
> generically control a SCSI disk with PIO for software suspend" then the
> answer is NO. For purposes of not suspending the drivers, I haven't
> looked into how swsusp would see which host adapter owns which drive,
> but some of the required information seems to be present in sysfs.

Actually, the answer is to most intents and purposes "yes". You are
technically correct: there's no way to disable DMA in SCSI. However,
once a device is quiesced, it has no outstanding commands, so there will
be no outstanding DMA to that device. When all devices on a host have
been quiesced, then there will be no DMA at all going on *except* if the
user initiates any via another interface (like sending a device probe or
doing a unit scan). The guarantee should be strong enough for swsusp to
proceed, but we can look at quiescing a host properly (however, we'd
need to move to a better host state model than we currently possess).

James


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/