From: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Bryan O'Donoghue <bod@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Subject: Re: [PATCH v9 02/19] media: iris: Add Gen2 firmware autodetect and fallback
Date: Fri, 25 Sep 2026 18:24:08 +0530 [thread overview]
Message-ID: <14797f32-9355-4b81-b805-af4d8d8ef5f3@oss.qualcomm.com> (raw)
In-Reply-To: <bbf66d18-0587-41d1-a902-32686f66fa76@linaro.org>
On 9/24/2026 6:06 PM, Bryan O'Donoghue wrote:
> On 31/07/2026 00:48, Dmitry Baryshkov wrote:
>> +
>> +/*
>> + * Detect the firmware generation and publish the descriptor. Run
>> only after
>> + * qcom_mdt_load() has succeeded, so the driver commits to a HFI
>> generation
>> + * only for a firmware image that has actually been loaded.
>> + *
>> + * The generation is detected from the loaded image (@data / @size
>> point at the
>> + * reserved memory region populated by qcom_mdt_load()) rather than
>> from the
>> + * request_firmware() blob: for a split .mdt the latter holds only
>> the ELF
>> + * headers, while QC_IMAGE_VERSION_STRING lives in the .bNN data
>> segments.
>> + *
>> + * The descriptor and firmware data are published exactly once,
>> before any
>> + * session exists, so the lockless readers in the ioctl paths never
>> observe a
>> + * reassignment. Later bring-ups reuse the already published descriptor.
>> + */
>> +static void iris_detect_firmware(struct iris_core *core, const char
>> *fw_name,
>> + const u8 *data, size_t size,
>> + const struct iris_firmware_desc *desc)
>> +{
>> + if (core->iris_firmware_desc)
>> + return;
>> +
>> + /*
>> + * With a DT firmware-name override on a dual-generation platform
>> the
>> + * image on disk decides the generation, so inspect it and switch
>> to the
>> + * Gen1 descriptor when a Gen1 image was loaded.
>> + */
>> + if (desc == core->iris_platform_data->firmware_desc_gen2 &&
>> + core->iris_platform_data->firmware_desc_gen1 &&
>> + of_property_present(dev_of_node(core->dev), "firmware-name") &&
>> + !iris_detect_gen2_from_fwdata(data, size)) {
>> + dev_info(core->dev, "Gen1 FW detected in %s\n", fw_name);
>> + desc = core->iris_platform_data->firmware_desc_gen1;
>> + }
>> +
>> + /* Publish iris_firmware_data first, then iris_firmware_desc (the
>> guard). */
>> + core->iris_firmware_data = desc->firmware_data;
>> + core->iris_firmware_desc = desc;
>> +}
>> +
>
> In function ‘iris_detect_firmware’,
> inlined from ‘iris_load_fw_to_memory’ at drivers/media/platform/
> qcom/iris/iris_firmware.c:216:3:
> drivers/media/platform/qcom/iris/iris_firmware.c:161:12: warning: ‘desc’
> may be used uninitialized [-Wmaybe-uninitialized]
> 161 | if (desc == core->iris_platform_data-
> >firmware_desc_gen2 &&
> | ^
> drivers/media/platform/qcom/iris/iris_firmware.c: In function
> ‘iris_load_fw_to_memory’:
> drivers/media/platform/qcom/iris/iris_firmware.c:176:42: note: ‘desc’
> was declared here
> 176 | const struct iris_firmware_desc *desc;
> | ^~~~
> In function ‘iris_detect_firmware’,
> inlined from ‘iris_load_fw_to_memory’ at drivers/media/platform/
> qcom/iris/iris_firmware.c:216:3:
> drivers/media/platform/qcom/iris/iris_firmware.c:170:40: warning: ‘desc’
> may be used uninitialized [-Wmaybe-uninitialized]
> 170 | core->iris_firmware_data = desc->firmware_data;
> | ~~~~^~~~~~~~~~~~~~~
> drivers/media/platform/qcom/iris/iris_firmware.c: In function
> ‘iris_load_fw_to_memory’:
> drivers/media/platform/qcom/iris/iris_firmware.c:176:42: note: ‘desc’
> was declared here
> 176 | const struct iris_firmware_desc *desc;
> | ^~~~
> . "$TS_DIR"/lib/common-end.sh
> #!/bin/sh
> # Copyright 2024 Google LLC
>
> Proposed fix
>
> ╰─$ git diff
> diff --git a/drivers/media/platform/qcom/iris/iris_firmware.c b/drivers/
> media/platform/qcom/iris/iris_firmware.c
> index dfc4c184646c6..39558a300d38c 100644
> --- a/drivers/media/platform/qcom/iris/iris_firmware.c
> +++ b/drivers/media/platform/qcom/iris/iris_firmware.c
> @@ -153,6 +153,9 @@ static void iris_detect_firmware(struct iris_core
> *core, const char *fw_name,
> if (core->iris_firmware_desc)
> return;
>
> + if (!desc)
> + return;
> +
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
next prev parent reply other threads:[~2026-09-25 12:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 23:48 [PATCH v9 00/19] media: iris: Add AR50LT core support and enable Agatti platform Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 01/19] Revert "media: iris: Add Gen2 firmware autodetect and fallback" Dmitry Baryshkov
2026-07-31 8:31 ` Bryan O'Donoghue
2026-09-23 6:16 ` Vishnu Reddy
2026-07-30 23:48 ` [PATCH v9 02/19] media: iris: Add Gen2 firmware autodetect and fallback Dmitry Baryshkov
2026-09-24 3:58 ` Vishnu Reddy
2026-09-24 12:36 ` Bryan O'Donoghue
2026-09-25 12:54 ` Vikash Garodia [this message]
2026-07-30 23:48 ` [PATCH v9 03/19] media: iris: Skip UBWC configuration when not supported Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 04/19] media: iris: drop IRIS_FMT_foo enumeration Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 05/19] media: iris: Filter UBWC raw formats based on hardware capabilities Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 06/19] media: iris: Introduce set_preset_register as a vpu_op Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 07/19] media: iris: Introduce interrupt_init " Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 08/19] media: iris: add vpu op hook to disable ARP buffer Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 09/19] media: iris: Add platform data field for watchdog interrupt mask Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 10/19] media: iris: Add platform flag for instantaneous bandwidth voting Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 11/19] media: iris: skip PIPE if it is not supported by the platform Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 12/19] media: iris: Add framework support for AR50_LITE video core Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 13/19] media: iris: add minimal GET_PROPERTY implementation Dmitry Baryshkov
2026-07-30 23:48 ` [PATCH v9 14/19] media: iris: update buffer requirements based on received info Dmitry Baryshkov
2026-07-30 23:53 ` [PATCH v9 15/19] media: iris: implement support for the Agatti platform Dmitry Baryshkov
2026-07-30 23:54 ` [PATCH v9 16/19] media: iris: Introduce buffer size calculations for AR50LT Dmitry Baryshkov
2026-07-30 23:54 ` [PATCH v9 17/19] media: iris: add Gen2 firmware support on the Agatti platform Dmitry Baryshkov
2026-07-30 23:54 ` [PATCH v9 18/19] media: venus: skip QCM2290 if Iris driver is enabled Dmitry Baryshkov
2026-07-30 23:54 ` [PATCH v9 19/19] media: iris: constify inst_fw_cap_sm8250_dec Dmitry Baryshkov
2026-07-31 5:27 ` [PATCH v9 00/19] media: iris: Add AR50LT core support and enable Agatti platform Vikash Garodia
2026-07-31 12:30 ` Dmitry Baryshkov
2026-09-17 10:48 ` Vikash Garodia
2026-09-25 9:22 ` Gourav Kumar
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=14797f32-9355-4b81-b805-af4d8d8ef5f3@oss.qualcomm.com \
--to=vikash.garodia@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=andersson@kernel.org \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=busanna.reddy@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=robh@kernel.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®