Skip to contentSkip to conversation

Regression in v5.16-rc1: Timeout in mlx5_health_wait_pci_up() may try to wait 245 million years

DISCUSSION Niklas Schnelle 2 participants 3 messages Nov 19, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello Amir, Moshe, and Saeed,

During testing of PCI device recovery, I found a problem in the mlx5 recovery support introduced in v5.16-rc1 by commit 32def4120e48 ("net/mlx5: Read timeout values from DTOR"). It follows my analysis of the problem.

When the device is in an error state, at least on s390 but I believe also on other systems, it is isolated and all PCI MMIO reads return 0xff. This is detected by your driver and it will immediately attempt to recovery the device with a mlx5_core driver specific recovery mechanism. Since at this point no reset has been done that would take the device out of isolation this will of course fail as it can't communicate with the device. Under normal circumstances this reset would happen later during the new recovery flow introduced in 4cdf2f4e24ff ("s390/pci: implement minimal PCI error recovery") once firmware has done their side of the recovery allowing that to succeed once the driver specific recovery has failed.

With v5.16-rc1 however the driver specific recovery gets stuck holding locks which will block our recovery. Without our recovery mechanism this can also be seen by "echo 1 > /sys/bus/pci/devices/<dev>/remove" which hangs on the device lock forever.

Digging into this I tracked the problem down to mlx5_health_wait_pci_up() hangig. I added a debug print to it and it turns out that with the device isolated mlx5_tout_ms(dev, FW_RESET) returns 774039849367420401 (0x6B...6B) milliseconds and we try to wait 245 million years. After reverting that commit things work again, though of course the driver specific recovery flow will still fail before ours can kick in and finally succeed.

Thanks,
Niklas Schnelle

#regzbot introduced: 32def4120e48

#1 lore raw
Quoted 7 lines · Niklas Schnelle

Hello Amir, Moshe, and Saeed,

During testing of PCI device recovery, I found a problem in the mlx5 recovery support introduced in v5.16-rc1 by commit 32def4120e48 ("net/mlx5: Read timeout values from DTOR"). It follows my analysis of the problem.

Quoted 6 lines

[...]

Thanks,
Niklas Schnelle

#regzbot introduced: 32def4120e48

Many thx for getting regzbot directly involved. Due to the repost it now has two entries for this regressions, thus I'm marking this one as a duplicate of the repost:

#regzbot dup-of:
https://lore.kernel.org/regressions/[email protected]/

#2 lore raw
Quoted 16 lines · Thorsten Leemhuis
Quoted 12 lines · Niklas Schnelle

Hello Amir, Moshe, and Saeed,

During testing of PCI device recovery, I found a problem in the mlx5 recovery support introduced in v5.16-rc1 by commit 32def4120e48 ("net/mlx5: Read timeout values from DTOR"). It follows my analysis of the problem.

[...]

Thanks,
Niklas Schnelle

Quoted 8 lines
Quoted 1 line

#regzbot introduced: 32def4120e48

Many thx for getting regzbot directly involved. Due to the repost it now has two entries for this regressions, thus I'm marking this one as a duplicate of the repost:

#regzbot dup-of:
https://lore.kernel.org/regressions/[email protected]/

Brown paperbag mail:

Ugh, that command told regzbot to mark the regression as a duplicate of itself, which obviously is stupid. Trying it again:

#regzbot dup-of:
https://lore.kernel.org/regressions/[email protected]