linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: David Miller <davem@davemloft.net>, <shchepetkov@ispras.ru>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ldv-project@ispras.ru>
Subject: Re: [PATCH 0/5] Call netif_carrier_off() after register_netdev()
Date: Wed, 15 Aug 2012 13:40:52 +0200	[thread overview]
Message-ID: <87boicz8l7.fsf@nemi.mork.no> (raw)
In-Reply-To: <1344984477.2690.85.camel@bwh-desktop.uk.solarflarecom.com> (Ben Hutchings's message of "Tue, 14 Aug 2012 23:47:57 +0100")

Ben Hutchings <bhutchings@solarflare.com> writes:

> But if you do it beforehand then it doesn't have the intended effect.
> (Supposed to be fixed by 22604c866889c4b2e12b73cbf1683bda1b72a313, which
> had to be reverted: c276e098d3ee33059b4a1c747354226cec58487c.)
>
> So you have to do it after, but without dropping the RTNL lock in
> between.

So you may want to add something like

int register_netdev_carrier_off(struct net_device *dev)
{
	int err;

	rtnl_lock();
	err = register_netdevice(dev);
        if (!err)
                set_bit(__LINK_STATE_NOCARRIER, &dev->state)
	rtnl_unlock();
	return err;
}


for these drivers?



Bjørn

  reply	other threads:[~2012-08-15 11:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 10:28 [PATCH 0/5] Call netif_carrier_off() after register_netdev() Ilya Shchepetkov
2012-08-14 10:28 ` [PATCH 1/5] sgi-xp: " Ilya Shchepetkov
2012-08-14 14:22   ` Robin Holt
2012-08-14 10:28 ` [PATCH 2/5] de2104x: " Ilya Shchepetkov
2012-08-14 10:28 ` [PATCH 3/5] net/mlx4_en: " Ilya Shchepetkov
2012-08-14 12:36   ` Sathya.Perla
2012-08-14 14:56     ` Ben Hutchings
2012-08-14 10:28 ` [PATCH 4/5] sungem: " Ilya Shchepetkov
2012-08-14 10:28 ` [PATCH 5/5] net/hyperv: " Ilya Shchepetkov
2012-08-14 15:32   ` Haiyang Zhang
2012-08-14 21:00 ` [PATCH 0/5] " David Miller
2012-08-14 22:47   ` Ben Hutchings
2012-08-15 11:40     ` Bjørn Mork [this message]
2012-08-17  7:55       ` Ilya Shchepetkov
2012-08-17 16:20         ` Stephen Hemminger

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=87boicz8l7.fsf@nemi.mork.no \
    --to=bjorn@mork.no \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=ldv-project@ispras.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shchepetkov@ispras.ru \
    /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).