Re: [BUG] sdhci regression in 2.6.21-rc2

Mark Lord
2007-03-05T15:35:36Z

Pierre Ossman wrote:
> Pierre Ossman wrote:
>> I'd say it's the kernel calling the interrupt handler of a
>> currently sleeping device. Since we're seeing this problem I assume the
>> kernel's interrupt code isn't aware of PM states?
>
> Hmm... I guess it can't be as the interrupt handler isn't associated with a
> device, just a random pointer.
>
> So either release the interrupt (which seems a bit unsafe as then we might not
> get it back), or handle states at the start of the isr.

>From linux/Documentation/power/pci.txt:

> A reference implementation
> -------------------------
> .suspend()
> {
> /* driver specific operations */
>
> /* Disable IRQ */
> free_irq();
> /* If using MSI */
> pci_disable_msi();
>
> pci_save_state();
> pci_enable_wake();
> /* Disable IO/bus master/irq router */
> pci_disable_device();
> pci_set_power_state(pci_choose_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();
>
> /* if using MSI, device's vector possibly is changed */
> pci_enable_msi();
>
> request_irq();
> /* driver specific operations; */
> }