netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: mike@marineau.org
Cc: oliver@hartkopp.net, jaswinder@infradead.org, jgarzik@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-next@vger.kernel.org, mchan@broadcom.com
Subject: Re: [PATCH -net-next 3/4] firmware: convert tg3 driver to request_firmware()
Date: Mon, 12 Jan 2009 16:10:54 -0800 (PST)	[thread overview]
Message-ID: <20090112.161054.180487472.davem@davemloft.net> (raw)
In-Reply-To: <20090107230624.GA6894@porter.dyn.128.marineau.org>

From: Michael Marineau <mike@marineau.org>
Date: Wed, 7 Jan 2009 18:06:25 -0500

> -static void rfc2863_policy(struct net_device *dev)
> -{
> -	unsigned char operstate = default_operstate(dev);
> -
> -	if (operstate == dev->operstate)
> -		return;
> -
> -	write_lock_bh(&dev_base_lock);
> -
> -	switch(dev->link_mode) {
> -	case IF_LINK_MODE_DORMANT:
> -		if (operstate == IF_OPER_UP)
> -			operstate = IF_OPER_DORMANT;
> -		break;
> -
> -	case IF_LINK_MODE_DEFAULT:
> -	default:
> -		break;
> -	}
> -
> -	dev->operstate = operstate;
> -
> -	write_unlock_bh(&dev_base_lock);
> +	if (dev->link_mode == IF_LINK_MODE_DORMANT && netif_oper_up(dev))
> +		netif_userspace_dormant_on(dev);
> +	else
> +		netif_userspace_dormant_off(dev);
>  }

Michael, this doesn't work.

The whole point of taking the dev_base_lock is to freeze the state of
->link_mode, so that we can make a decision atomically based upon it's
value and without that value changing in the middle of the decision.

      reply	other threads:[~2009-01-13  0:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-30  8:41 [PATCH -net-next 3/4] firmware: convert tg3 driver to request_firmware() Jaswinder Singh Rajput
2009-01-05  0:11 ` David Miller
2009-01-05 13:28 ` Oliver Hartkopp
2009-01-05 13:58   ` Oliver Hartkopp
2009-01-05 14:12   ` Jaswinder Singh Rajput
2009-01-05 14:22     ` David Woodhouse
2009-01-05 14:47       ` Jaswinder Singh Rajput
2009-01-05 14:58     ` Oliver Hartkopp
2009-01-05 15:06       ` Jaswinder Singh Rajput
2009-01-06  0:01   ` David Miller
2009-01-07  3:17     ` Michael Marineau
2009-01-07  9:31       ` Oliver Hartkopp
2009-01-07 23:06       ` Michael Marineau
2009-01-13  0:10         ` David Miller [this message]

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=20090112.161054.180487472.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jaswinder@infradead.org \
    --cc=jgarzik@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=mike@marineau.org \
    --cc=netdev@vger.kernel.org \
    --cc=oliver@hartkopp.net \
    /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).