All of lore.kernel.org
 help / color / mirror / Atom feed
* Race between suspend and open in network drivers?
@ 2005-04-24  4:01 Dmitry Torokhov
  0 siblings, 0 replies; only message in thread
From: Dmitry Torokhov @ 2005-04-24  4:01 UTC (permalink / raw)
  To: netdev

Hi,

I have a question regarding possible race between suspend and open
methods in most network drivers. Consider b44 for example:

static int b44_suspend(struct pci_dev *pdev, pm_message_t state)
{
        struct net_device *dev = pci_get_drvdata(pdev);
        struct b44 *bp = netdev_priv(dev);

        if (!netif_running(dev))
                 return 0;

Why can we just check netif_running and bail out? What stops 2nd CPU
from getting into b44_open right then and set up the device and we'll
get into suspend with device fully set up and DMAing...

Come to think of it it's not even a race since b44_open does not even
check if device is suspended. I must be missing something... Do we rely
on userland being completely stopped while suspending? But what about
suspend to ram (IIRC we don't stop userlan there) or selective suspend? 

Thanks!

-- 
Dmitry

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-04-24  4:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-24  4:01 Race between suspend and open in network drivers? Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.