netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: netdev@oss.sgi.com
Subject: Race between suspend and open in network drivers?
Date: Sat, 23 Apr 2005 23:01:12 -0500	[thread overview]
Message-ID: <200504232301.12990.dtor_core@ameritech.net> (raw)

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

                 reply	other threads:[~2005-04-24  4:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200504232301.12990.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).