linux-next/drivers/net/ethernet
Brett Creeley 81665adf25 pds_core: Fix pdsc_check_pci_health function to use work thread
When the driver notices fw_status == 0xff it tries to perform a PCI
reset on itself via pci_reset_function() in the context of the driver's
health thread. However, pdsc_reset_prepare calls
pdsc_stop_health_thread(), which attempts to stop/flush the health
thread. This results in a deadlock because the stop/flush will never
complete since the driver called pci_reset_function() from the health
thread context. Fix by changing the pdsc_check_pci_health_function()
to queue a newly introduced pdsc_pci_reset_thread() on the pdsc's
work queue.

Unloading the driver in the fw_down/dead state uncovered another issue,
which can be seen in the following trace:

WARNING: CPU: 51 PID: 6914 at kernel/workqueue.c:1450 __queue_work+0x358/0x440
[...]
RIP: 0010:__queue_work+0x358/0x440
[...]
Call Trace:
 <TASK>
 ? __warn+0x85/0x140
 ? __queue_work+0x358/0x440
 ? report_bug+0xfc/0x1e0
 ? handle_bug+0x3f/0x70
 ? exc_invalid_op+0x17/0x70
 ? asm_exc_invalid_op+0x1a/0x20
 ? __queue_work+0x358/0x440
 queue_work_on+0x28/0x30
 pdsc_devcmd_locked+0x96/0xe0 [pds_core]
 pdsc_devcmd_reset+0x71/0xb0 [pds_core]
 pdsc_teardown+0x51/0xe0 [pds_core]
 pdsc_remove+0x106/0x200 [pds_core]
 pci_device_remove+0x37/0xc0
 device_release_driver_internal+0xae/0x140
 driver_detach+0x48/0x90
 bus_remove_driver+0x6d/0xf0
 pci_unregister_driver+0x2e/0xa0
 pdsc_cleanup_module+0x10/0x780 [pds_core]
 __x64_sys_delete_module+0x142/0x2b0
 ? syscall_trace_enter.isra.18+0x126/0x1a0
 do_syscall_64+0x3b/0x90
 entry_SYSCALL_64_after_hwframe+0x72/0xdc
RIP: 0033:0x7fbd9d03a14b
[...]

Fix this by preventing the devcmd reset if the FW is not running.

Fixes: d9407ff118 ("pds_core: Prevent health thread from running during reset/remove")
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-04-10 08:30:10 +01:00
..
3com
8390 net: fill in MODULE_DESCRIPTION()s for 8390 2024-01-24 15:12:20 -08:00
actions
adaptec
adi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-02-29 14:24:56 -08:00
aeroflex
agere
alacritech
allwinner
alteon
altera net: ethernet: Use device_get_match_data() 2023-10-13 10:04:53 +01:00
amazon net: ena: Remove ena_select_queue 2024-02-18 19:47:45 +00:00
amd pds_core: Fix pdsc_check_pci_health function to use work thread 2024-04-10 08:30:10 +01:00
apm Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-10-26 13:46:28 -07:00
apple powerpc/macio: Make remove callback of macio driver void returned 2024-03-07 23:06:19 +11:00
aquantia net: atlantic: convert EEE handling to use linkmode bitmaps 2024-02-09 12:55:46 -08:00
arc
asix net: asix: fix fortify warning 2023-12-12 13:20:37 -08:00
atheros ethernet: atheros: fix a memleak in atl1e_setup_ring_resources 2023-12-15 10:55:35 +00:00
broadcom bnxt_en: Reset PTP tx_avail after possible firmware reset 2024-04-08 13:55:47 +01:00
brocade bnad: fix work_queue type mismatch 2024-02-14 12:49:47 +00:00
cadence net: macb: Convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() 2023-11-18 14:52:57 +00:00
calxeda
cavium net: fill in MODULE_DESCRIPTION()s for liquidio 2024-01-24 15:12:20 -08:00
chelsio Thermal control updates for 6.9-rc1 2024-03-13 12:03:57 -07:00
cirrus net: fill in MODULE_DESCRIPTION()s for ep93xxx_eth 2024-01-24 15:12:20 -08:00
cisco Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-02-22 15:29:26 -08:00
cortina net: ethernet: cortina: Drop TSO support 2024-01-07 16:05:00 +00:00
davicom
dec
dlink net: dl2k: Use proper conversion of dev_addr before IO to device 2023-12-12 11:25:36 +01:00
emulex net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops 2023-12-13 22:07:16 -08:00
engleder Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-02-08 15:30:33 -08:00
ezchip net: fill in MODULE_DESCRIPTION()s for nps_enet 2024-01-24 15:12:20 -08:00
faraday
freescale net: fec: Set mac_managed_pm during probe 2024-04-03 19:20:26 -07:00
fujitsu
fungible net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops 2023-12-13 22:07:16 -08:00
google net: introduce page_frag_cache_drain() 2024-03-05 11:38:14 +01:00
hisilicon net: hns3: mark unexcuted loopback test result as UNEXECUTED 2024-03-26 15:32:39 +01:00
huawei net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops 2023-12-13 22:07:16 -08:00
i825xx net/sun3_82586: Avoid reading past buffer in debug output 2024-02-08 18:41:10 -08:00
ibm mm, treewide: rename MAX_ORDER to MAX_PAGE_ORDER 2024-01-08 15:27:15 -08:00
intel idpf: fix kernel panic on unknown packet types 2024-04-03 13:07:28 -07:00
litex net: fill in MODULE_DESCRIPTION()s for litex 2024-01-24 15:12:21 -08:00
marvell octeontx2-af: Fix NIX SQ mode and BP config 2024-04-09 11:59:42 +02:00
mediatek net: ethernet: mtk_eth_soc: fix PPE hanging issue 2024-03-15 14:03:45 +00:00
mellanox mlxbf_gige: stop interface during shutdown 2024-03-29 08:34:10 -07:00
micrel net: ks8851: Handle softirqs at the end of IRQ thread to fix hang 2024-04-08 19:48:48 -07:00
microchip net: lan743x: Add set RFE read fifo threshold for PCI1x1x chips 2024-03-28 11:36:10 +01:00
microsoft net: mana: Fix Rx DMA datasize and skb_over_panic 2024-04-03 19:32:03 -07:00
moxa
mscc net: ocelot: update the MODULE_DESCRIPTION() 2024-02-05 12:35:18 +00:00
myricom
natsemi
neterion net: fill in MODULE_DESCRIPTION()s for s2io 2024-01-11 16:16:08 -08:00
netronome Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-03-11 20:38:36 -07:00
ni netdev: replace napi_reschedule with napi_schedule 2023-10-11 17:28:06 -07:00
nvidia net: remove stale mentions of dev_base_lock in comments 2024-02-14 11:20:13 +00:00
nxp
oki-semi
packetengines
pasemi
pensando ionic: keep stats struct local to error handling 2024-03-08 11:54:35 +00:00
qlogic net: adopt skb_network_offset() and similar helpers 2024-03-04 08:47:06 +00:00
qualcomm TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
rdc
realtek r8169: fix issue caused by buggy BIOS on certain boards with RTL8168d 2024-04-02 18:04:29 -07:00
renesas Including fixes from netfilter, bluetooth and bpf. 2024-04-04 14:49:10 -07:00
rocker rocker: Don't bother filling in ethtool driver version 2024-02-23 18:03:53 -08:00
samsung net: sxgbe: remove eee_enabled/eee_active in sxgbe_get_eee() 2024-02-07 09:03:37 -08:00
seeq
sfc net: introduce include/net/rps.h 2024-03-07 21:12:43 -08:00
sgi
silan
sis
smsc net: fill in MODULE_DESCRIPTION()s for SMSC drivers 2024-01-29 12:12:51 +00:00
socionext eth: link netdev to page_pools in drivers 2023-11-28 15:48:39 +01:00
stmicro net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics 2024-04-08 15:19:50 +01:00
sun - Kuan-Wei Chiu has developed the well-named series "lib min_heap: Min 2024-03-14 18:03:09 -07:00
sunplus
synopsys
tehuti
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-03-07 10:29:36 -08:00
toshiba Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-02-29 14:24:56 -08:00
tundra
vertexcom net: vertexcom: mse102x: Follow renaming of SPI "master" to "controller" 2024-02-08 11:54:46 +00:00
via
wangxun net: txgbe: fix i2c dev name cannot match clkdev 2024-04-03 19:21:04 -07:00
wiznet ethernet: wiznet: Use devm_platform_get_and_ioremap_resource() in w5300_hw_probe() 2024-02-09 12:27:36 -08:00
xilinx net: ll_temac: platform_get_resource replaced by wrong function 2024-03-25 19:46:56 -07:00
xircom xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace 2024-02-08 19:04:28 -08:00
xscale net: xscale: Drop unused PHY number 2023-11-01 22:15:15 -07:00
dnet.c
dnet.h
ec_bhf.c net: fill in MODULE_DESCRIPTION()s for ec_bhf 2024-01-29 12:12:51 +00:00
ethoc.c
fealnx.c
jme.c
jme.h
Kconfig net: ethernet: remove duplicated CONFIG_SUNGEM_PHY entry 2024-02-07 13:17:51 +00:00
korina.c
lantiq_etop.c
lantiq_xrx200.c
Makefile