[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100826084129.71b9af87@nehalam>
Date: Thu, 26 Aug 2010 08:41:29 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: Masayuki Ohtake <masa-korg@....okisemi.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
ML netdev <netdev@...r.kernel.org>,
Greg Rose <gregory.v.rose@...el.com>,
Maxime Bizon <mbizon@...ebox.fr>,
Kristoffer Glembo <kristoffer@...sler.com>,
Ralf Baechle <ralf@...ux-mips.org>,
John Linn <john.linn@...inx.com>,
Randy Dunlap <randy.dunlap@...cle.com>,
"David S. Miller" <davem@...emloft.net>,
MeeGo <meego-dev@...go.com>, "Wang, Qi" <qi.wang@...el.com>,
"Wang, Yong Y" <yong.y.wang@...el.com>,
Andrew <andrew.chih.howe.khor@...el.com>,
Intel OTC <joel.clark@...el.com>,
"Foster, Margie" <margie.foster@...el.com>,
Toshiharu Okada <okada533@....okisemi.com>,
Tomoya Morinaga <morinaga526@....okisemi.com>,
Takahiro Shimizu <shimizu394@....okisemi.com>
Subject: Re: [PATCH] Gigabit Ethernet driver of Topcliff PCH
On Thu, 26 Aug 2010 18:56:55 +0900
Masayuki Ohtake <masa-korg@....okisemi.com> wrote:
> +
> +/**
> + * pch_gbe_set_settings - Set device-specific settings
> + * @netdev: Network interface device structure
> + * @ecmd: Ethtool command
> + * Returns
> + * 0: Successful.
> + * Negative value: Failed.
> + */
> +static int pch_gbe_set_settings(struct net_device *netdev,
> + struct ethtool_cmd *ecmd)
> +{
> + struct pch_gbe_adapter *adapter = netdev_priv(netdev);
> + struct pch_gbe_hw *hw = &adapter->hw;
> + int ret;
> +
> + PCH_GBE_DEBUG("ethtool: %s\n", __func__);
> +
> + while (test_and_set_bit(__PCH_GBE_RESETTING, &adapter->flags))
> + msleep(1);
Don't invent your own mutex mechanism. Either use spin lock
or mutex.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists