diff options
author | Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> | 2020-06-23 23:33:22 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-24 06:55:44 +0300 |
commit | 5fff701c838e0e9afeac942d2fe20879d2b260aa (patch) | |
tree | 99c4d7e1d4beb5a0810708b2546da12fb4fd3f70 /drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |
parent | 0558c396040734bc1d361919566a581fd41aa539 (diff) | |
download | linux-5fff701c838e0e9afeac942d2fe20879d2b260aa.tar.xz |
cxgb4: always sync access when flashing PHY firmware
Access to on-chip memory for flashing PHY firmware must always
be synchronized. So, ensure the callers take on-chip memory lock.
Also fixes following sparse warning:
sge.c:1641:26: warning: context imbalance in 't4_load_phy_fw' -
different lock contexts for basic block
Fixes: 01b6961410b7 ("cxgb4: Add PHY firmware support for T420-BT cards")
Fixes: 4ee339e1e92a ("cxgb4: add support to flash PHY image")
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 7423980bc49a..87505a0d906a 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -4146,9 +4146,10 @@ static int adap_init0_phy(struct adapter *adap) /* Load PHY Firmware onto adapter. */ - ret = t4_load_phy_fw(adap, MEMWIN_NIC, &adap->win0_lock, - phy_info->phy_fw_version, + spin_lock_bh(&adap->win0_lock); + ret = t4_load_phy_fw(adap, MEMWIN_NIC, phy_info->phy_fw_version, (u8 *)phyf->data, phyf->size); + spin_unlock_bh(&adap->win0_lock); if (ret < 0) dev_err(adap->pdev_dev, "PHY Firmware transfer error %d\n", -ret); |