cxgb4: fix sleep in atomic when flashing PHY firmware
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Fri, 11 Jun 2021 06:47:46 +0000 (12:17 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Jun 2021 12:42:44 +0000 (14:42 +0200)
commitb38ec782d004eda623e40ea5bc92c9e2ce7c15c1
tree840f43d0da6d11f607c0b9ff7ed152e7e560f8ca
parent3d60457d74d9cc7b36f78f9cb74f29bc6182c1e8
cxgb4: fix sleep in atomic when flashing PHY firmware

[ Upstream commit f046bd0ae15d8a0bbe57d4647da182420f720c3d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c