Created attachment 231210 [details] refrain firing DCMDs if controller reset is in progress When controller reset is in progress, a few of the firmware registers are in-accessible state so if drivers access any of those registers at that time will result in undefined behaviour in firmware. In this case, controller reset is in progress, and system shutdown is issued, then the shutdown function in the driver will be invoked where it is waiting for a max of 15 sec for a reset to finish and if reset is not finished within that time frame then it is going ahead and firing the flush cache and shutdown DCMDs to firmware which will end up accessing the queues which are not initialised due to undergoing reset leads to FMU error in firmware So fix is to return to OS with proper error from shutdown if controller reset is not finished after waiting 15 sec. I have attached the patch which will fix this issue. This issue is applicable to variants: 13.0, 13.1, 12.3, 12.1 If possible we can back-port other required variants.
Please review this patch. It needs to be included in the upcoming release.
I think this patch is in error, though the error is likely mostly harmless. mrsas_shutdown is a newbus routine, so it should not be returning FAIL, but an errno from errno.h. FAIL happens to be 1, which EPERM which isn't quite right. Other drivers in the tree, however, return 0 in similar circumstances. Having said that, however, the return value is completely ignored, so this mismatch isn't a problem.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=241bb95552a39d440519162b544c776adcb7cf57 commit 241bb95552a39d440519162b544c776adcb7cf57 Author: Chandrakanth Patil <chandrakanth.patil@broadcom.com> AuthorDate: 2022-01-21 12:11:49 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2022-04-05 14:38:14 +0000 mrsas: remove additional MPT command allocation for R1 FP command There is an additional MPT command allocation for R1 fp command which will lead to MPT command unavailablity in case of rigorous R1 FP IOs. Remove additional MPT command allocation for R1 FP. Reviewed by: imp PR: 261377 sys/dev/mrsas/mrsas_cam.c | 1 - 1 file changed, 1 deletion(-)
Looks like I tagged the wrong bug number for this commit (I swapped the two, dangit) URL: https://cgit.FreeBSD.org/src/commit/?id=79c4c4be9618470711480f46ef2cd3a15c00cdd2
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=2ebe51859723fd3cb4cf02dc560441fc0ec50dc1 commit 2ebe51859723fd3cb4cf02dc560441fc0ec50dc1 Author: Chandrakanth Patil <chandrakanth.patil@broadcom.com> AuthorDate: 2022-01-21 12:11:49 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2022-04-06 16:27:25 +0000 mrsas: remove additional MPT command allocation for R1 FP command There is an additional MPT command allocation for R1 fp command which will lead to MPT command unavailablity in case of rigorous R1 FP IOs. Remove additional MPT command allocation for R1 FP. Reviewed by: imp PR: 261377 (cherry picked from commit 241bb95552a39d440519162b544c776adcb7cf57) sys/dev/mrsas/mrsas_cam.c | 1 - 1 file changed, 1 deletion(-)
A commit in branch releng/13.1 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=cf523b815c780f741b5f4b7d1cd1258d0118ad1f commit cf523b815c780f741b5f4b7d1cd1258d0118ad1f Author: Chandrakanth Patil <chandrakanth.patil@broadcom.com> AuthorDate: 2022-01-21 12:11:49 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2022-04-06 17:45:50 +0000 mrsas: remove additional MPT command allocation for R1 FP command There is an additional MPT command allocation for R1 fp command which will lead to MPT command unavailablity in case of rigorous R1 FP IOs. Remove additional MPT command allocation for R1 FP. Approved by: re@ (gjb) Reviewed by: imp PR: 261377 (cherry picked from commit 241bb95552a39d440519162b544c776adcb7cf57) (cherry picked from commit 2ebe51859723fd3cb4cf02dc560441fc0ec50dc1) sys/dev/mrsas/mrsas_cam.c | 1 - 1 file changed, 1 deletion(-)
^Triage: assign to committer who also MFCed.