aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorSteve Hodgson <shodgson@solarflare.com>2009-11-28 00:34:44 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-29 02:58:51 -0500
commitab86746175a5e1379abb9c7c38522af4d3176f57 (patch)
tree785e6540facd6807909c24e827a61a1d441fc5bc /drivers/net/sfc
parent47c3d19f60da7cc018781744b1ffb3b557373e7f (diff)
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>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/efx.c2
-rw-r--r--drivers/net/sfc/falcon.c12
-rw-r--r--drivers/net/sfc/net_driver.h4
3 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index b5a7e91590dc..6338ad8dbfbb 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1922,7 +1922,7 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,
1922 /* Initialise common structures */ 1922 /* Initialise common structures */
1923 memset(efx, 0, sizeof(*efx)); 1923 memset(efx, 0, sizeof(*efx));
1924 spin_lock_init(&efx->biu_lock); 1924 spin_lock_init(&efx->biu_lock);
1925 spin_lock_init(&efx->phy_lock); 1925 mutex_init(&efx->mdio_lock);
1926 mutex_init(&efx->spi_lock); 1926 mutex_init(&efx->spi_lock);
1927 INIT_WORK(&efx->reset_work, efx_reset_work); 1927 INIT_WORK(&efx->reset_work, efx_reset_work);
1928 INIT_DELAYED_WORK(&efx->monitor_work, efx_monitor); 1928 INIT_DELAYED_WORK(&efx->monitor_work, efx_monitor);
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index e16faad70283..372dbbc72404 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -2110,7 +2110,7 @@ static int falcon_mdio_write(struct net_device *net_dev,
2110 EFX_REGDUMP(efx, "writing MDIO %d register %d.%d with 0x%04x\n", 2110 EFX_REGDUMP(efx, "writing MDIO %d register %d.%d with 0x%04x\n",
2111 prtad, devad, addr, value); 2111 prtad, devad, addr, value);
2112 2112
2113 spin_lock_bh(&efx->phy_lock); 2113 mutex_lock(&efx->mdio_lock);
2114 2114
2115 /* Check MDIO not currently being accessed */ 2115 /* Check MDIO not currently being accessed */
2116 rc = falcon_gmii_wait(efx); 2116 rc = falcon_gmii_wait(efx);
@@ -2145,8 +2145,8 @@ static int falcon_mdio_write(struct net_device *net_dev,
2145 udelay(10); 2145 udelay(10);
2146 } 2146 }
2147 2147
2148 out: 2148out:
2149 spin_unlock_bh(&efx->phy_lock); 2149 mutex_unlock(&efx->mdio_lock);
2150 return rc; 2150 return rc;
2151} 2151}
2152 2152
@@ -2158,7 +2158,7 @@ static int falcon_mdio_read(struct net_device *net_dev,
2158 efx_oword_t reg; 2158 efx_oword_t reg;
2159 int rc; 2159 int rc;
2160 2160
2161 spin_lock_bh(&efx->phy_lock); 2161 mutex_lock(&efx->mdio_lock);
2162 2162
2163 /* Check MDIO not currently being accessed */ 2163 /* Check MDIO not currently being accessed */
2164 rc = falcon_gmii_wait(efx); 2164 rc = falcon_gmii_wait(efx);
@@ -2194,8 +2194,8 @@ static int falcon_mdio_read(struct net_device *net_dev,
2194 prtad, devad, addr, rc); 2194 prtad, devad, addr, rc);
2195 } 2195 }
2196 2196
2197 out: 2197out:
2198 spin_unlock_bh(&efx->phy_lock); 2198 mutex_unlock(&efx->mdio_lock);
2199 return rc; 2199 return rc;
2200} 2200}
2201 2201
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index fb9327c5ea57..0aeaeda9db7c 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -724,7 +724,7 @@ union efx_multicast_hash {
724 * @mac_op: MAC interface 724 * @mac_op: MAC interface
725 * @mac_address: Permanent MAC address 725 * @mac_address: Permanent MAC address
726 * @phy_type: PHY type 726 * @phy_type: PHY type
727 * @phy_lock: PHY access lock 727 * @mdio_lock: MDIO lock
728 * @phy_op: PHY interface 728 * @phy_op: PHY interface
729 * @phy_data: PHY private data (including PHY-specific stats) 729 * @phy_data: PHY private data (including PHY-specific stats)
730 * @mdio: PHY MDIO interface 730 * @mdio: PHY MDIO interface
@@ -806,7 +806,7 @@ struct efx_nic {
806 unsigned char mac_address[ETH_ALEN]; 806 unsigned char mac_address[ETH_ALEN];
807 807
808 enum phy_type phy_type; 808 enum phy_type phy_type;
809 spinlock_t phy_lock; 809 struct mutex mdio_lock;
810 struct efx_phy_operations *phy_op; 810 struct efx_phy_operations *phy_op;
811 void *phy_data; 811 void *phy_data;
812 struct mdio_if_info mdio; 812 struct mdio_if_info mdio;