generic: ar8216: add missing locking calls
[openwrt/svn-archive/archive.git] / target / linux / generic / files / drivers / net / phy / ar8216.c
index a69d038cee7a84ff3366d4fb3fc9989bd56ccf34..38012256003b8a950e8ef84b36e06ccf8623360a 100644 (file)
@@ -373,9 +373,11 @@ ar8216_mib_capture(struct ar8216_priv *priv)
        else
                mib_func = AR8216_REG_MIB_FUNC;
 
+       mutex_lock(&priv->reg_mutex);
        /* Capture the hardware statistics for all ports */
        ar8216_rmw(priv, mib_func, AR8216_MIB_FUNC,
                   (AR8216_MIB_FUNC_CAPTURE << AR8216_MIB_FUNC_S));
+       mutex_unlock(&priv->reg_mutex);
 
        /* Wait for the capturing to complete. */
        ret = ar8216_reg_wait(priv, mib_func, AR8216_MIB_BUSY, 0, 10);