Re: [PATCH net v2] net/mlx5: Avoid deadlock between PCI error recovery and health reporter

From: Jason Gunthorpe

Date: Tue Oct 07 2025 - 12:21:13 EST


On Tue, Oct 07, 2025 at 04:48:26PM +0200, Gerd Bayer wrote:
> - task: kmcheck
> mlx5_unload_one() tries to acquire devlink lock while the PCI error
> recovery code has set pdev->block_cfg_access by way of
> pci_cfg_access_lock()

This seems wrong, arch code shouldn't invoke the driver's error
handler while hodling pci_dev_lock().

Or at least if we do want to do this the locking should be documented
and some lockdep map should be added to pci_cfg_access_lock() and the
normal AER path..

Jason