* [PATCH] scsi: pm8001: reject firmware update in fatal error state
@ 2026-04-16 15:37 Sagar Biradar
2026-05-15 2:09 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Sagar Biradar @ 2026-04-16 15:37 UTC (permalink / raw)
To: Martin K . Petersen, James Bottomley, Jack Wang
Cc: linux-scsi, stable, Brian King, Don Brace, Raja VS,
Kumar Meiyappan, Abhinav Kuchibhotla, Uday kumar Bagam,
Advait Churi, Sagar Biradar
From: Kumar Meiyappan <kumar.meiyappan@microchip.com>
pm8001_store_update_fw() allows a firmware update request even
when the controller has already entered a fatal error state.
Firmware update is not valid once the controller is in that state,
and attempting it can lead to a call trace. Reject the request
early by checking controller_fatal_error, set the firmware
status to FAIL_PARAMETERS, and return -EINVAL.
Signed-off-by: Kumar Meiyappan <kumar.meiyappan@microchip.com>
Signed-off-by: Sagar Biradar <sagar.biradar@microchip.com>
---
drivers/scsi/pm8001/pm8001_ctl.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
index cbfda8c04e95..bb38b2d63acb 100644
--- a/drivers/scsi/pm8001/pm8001_ctl.c
+++ b/drivers/scsi/pm8001/pm8001_ctl.c
@@ -826,6 +826,14 @@ static ssize_t pm8001_store_update_fw(struct device *cdev,
goto out;
}
+ if (pm8001_ha->controller_fatal_error) {
+ pm8001_dbg(pm8001_ha, FAIL,
+ "controller in fatal error state, firmware update rejected\n");
+ pm8001_ha->fw_status = FAIL_PARAMETERS;
+ ret = -EINVAL;
+ goto out;
+ }
+
for (i = 0; flash_command_table[i].code != FLASH_CMD_NONE; i++) {
if (!memcmp(flash_command_table[i].command,
cmd_ptr, strlen(cmd_ptr))) {
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi: pm8001: reject firmware update in fatal error state
2026-04-16 15:37 [PATCH] scsi: pm8001: reject firmware update in fatal error state Sagar Biradar
@ 2026-05-15 2:09 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2026-05-15 2:09 UTC (permalink / raw)
To: Sagar Biradar
Cc: Martin K . Petersen, James Bottomley, Jack Wang, linux-scsi,
stable, Brian King, Don Brace, Raja VS, Kumar Meiyappan,
Abhinav Kuchibhotla, Uday kumar Bagam, Advait Churi
Sagar,
> pm8001_store_update_fw() allows a firmware update request even when
> the controller has already entered a fatal error state.
>
> Firmware update is not valid once the controller is in that state, and
> attempting it can lead to a call trace. Reject the request early by
> checking controller_fatal_error, set the firmware status to
> FAIL_PARAMETERS, and return -EINVAL.
Applied to 7.2/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-15 2:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16 15:37 [PATCH] scsi: pm8001: reject firmware update in fatal error state Sagar Biradar
2026-05-15 2:09 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.