mirror_ubuntu-kernels/drivers/net/ethernet
Yonglong Liu ac6257a3ae net: hns3: fix deadlock issue when externel_lb and reset are executed together
When externel_lb and reset are executed together, a deadlock may
occur:
[ 3147.217009] INFO: task kworker/u321:0:7 blocked for more than 120 seconds.
[ 3147.230483] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 3147.238999] task:kworker/u321:0  state:D stack:    0 pid:    7 ppid:     2 flags:0x00000008
[ 3147.248045] Workqueue: hclge hclge_service_task [hclge]
[ 3147.253957] Call trace:
[ 3147.257093]  __switch_to+0x7c/0xbc
[ 3147.261183]  __schedule+0x338/0x6f0
[ 3147.265357]  schedule+0x50/0xe0
[ 3147.269185]  schedule_preempt_disabled+0x18/0x24
[ 3147.274488]  __mutex_lock.constprop.0+0x1d4/0x5dc
[ 3147.279880]  __mutex_lock_slowpath+0x1c/0x30
[ 3147.284839]  mutex_lock+0x50/0x60
[ 3147.288841]  rtnl_lock+0x20/0x2c
[ 3147.292759]  hclge_reset_prepare+0x68/0x90 [hclge]
[ 3147.298239]  hclge_reset_subtask+0x88/0xe0 [hclge]
[ 3147.303718]  hclge_reset_service_task+0x84/0x120 [hclge]
[ 3147.309718]  hclge_service_task+0x2c/0x70 [hclge]
[ 3147.315109]  process_one_work+0x1d0/0x490
[ 3147.319805]  worker_thread+0x158/0x3d0
[ 3147.324240]  kthread+0x108/0x13c
[ 3147.328154]  ret_from_fork+0x10/0x18

In externel_lb process, the hns3 driver call napi_disable()
first, then the reset happen, then the restore process of the
externel_lb will fail, and will not call napi_enable(). When
doing externel_lb again, napi_disable() will be double call,
cause a deadlock of rtnl_lock().

This patch use the HNS3_NIC_STATE_DOWN state to protect the
calling of napi_disable() and napi_enable() in externel_lb
process, just as the usage in ndo_stop() and ndo_start().

Fixes: 04b6ba1435 ("net: hns3: add support for external loopback test")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20230807113452.474224-5-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-08 16:13:05 -07:00
..
3com 3c589_cs: Fix an error handling path in tc589_probe() 2023-05-22 19:17:58 -07:00
8390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-05-18 14:39:34 -07:00
actions
adaptec
adi
aeroflex
agere
alacritech
allwinner
alteon
altera net: altera_tse: explicitly disable autoscan on the regmap-mdio bus 2023-06-07 13:30:12 -07:00
amazon net: ena: fix shift-out-of-bounds in exponential backoff 2023-07-12 15:57:57 -07:00
amd pds_core: use vmalloc_array and vcalloc 2023-06-27 09:30:23 -07:00
apm
apple
aquantia net: introduce and use skb_frag_fill_page_desc() 2023-05-13 19:47:56 +01:00
arc net: arc: Make arc_emac_remove() return void 2023-05-19 13:33:28 +01:00
asix
atheros ethernet: atheros: fix return value check in atl1e_tso_csum() 2023-07-24 15:43:02 -07:00
broadcom bnxt_en: Fix max_mtu setting for multi-buf XDP 2023-08-01 15:04:58 -07:00
brocade bna: Remove error checking for debugfs_create_dir() 2023-07-14 09:09:12 +01:00
cadence net: macb: update PCS driver to use neg_mode 2023-06-22 19:41:02 -07:00
calxeda
cavium Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
chelsio sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES) 2023-06-24 15:50:13 -07:00
cirrus net: isa: include net/Space.h 2023-05-17 21:27:30 -07:00
cisco
cortina
davicom spi: Updates for v6.4 2023-04-27 11:02:26 -07:00
dec
dlink
emulex benet: fix return value check in be_lancer_xmit_workarounds() 2023-07-27 10:31:38 +02:00
engleder net/sched: taprio: replace tc_taprio_qopt_offload :: enable with a "cmd" enum 2023-05-31 10:00:30 +01:00
ezchip
faraday
freescale net: fec: tx processing does not call XDP APIs if budget is 0 2023-07-26 21:12:12 -07:00
fujitsu
fungible net: tls: make the offload check helper take skb not socket 2023-06-15 09:01:05 +01:00
google gve: unify driver name usage 2023-07-10 08:29:55 +01:00
hisilicon net: hns3: fix deadlock issue when externel_lb and reset are executed together 2023-08-08 16:13:05 -07:00
huawei
i825xx net: ethernet: i825xx: sun3_8256: Add SPDX license identifier 2023-05-16 15:38:07 +02:00
ibm ibmvnic: Do not reset dql stats on NON_FATAL err 2023-06-29 11:12:19 -07:00
intel ice: Fix RDMA VSI removal during queue rebuild 2023-07-31 14:28:21 -07:00
litex net: ethernet: litex: add support for 64 bit stats 2023-06-15 22:56:46 -07:00
marvell net: marvell: prestera: fix handling IPv4 routes with nhid 2023-08-07 19:20:50 -07:00
mediatek net: ethernet: mtk_eth_soc: always mtk_get_ib1_pkt_type 2023-07-19 21:15:04 -07:00
mellanox net/mlx5e: Set proper IPsec source port in L4 selector 2023-08-02 18:38:42 -07:00
micrel
microchip net: lan743x: select FIXED_PHY 2023-07-09 11:23:47 +01:00
microsoft v6.5 merge window RDMA pull request 2023-06-29 21:01:17 -07:00
moxa
mscc drivers:net: fix return value check in ocelot_fdma_receive_skb 2023-07-19 12:27:09 +01:00
myricom net: move gso declarations and functions to their own files 2023-06-10 00:11:41 -07:00
natsemi
neterion
netronome nfp: clean mc addresses in application firmware when closing port 2023-07-05 10:59:12 -07:00
ni
nvidia forcedeth: Fix an error handling path in nv_probe() 2023-05-22 19:17:28 -07:00
nxp
oki-semi net: pch_gbe: Allow build on MIPS_GENERIC kernel 2023-06-08 19:18:32 -07:00
packetengines
pasemi
pensando ionic: Add missing err handling for queue reconfig 2023-08-06 16:44:03 +01:00
qlogic qed: Fix scheduling in a tasklet while getting stats 2023-07-29 17:09:18 +01:00
qualcomm drivers: net: fix return value check in emac_tso_csum() 2023-07-19 12:27:09 +01:00
rdc
realtek Revert "r8169: disable ASPM during NAPI poll" 2023-07-19 21:09:11 -07:00
renesas Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-15 22:19:41 -07:00
rocker
samsung net: samsung: sxgbe: Make sxgbe_drv_remove() return void 2023-05-12 08:49:49 +01:00
seeq
sfc sfc: fix field-spanning memcpy in selftest 2023-07-31 14:27:53 -07:00
sgi
silan
sis
smsc
socionext net: netsec: Ignore 'phy-mode' on SynQuacer in DT mode 2023-08-01 14:59:45 -07:00
stmicro net: stmmac: tegra: Properly allocate clock bulk data 2023-07-29 16:59:51 +01:00
sun sunvnet: fix sparc64 build error after gso code split 2023-06-15 22:47:13 -07:00
sunplus
synopsys
tehuti
ti net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field()/cpsw_ale_set_field() 2023-07-14 08:36:43 +01:00
toshiba
tundra
vertexcom
via
wangxun net: ethernet: Remove repeating expression 2023-07-14 09:11:10 +01:00
wiznet
xilinx net: ll_temac: fix error checking of irq_of_parse_and_map() 2023-08-01 14:38:17 -07:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c
jme.h
Kconfig
korina.c net: korina: handle clk prepare error in korina_probe() 2023-08-01 14:58:34 -07:00
lantiq_etop.c
lantiq_xrx200.c
Makefile