[PATCH 1/9] drm/tyr: validate presence of CSF shared section

From: Laura Nao

Date: Tue Sep 15 2026 - 06:59:02 EST


From: Deborah Brouwer <deborah.brouwer@xxxxxxxxxxxxx>

The firmware binary must have a shared section for communicating with
the MCU. Check for this section after parsing and fail with -EINVAL if it
is missing.

Signed-off-by: Deborah Brouwer <deborah.brouwer@xxxxxxxxxxxxx>
Signed-off-by: Laura Nao <laura.nao@xxxxxxxxxxxxx>
---
drivers/gpu/drm/tyr/fw/parser.rs | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/tyr/fw/parser.rs b/drivers/gpu/drm/tyr/fw/parser.rs
index c4d0ad1d7899..8bddaa1f0aa2 100644
--- a/drivers/gpu/drm/tyr/fw/parser.rs
+++ b/drivers/gpu/drm/tyr/fw/parser.rs
@@ -197,6 +197,20 @@ pub(super) fn parse(&mut self) -> Result<KVec<ParsedSection>> {
return Err(EINVAL);
}

+ // Validate that the firmware contains the required shared memory section.
+ let has_shared_section = parsed_sections
+ .iter()
+ .any(|section| section.va.start == super::CSF_MCU_SHARED_REGION_START);
+
+ if !has_shared_section {
+ dev_err!(
+ self.cursor.dev,
+ "No shared section found at 0x{:08x} in firmware\n",
+ super::CSF_MCU_SHARED_REGION_START
+ );
+ return Err(EINVAL);
+ }
+
Ok(parsed_sections)
}


--
2.39.5