Subject: Re: [PATCH] Gigabit Ethernet driver of Topcliff PCH

From: Stephen Hemminger <[email-masked]>
Date: Thu, 26 Aug 2010 08:41:29 -0700

On Thu, 26 Aug 2010 18:56:55 +0900
Masayuki Ohtake <[email-masked]> 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.

--