Re: [PATCH v2 02/10] gpu: nova-core: fsp: catch bogus queue pointer issues

"Alexandre Courbot" <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux,dev.linux.lists.nova-gpu,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Fri Jul 3, 2026 at 3:22 AM PDT, Eliot Courtney wrote:
> Currently, `poll_msgq` will report a message of size 4 if the queue
> pointers are broken. It's easy to catch this if it occurs, so have
> `poll_msgq` return an error in this case.
>
> Reviewed-by: Alistair Popple <[email protected]>
> Signed-off-by: Eliot Courtney <[email protected]>

Merged into drm-rust-next, thanks! With the fix mentioned below.

> ---
>  drivers/gpu/nova-core/falcon/fsp.rs | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/falcon/fsp.rs b/drivers/gpu/nova-core/falcon/fsp.rs
> index 7cd9604d1f4d..3752448df431 100644
> --- a/drivers/gpu/nova-core/falcon/fsp.rs
> +++ b/drivers/gpu/nova-core/falcon/fsp.rs
> @@ -109,19 +109,22 @@ fn read_emem(&mut self, data: &mut [u8]) -> Result {
>      /// Poll FSP for incoming data.
>      ///
>      /// Returns the size of available data in bytes, or 0 if no data is available.
> +    /// Returns an error if the queue pointers are bogus (`tail < head`).

Let's say which error since there can only be one in this case.

Also nit: Let's also move this to its own paragraph so the success and
error cases are clearly separate.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.