diff mbox series

scsi: mpt3sas: Stop fw fault watchdog work item during system shutdown

Message ID 20220722142448.6289-1-djeffery@redhat.com (mailing list archive)
State Accepted
Headers show
Series scsi: mpt3sas: Stop fw fault watchdog work item during system shutdown | expand

Commit Message

David Jeffery July 22, 2022, 2:24 p.m. UTC
During system shutdown or reboot, mpt3sas will reset the firmware back to
ready state. However, the driver leaves running a watchdog work item
intended to keep the firmware in operational state. This causes a second,
unneeded reset on shutdown and moves the firmware back to operational
instead of in ready state as intended. And if the mpt3sas_fwfault_debug
module parameter is set, this extra reset also panics the system.

mpt3sas's scsih_shutdown needs to stop the watchdog before resetting the
firmware back to ready state.

Fixes: fae21608c31c ("scsi: mpt3sas: Transition IOC to Ready state during shutdown")
Signed-off-by: David Jeffery <djeffery@redhat.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Sreekanth Reddy July 25, 2022, 4:05 p.m. UTC | #1
On Fri, Jul 22, 2022 at 7:55 PM David Jeffery <djeffery@redhat.com> wrote:
>
> During system shutdown or reboot, mpt3sas will reset the firmware back to
> ready state. However, the driver leaves running a watchdog work item
> intended to keep the firmware in operational state. This causes a second,
> unneeded reset on shutdown and moves the firmware back to operational
> instead of in ready state as intended. And if the mpt3sas_fwfault_debug
> module parameter is set, this extra reset also panics the system.
>
> mpt3sas's scsih_shutdown needs to stop the watchdog before resetting the
> firmware back to ready state.
>
> Fixes: fae21608c31c ("scsi: mpt3sas: Transition IOC to Ready state during shutdown")
> Signed-off-by: David Jeffery <djeffery@redhat.com>
> Tested-by: Laurence Oberman <loberman@redhat.com>

Thanks for the patch.
Ack-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>

> ---
>  drivers/scsi/mpt3sas/mpt3sas_scsih.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> index b519f4b59d30..5e8887fa02c8 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -11386,6 +11386,7 @@ scsih_shutdown(struct pci_dev *pdev)
>         _scsih_ir_shutdown(ioc);
>         _scsih_nvme_shutdown(ioc);
>         mpt3sas_base_mask_interrupts(ioc);
> +       mpt3sas_base_stop_watchdog(ioc);
>         ioc->shost_recovery = 1;
>         mpt3sas_base_make_ioc_ready(ioc, SOFT_RESET);
>         ioc->shost_recovery = 0;
> --
> 2.36.1
>
Martin K. Petersen July 27, 2022, 3:15 a.m. UTC | #2
On Fri, 22 Jul 2022 10:24:48 -0400, David Jeffery wrote:

> During system shutdown or reboot, mpt3sas will reset the firmware back to
> ready state. However, the driver leaves running a watchdog work item
> intended to keep the firmware in operational state. This causes a second,
> unneeded reset on shutdown and moves the firmware back to operational
> instead of in ready state as intended. And if the mpt3sas_fwfault_debug
> module parameter is set, this extra reset also panics the system.
> 
> [...]

Applied to 5.19/scsi-fixes, thanks!

[1/1] scsi: mpt3sas: Stop fw fault watchdog work item during system shutdown
      https://git.kernel.org/mkp/scsi/c/0fde22c5420e
diff mbox series

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index b519f4b59d30..5e8887fa02c8 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -11386,6 +11386,7 @@  scsih_shutdown(struct pci_dev *pdev)
 	_scsih_ir_shutdown(ioc);
 	_scsih_nvme_shutdown(ioc);
 	mpt3sas_base_mask_interrupts(ioc);
+	mpt3sas_base_stop_watchdog(ioc);
 	ioc->shost_recovery = 1;
 	mpt3sas_base_make_ioc_ready(ioc, SOFT_RESET);
 	ioc->shost_recovery = 0;