Sorry to late...

plm> Now suspend works. However still the disks keep spinning until they
plm> reach their BIOS timeout. In Linux & Windows, there is some hook when
plm> going to suspend mode that spins down the (IDE) disks. This is nice,
plm> since it is well possible that you go to suspend but do not set a disk
plm> spindown timeout.

I read linux source code closely again, I found their hack in 
IDE device driver.  Does anyone know this could make differences on
suspending?

>From linux/drivers/block/ide.c   Version 6.18  August 16, 1998:

void ide_intr (int irq, void *dev_id, struct pt_regs *regs)
{
        unsigned long flags;
        ide_hwgroup_t *hwgroup = (ide_hwgroup_t *)dev_id;
        ide_hwif_t *hwif;
        ide_drive_t *drive;
        ide_handler_t *handler;

        __cli();        /* local CPU only */
        spin_lock_irqsave(&hwgroup->spinlock, flags);
        hwif = hwgroup->hwif;
        if ((handler = hwgroup->handler) == NULL || hwgroup->poll_timeout != 0) {
                /*
                 * Not expecting an interrupt from this drive.
                 * That means this could be:
                 *      (1) an interrupt from another PCI device
                 *      sharing the same PCI INT# as us.
                 * or   (2) a drive just entered sleep or standby mode,
                 *      and is interrupting to let us know.
                 * or   (3) a spurious interrupt of unknown origin.
                 *
                 * For PCI, we cannot tell the difference,
                 * so in that case we just ignore it and hope it goes away.
                 */
#ifdef CONFIG_BLK_DEV_IDEPCI
                if (IDE_PCI_DEVID_EQ(hwif->pci_devid, IDE_PCI_DEVID_NULL))
#endif  /* CONFIG_BLK_DEV_IDEPCI */
                {
                        /*
                         * Probably not a shared PCI interrupt,
                         * so we can safely try to do something about it:
                         */
                        (void)ide_ack_intr(hwif->io_ports[IDE_STATUS_OFFSET], 
hwif->io_ports[IDE_IRQ_OFFSET]);
                        unexpected_intr(irq, hwgroup);
                }
                spin_unlock_irqrestore(&hwgroup->spinlock, flags);
                return;
        }

... but I've seen this kind of hack in wd device driver before.

How about spin down from userland (apmd) using camcontrol(8) like tool?


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to