From: Conor Dooley <conor@kernel.org>
To: Conor Dooley <conor.dooley@microchip.com>
Cc: Jamie Gibbons <jamie.gibbons@microchip.com>,
Daire McNamara <daire.mcnamara@microchip.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] firmware: microchip: auto-update: fix poll_complete() to not report spurious timeout errors
Date: Wed, 16 Oct 2024 17:36:21 +0100 [thread overview]
Message-ID: <20241016-abdomen-agent-4f24e0f68fbf@spud> (raw)
In-Reply-To: <20241016-slouching-excess-d7a62fc926a1@spud>
[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]
On Wed, Oct 16, 2024 at 05:35:06PM +0100, Conor Dooley wrote:
> From: Conor Dooley <conor.dooley@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@microchip.com>
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
note to self
CC: stable@vger.kernel.org
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-10-16 16:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 16:35 Conor Dooley
2024-10-16 16:36 ` Conor Dooley [this message]
2024-10-16 16:54 ` Jamie.Gibbons
2024-10-17 16:41 ` Conor Dooley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241016-abdomen-agent-4f24e0f68fbf@spud \
--to=conor@kernel.org \
--cc=conor.dooley@microchip.com \
--cc=daire.mcnamara@microchip.com \
--cc=jamie.gibbons@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®