lkml.org 
[lkml]   [2010]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Gigabit Ethernet driver of Topcliff PCH
On Thu, 26 Aug 2010 18:56:55 +0900
Masayuki Ohtake <masa-korg@dsn.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.

--


\
 
 \ /
  Last update: 2010-08-26 17:43    [W:0.224 / U:0.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site