[PATCH v1] firmware: microchip: auto-update: fix poll_complete() to not report spurious timeout errors
Conor Dooley
conor at kernel.org
Wed Oct 16 09:36:21 PDT 2024
On Wed, Oct 16, 2024 at 05:35:06PM +0100, Conor Dooley wrote:
> From: Conor Dooley <conor.dooley at microchip.com>
>
> fw_upload's poll_complete() is really intended for use with
> asynchronous write() implementations - or at least those where the
> write() loop may terminate without the kernel yet being aware of whether
> or not the firmware upload has succeeded. For auto-update, write() is
> only ever called once and will only return when uploading has completed,
> be that by passing or failing. The core fw_upload code only calls
> poll_complete() after the final call to write() has returned.
>
> However, the poll_complete() implementation in the auto-update driver
> was written to expect poll_complete() to be called from another context,
> and it waits for a completion signalled from write(). Since
> poll_complete() is actually called from the same context, after the
> write() loop has terminated, wait_for_completion() never sees the
> completion get signalled and always times out, causing programming to
> always report a failing.
>
> Since write() is full synchronous, and its return value will indicate
> whether or not programming passed or failed, poll_complete() serves no
> purpose and can be cut down to simply return FW_UPLOAD_ERR_NONE.
>
> Fixes: ec5b0f1193ad4 ("firmware: microchip: add PolarFire SoC Auto Update support")
> Reported-by: Jamie Gibbons <jamie.gibbons at microchip.com>
> Signed-off-by: Conor Dooley <conor.dooley at microchip.com>
note to self
CC: stable at vger.kernel.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20241016/80fd9f05/attachment.sig>
More information about the linux-riscv
mailing list