Skip to contentSkip to conversation

firmware: microchip: fix incorrect error report of programming:timeout on success

PATCH Applied Conor Dooley 1 participant 2 messages Aug 9, 2024 – Aug 22, 2024

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

PATCH 1/1 firmware: microchip: fix incorrect error report of programming:timeout on success

From: Steve Wilkins <[email protected]>

After successfully programming the SPI flash with an MFPS auto update image, the error sysfs attribute reports programming:timeout. This is caused by an incorrect check on the return value from wait_for_completion_timeout() in mpfs_auto_update_poll_complete().

Fixes ec5b0f1193ad ("firmware: microchip: add PolarFire SoC Auto Update support")

---
I took the liberty of converting if (ret == 0) to if (!ret).

---
 drivers/firmware/microchip/mpfs-auto-update.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/microchip/mpfs-auto-update.c +1 -1
index 30de47895b1c..9ca5ee58edbd 100644
@@ -166,7 +166,7 @@ static enum fw_upload_err mpfs_auto_update_poll_complete(struct fw_upload *fw_up
 	 */
 	ret = wait_for_completion_timeout(&priv->programming_complete,
 					  msecs_to_jiffies(AUTO_UPDATE_TIMEOUT_MS));
-	if (ret)
+	if (!ret)
 		return FW_UPLOAD_ERR_TIMEOUT;
 
 	return FW_UPLOAD_ERR_NONE;
Signature · 1 line
2.43.0
author Applied
#1 lore raw

From: Conor Dooley <[email protected]>

Quoted 6 lines · Conor Dooley

After successfully programming the SPI flash with an MFPS auto update image, the error sysfs attribute reports programming:timeout. This is caused by an incorrect check on the return value from wait_for_completion_timeout() in mpfs_auto_update_poll_complete().

Applied to riscv-soc-fixes, thanks!

[1/1] firmware: microchip: fix incorrect error report of programming:timeout on success

      https://git.kernel.org/conor/c/591940e22e28

Thanks,
Conor.