Re: [PATCH v2 02/10] gpu: nova-core: fsp: catch bogus queue pointer issues
"Alexandre Courbot" <[email protected]> Thu, 23 Jul 2026 11:55:21 +0900
| Newsgroups | dev.linux.lists.nova-gpu,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux |
|---|---|
| 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.