Messages in this thread | | | Date | Sun, 2 Nov 2003 11:12:54 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH] Add PM support to sis900 network driver |
| |
Daniele Venzano <webvenza@libero.it> wrote: > > The attached patch adds support for suspend/resume to the sis900 driver.
...
> +static int sis900_suspend(struct pci_dev *pci_dev, u32 state) > +{ > + struct net_device *net_dev = pci_get_drvdata(pci_dev); > + struct sis900_private *sis_priv = net_dev->priv; > + long ioaddr = net_dev->base_addr; > + unsigned long flags; > + > + if(!netif_running(net_dev)) > + return 0; > + netif_stop_queue(net_dev); > + > + netif_device_detach(net_dev); > + spin_lock_irqsave(&sis_priv->lock, flags); > + > + /* Stop the chip's Tx and Rx Status Machine */ > + outl(RxDIS | TxDIS | inl(ioaddr + cr), ioaddr + cr); > + > + pci_set_power_state(pci_dev, 3);
pci_set_power_state() can sleep, so we shouldn't be calling it under spin_lock_irqsave(). Is it necessary to hold the lock here? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |