sfc: Replace MDIO spinlock with mutex
We never use MDIO in atomic context, so we don't need to spin. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
47c3d19f60
commit
ab86746175
|
@ -1922,7 +1922,7 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,
|
||||||
/* Initialise common structures */
|
/* Initialise common structures */
|
||||||
memset(efx, 0, sizeof(*efx));
|
memset(efx, 0, sizeof(*efx));
|
||||||
spin_lock_init(&efx->biu_lock);
|
spin_lock_init(&efx->biu_lock);
|
||||||
spin_lock_init(&efx->phy_lock);
|
mutex_init(&efx->mdio_lock);
|
||||||
mutex_init(&efx->spi_lock);
|
mutex_init(&efx->spi_lock);
|
||||||
INIT_WORK(&efx->reset_work, efx_reset_work);
|
INIT_WORK(&efx->reset_work, efx_reset_work);
|
||||||
INIT_DELAYED_WORK(&efx->monitor_work, efx_monitor);
|
INIT_DELAYED_WORK(&efx->monitor_work, efx_monitor);
|
||||||
|
|
|
@ -2110,7 +2110,7 @@ static int falcon_mdio_write(struct net_device *net_dev,
|
||||||
EFX_REGDUMP(efx, "writing MDIO %d register %d.%d with 0x%04x\n",
|
EFX_REGDUMP(efx, "writing MDIO %d register %d.%d with 0x%04x\n",
|
||||||
prtad, devad, addr, value);
|
prtad, devad, addr, value);
|
||||||
|
|
||||||
spin_lock_bh(&efx->phy_lock);
|
mutex_lock(&efx->mdio_lock);
|
||||||
|
|
||||||
/* Check MDIO not currently being accessed */
|
/* Check MDIO not currently being accessed */
|
||||||
rc = falcon_gmii_wait(efx);
|
rc = falcon_gmii_wait(efx);
|
||||||
|
@ -2145,8 +2145,8 @@ static int falcon_mdio_write(struct net_device *net_dev,
|
||||||
udelay(10);
|
udelay(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
spin_unlock_bh(&efx->phy_lock);
|
mutex_unlock(&efx->mdio_lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2158,7 +2158,7 @@ static int falcon_mdio_read(struct net_device *net_dev,
|
||||||
efx_oword_t reg;
|
efx_oword_t reg;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
spin_lock_bh(&efx->phy_lock);
|
mutex_lock(&efx->mdio_lock);
|
||||||
|
|
||||||
/* Check MDIO not currently being accessed */
|
/* Check MDIO not currently being accessed */
|
||||||
rc = falcon_gmii_wait(efx);
|
rc = falcon_gmii_wait(efx);
|
||||||
|
@ -2194,8 +2194,8 @@ static int falcon_mdio_read(struct net_device *net_dev,
|
||||||
prtad, devad, addr, rc);
|
prtad, devad, addr, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
spin_unlock_bh(&efx->phy_lock);
|
mutex_unlock(&efx->mdio_lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -724,7 +724,7 @@ union efx_multicast_hash {
|
||||||
* @mac_op: MAC interface
|
* @mac_op: MAC interface
|
||||||
* @mac_address: Permanent MAC address
|
* @mac_address: Permanent MAC address
|
||||||
* @phy_type: PHY type
|
* @phy_type: PHY type
|
||||||
* @phy_lock: PHY access lock
|
* @mdio_lock: MDIO lock
|
||||||
* @phy_op: PHY interface
|
* @phy_op: PHY interface
|
||||||
* @phy_data: PHY private data (including PHY-specific stats)
|
* @phy_data: PHY private data (including PHY-specific stats)
|
||||||
* @mdio: PHY MDIO interface
|
* @mdio: PHY MDIO interface
|
||||||
|
@ -806,7 +806,7 @@ struct efx_nic {
|
||||||
unsigned char mac_address[ETH_ALEN];
|
unsigned char mac_address[ETH_ALEN];
|
||||||
|
|
||||||
enum phy_type phy_type;
|
enum phy_type phy_type;
|
||||||
spinlock_t phy_lock;
|
struct mutex mdio_lock;
|
||||||
struct efx_phy_operations *phy_op;
|
struct efx_phy_operations *phy_op;
|
||||||
void *phy_data;
|
void *phy_data;
|
||||||
struct mdio_if_info mdio;
|
struct mdio_if_info mdio;
|
||||||
|
|
Loading…
Reference in New Issue