diff options
author | Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> | 2021-06-11 12:17:46 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-11 11:15:00 -0700 |
commit | f046bd0ae15d8a0bbe57d4647da182420f720c3d (patch) | |
tree | bb061e3c1ec6ed2276ac5d2e377bbca39e89b6b2 /drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | |
parent | cxgb4: fix endianness when flashing boot image (diff) | |
download | linux-dev-f046bd0ae15d8a0bbe57d4647da182420f720c3d.tar.xz linux-dev-f046bd0ae15d8a0bbe57d4647da182420f720c3d.zip |
cxgb4: fix sleep in atomic when flashing PHY firmware
Before writing new PHY firmware to on-chip memory, driver queries
firmware for current running PHY firmware version, which can result
in sleep waiting for reply. So, move spinlock closer to the actual
on-chip memory write operation, instead of taking it at the callers.
Fixes: 5fff701c838e ("cxgb4: always sync access when flashing PHY firmware")
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/t4_hw.c')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c index 1293505025c1..a0555f4d76fc 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c @@ -3820,9 +3820,11 @@ int t4_load_phy_fw(struct adapter *adap, int win, /* Copy the supplied PHY Firmware image to the adapter memory location * allocated by the adapter firmware. */ + spin_lock_bh(&adap->win0_lock); ret = t4_memory_rw(adap, win, mtype, maddr, phy_fw_size, (__be32 *)phy_fw_data, T4_MEMORY_WRITE); + spin_unlock_bh(&adap->win0_lock); if (ret) return ret; |