[linux-pm] A reference implementation of PCI suspend/resume?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
There are still many PCI drivers don't implement their .suspend/.resume
methods correctly. I felt it would be quite helpful there is a reference
implementation. Here is my thought:

.suspend()
{
	driver specific operations;
	pci_save_state();
	pci_enable_wake();
	/* as a result, PIC/IOAPIC pin is disabled */
	free_irq();
	/* as a result, bus master/irq router are disabled */
	pci_disable_device();
	pci_set_power_state();
}

.resume()
{
	pci_set_power_state(PCI_D0);
	pci_restore_state();
	/* device's irq possibly is changed, driver should take care */
	pci_enable_device();
	pci_set_master();
	request_irq();
	driver specific operations;
}

Currently many drivers don't call
free_irq/request_irq/pci_disable_device, which makes unexpected
interrupt occur and even break suspend/resume in some systems. The
reason is we disable PIC/IOAPIC/irq router very later (they are treated
as a sysdev), so there is a window between when a device is suspend and
when its PIC/IOAPIC/irq router pin are disabled. The ideal way is
PIC/IOAPIC/irq router's pins are disabled soon after no device is
referencing them. I'm now working on disabling irq router if no
reference on it, but first I'd like to know your opinions about the
proposal (the reference .suspend/.resume implementation).

Thanks,
Shaohua


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux