Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] firmware: microchip: fix incorrect error report of programming:timeout on success
@ 2024-08-09 13:47 Conor Dooley
  2024-08-22 19:47 ` Conor Dooley
  0 siblings, 1 reply; 2+ messages in thread
From: Conor Dooley @ 2024-08-09 13:47 UTC (permalink / raw)
  To: linux-riscv; +Cc: conor, Steve Wilkins, linux-kernel, Conor Dooley

From: Steve Wilkins <steve.wilkins@raymarine.com>

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")
Signed-off-by: Steve Wilkins <steve.wilkins@raymarine.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
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(-)

diff --git a/drivers/firmware/microchip/mpfs-auto-update.c b/drivers/firmware/microchip/mpfs-auto-update.c
index 30de47895b1c..9ca5ee58edbd 100644
--- a/drivers/firmware/microchip/mpfs-auto-update.c
+++ b/drivers/firmware/microchip/mpfs-auto-update.c
@@ -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;
-- 
2.43.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] firmware: microchip: fix incorrect error report of programming:timeout on success
  2024-08-09 13:47 [PATCH v1] firmware: microchip: fix incorrect error report of programming:timeout on success Conor Dooley
@ 2024-08-22 19:47 ` Conor Dooley
  0 siblings, 0 replies; 2+ messages in thread
From: Conor Dooley @ 2024-08-22 19:47 UTC (permalink / raw)
  To: linux-riscv, Conor Dooley; +Cc: Conor Dooley, Steve Wilkins, linux-kernel

From: Conor Dooley <conor.dooley@microchip.com>

On Fri, 09 Aug 2024 14:47:44 +0100, Conor Dooley wrote:
> 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.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-22 19:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-09 13:47 [PATCH v1] firmware: microchip: fix incorrect error report of programming:timeout on success Conor Dooley
2024-08-22 19:47 ` Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox