linux/drivers/net/ethernet
Chenguang Zhao 229cc10284 net/mlx5: Fix variable not being completed when function returns
[ Upstream commit 0e2909c6be ]

When cmd_alloc_index(), fails cmd_work_handler() needs
to complete ent->slotted before returning early.
Otherwise the task which issued the command may hang:

   mlx5_core 0000:01:00.0: cmd_work_handler:877:(pid 3880418): failed to allocate command entry
   INFO: task kworker/13:2:4055883 blocked for more than 120 seconds.
         Not tainted 4.19.90-25.44.v2101.ky10.aarch64 #1
   "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
   kworker/13:2    D    0 4055883      2 0x00000228
   Workqueue: events mlx5e_tx_dim_work [mlx5_core]
   Call trace:
      __switch_to+0xe8/0x150
      __schedule+0x2a8/0x9b8
      schedule+0x2c/0x88
      schedule_timeout+0x204/0x478
      wait_for_common+0x154/0x250
      wait_for_completion+0x28/0x38
      cmd_exec+0x7a0/0xa00 [mlx5_core]
      mlx5_cmd_exec+0x54/0x80 [mlx5_core]
      mlx5_core_modify_cq+0x6c/0x80 [mlx5_core]
      mlx5_core_modify_cq_moderation+0xa0/0xb8 [mlx5_core]
      mlx5e_tx_dim_work+0x54/0x68 [mlx5_core]
      process_one_work+0x1b0/0x448
      worker_thread+0x54/0x468
      kthread+0x134/0x138
      ret_from_fork+0x10/0x18

Fixes: 485d65e135 ("net/mlx5: Add a timeout to acquire the command queue semaphore")
Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Acked-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20250108030009.68520-1-zhaochenguang@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-01-17 13:36:15 +01:00
..
3com 3c589_cs: Fix an error handling path in tc589_probe() 2023-05-22 19:17:58 -07:00
8390 net: ethernet: 8390: ne2k-pci: use module_pci_driver() macro 2023-08-10 19:31:57 -07:00
actions net: Remove C45 check in C22 only MDIO bus drivers 2023-01-20 18:12:45 -08:00
adaptec net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
adi net: ethernet: adi: adin1110: Fix some error handling path in adin1110_read_fifo() 2024-10-17 15:24:25 +02:00
aeroflex net: ethernet: aeroflex: fix potential memory leak in greth_start_xmit_gbit() 2024-11-01 01:58:22 +01:00
agere et131x: Use pci_dev_id() to simplify the code 2023-08-13 12:30:39 +01:00
alacritech net: ethernet: slicoss: remove redundant increment of pointer data 2023-07-28 15:37:08 -07:00
allwinner net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
alteon net: alteon: remove unused len variable 2023-04-02 13:43:43 +01:00
altera net: altera-tse: make ALTERA_TSE depend on HAS_IOMEM 2023-08-18 10:18:51 -07:00
amazon net: ena: Fix redundant device NUMA node override 2024-06-12 11:12:59 +02:00
amd pds_core: limit loop over fw name list 2025-01-17 13:36:12 +01:00
apm net: xgene: Fix unused xgene_enet_of_match warning for !CONFIG_OF 2023-10-21 11:49:31 +01:00
apple net/macmace: Replace zero-length array with DECLARE_FLEX_ARRAY() helper 2023-08-01 14:46:21 -07:00
aquantia net: atlantic: Avoid warning about potential string truncation 2024-10-10 11:57:26 +02:00
arc net: arc: rockchip: fix emac mdio node support 2024-11-14 13:19:32 +01:00
asix net: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:02 +00:00
atheros ethernet: atheros: fix a memleak in atl1e_setup_ring_resources 2024-01-01 12:42:31 +00:00
broadcom bnxt_en: Fix possible memory leak when hwrm_req_replace fails 2025-01-17 13:36:12 +01:00
brocade bna: adjust 'name' buf size of bna_tcb and bna_ccb structures 2024-08-03 08:53:43 +02:00
cadence net: macb: Avoid 20s boot delay by skipping MDIO bus registration for fixed-link PHY 2024-10-22 15:46:20 +02:00
calxeda net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
cavium liquidio: Adjust a NULL pointer handling path in lio_vf_rep_copy_packet 2024-06-21 14:38:32 +02:00
chelsio cxgb4: Avoid removal of uninserted tid 2025-01-17 13:36:12 +01:00
cirrus cirrus: cs89x0: fix the return value handle and remove redundant dev_warn() for platform_get_irq() 2023-08-02 12:10:39 -07:00
cisco enic: Validate length of nl attributes in enic_set_vf_port 2024-06-12 11:12:55 +02:00
cortina net: ethernet: cortina: Restore TSO support 2024-10-17 15:24:37 +02:00
davicom net: dm9051: Use PTR_ERR_OR_ZERO() to simplify code 2023-08-23 18:57:30 -07:00
dec net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
dlink sundance: remove unused variable cnt 2022-11-17 13:18:30 +01:00
emulex be2net: fix potential memory leak in be_xmit() 2024-11-01 01:58:29 +01:00
engleder tsnep: Fix mapping for zero copy XDP_TX action 2024-02-16 19:10:48 +01:00
ezchip net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
faraday net: ftgmac100: Ensure tx descriptor updates are visible 2024-09-30 16:25:09 +02:00
freescale net: fec: make PPS channel configurable 2024-12-27 13:58:57 +01:00
fujitsu net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
fungible eth: add missing xdp.h includes in drivers 2023-08-03 08:38:07 -07:00
google eth: gve: use appropriate helper to set xdp_features 2025-01-17 13:36:13 +01:00
hisilicon net: hns3: fix kernel crash when uninstalling driver 2024-11-14 13:19:31 +01:00
huawei net: hinic: Fix cleanup in create_rxqs/txqs() 2024-12-27 13:58:48 +01:00
i825xx net/sun3_82586: fix potential memory leak in sun3_82586_send_packet() 2024-11-01 01:58:28 +01:00
ibm net: ibm: emac: mal: fix wrong goto 2024-10-17 15:24:28 +02:00
intel igc: return early when failing to read EECD register 2025-01-17 13:36:13 +01:00
litex net: ethernet: litex: add support for 64 bit stats 2023-06-15 22:56:46 -07:00
marvell sky2: Add device ID 11ab:4373 for Marvell 88E8075 2025-01-09 13:32:07 +01:00
mediatek net: ethernet: mtk_wed: check update_wo_rx_stats in mtk_wed_update_rx_stats() 2024-08-29 17:33:24 +02:00
mellanox net/mlx5: Fix variable not being completed when function returns 2025-01-17 13:36:15 +01:00
micrel net: ks8851: Fix potential TX stall after interface reopen 2024-07-18 13:21:17 +02:00
microchip net: sparx5: fix the maximum frame length register 2024-12-19 18:11:29 +01:00
microsoft net: mana: Add support for page sizes other than 4KB on ARM64 2024-10-10 11:58:03 +02:00
moxa net: moxa: fix endianness-related issues from 'sparse' 2022-09-06 10:24:42 +02:00
mscc net: mscc: ocelot: fix incorrect IFH SRC_PORT field in ocelot_ifh_set_basic() 2024-12-27 13:58:47 +01:00
myricom net: move gso declarations and functions to their own files 2023-06-10 00:11:41 -07:00
natsemi net/sonic: use dma_mapping_error() for error check 2023-03-21 21:29:34 -07:00
neterion ethernet: s2io: Use ether_addr_to_u64() to convert ethernet address 2023-08-09 15:26:49 -07:00
netronome nfp: Use IRQF_NO_AUTOEN flag in request_irq() 2024-10-10 11:57:28 +02:00
ni net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
nvidia forcedeth: Fix an error handling path in nv_probe() 2023-05-22 19:17:28 -07:00
nxp net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
oki-semi net: pch_gbe: Allow build on MIPS_GENERIC kernel 2023-06-08 19:18:32 -07:00
packetengines net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
pasemi net: pasemi: Fix return type of pasemi_mac_start_tx() 2023-03-21 13:48:35 +01:00
pensando ionic: use ee->offset when returning sprom data 2024-12-27 13:58:48 +01:00
qlogic net/qed: allow old cards not supporting "num_images" to work 2024-12-14 19:59:37 +01:00
qualcomm qca_spi: Make driver probing reliable 2024-12-19 18:11:30 +01:00
rdc r6040: Fix kmemleak in probe and remove 2022-12-15 12:48:34 +01:00
realtek r8169: don't apply UDP padding quirk on RTL8126A 2024-12-14 20:00:03 +01:00
renesas net: renesas: rswitch: fix possible early skb release 2025-01-09 13:31:48 +01:00
rocker rocker: fix link status detection in rocker_carrier_init() 2024-12-14 20:00:09 +01:00
samsung net: samsung: sxgbe: Make sxgbe_drv_remove() return void 2023-05-12 08:49:49 +01:00
seeq net: seeq: Fix use after free vulnerability in ether3 Driver Due to Race Condition 2024-10-04 16:29:41 +02:00
sfc net: sfc: Correct key_len for efx_tc_ct_zone_ht_params 2025-01-09 13:32:02 +01:00
sgi net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
silan ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
sis net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
smsc net: smc91x: Fix m68k kernel compilation for ColdFire CPU 2024-06-12 11:11:20 +02:00
socionext page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00
stmicro net: stmmac: dwmac-tegra: Read iommu stream id from device tree 2025-01-17 13:36:15 +01:00
sun eth: sungem: remove .ndo_poll_controller to avoid deadlocks 2024-06-12 11:11:51 +02:00
sunplus ethernet: remove superfluous clearing of phydev 2023-03-22 20:47:27 -07:00
synopsys net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
tehuti net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
ti net: ti: icssg-prueth: Fix clearing of IEP_CMP_CFG registers during iep_init 2025-01-09 13:32:03 +01:00
toshiba net: spider_net: Use size_add() in call to struct_size() 2023-11-20 11:58:57 +01:00
tundra ethernet: tundra: free irq when alloc ring failed in tsi108_open() 2022-11-10 15:39:08 +01:00
vertexcom net: vertexcom: mse102x: Fix tx_bytes calculation 2024-11-22 15:38:31 +01:00
via net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
wangxun net: libwx: fix firmware mailbox abnormal return 2025-01-17 13:36:12 +01:00
wiznet net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
xilinx net: xilinx: axienet: fix potential memory leak in axienet_start_xmit() 2024-11-01 01:58:22 +01:00
xircom xirc2ps_cs: Fix use after free bug in xirc2ps_detach 2023-03-19 10:42:02 +00:00
xscale ptp_ixp46x: convert .adjfreq to .adjfine 2022-11-11 10:58:39 +00:00
dnet.c net: ethernet: dnet: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-12 09:56:17 +00:00
dnet.h net/dnet: Delete static version from the driver 2020-03-03 17:54:55 -08:00
ec_bhf.c ethernet: ec_bhf: Remove redundant pci_clear_master 2023-03-24 09:09:28 +00:00
ethoc.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
fealnx.c eth: fealnx: bring back this old driver 2023-03-08 23:22:04 -08:00
jme.c net: ethernet: use ip_hdrlen() instead of bit shift 2024-09-18 19:24:05 +02:00
jme.h jme: remove an unnecessary indirection 2022-05-05 15:53:28 -07:00
Kconfig net: restore alpha order to Ethernet devices in config 2023-03-09 23:36:28 -08:00
korina.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-03 14:34:37 -07:00
lantiq_etop.c net: ethernet: lantiq_etop: fix memory disclosure 2024-10-10 11:57:16 +02:00
lantiq_xrx200.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
Makefile eth: fealnx: bring back this old driver 2023-03-08 23:22:04 -08:00