From: Kishore Batta <kishore.batta@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>
Cc: jeff.hugo@oss.qualcomm.com, bjorn.andersson@oss.qualcomm.com,
konradybcio@kernel.org, konrad.dybcio@oss.qualcomm.com,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v1 02/12] drivers: accel : Move AIC specific image tables to mhi_controller.c file
Date: Sat, 7 Mar 2026 17:00:59 +0530 [thread overview]
Message-ID: <84e67d29-532f-4e47-a888-aef3a553b67b@oss.qualcomm.com> (raw)
In-Reply-To: <b57hqn6vnej6uab43cppt2fj4ugsg5ifornc7puajaxipetu2e@nigbpn2f7k7c>
On 8/26/2025 2:38 AM, Bjorn Andersson wrote:
> On Mon, Aug 25, 2025 at 03:49:16PM +0530, Kishore Batta wrote:
>
> "git log --oneline -- drivers/accel/qaic/sahara.c" says that subject
> prefix should be "accel/qaic: "
>
>> Move the AIC-specific image tables from the Sahara driver to the AIC
>> specific controller file. This change prevents the Sahara driver from
>> being tagged to a specific Qualcomm device, making it easier to add
>> support for new devices with their own image tables.
> I don't have any concerns with moving the firmware mapping out of the
> sahara driver, but the implementation already supports two different
> devices...so it's not "tagged to a specific device".
>
> Also, while at it, please start your commit message with a problem
> statement and finish it with the technical description of the change
> you're doing.
Apologies for the delayed response. It took some time to sort out the
issue with kernel_boot.elf image. Acknowledged. In v2, I'm no longer
claiming the driver is tagged to a single device. Instead, the
motivation is that the implementation lived under QAIC even though its
an MHI protocol driver used by multiple devices. The driver will now be
moved to drivers/bus/mhi and structured as a reusable MHI protocol
driver. In v2, all commit messages are rewritten to begin with the
problem being solved and then describe the technical approach/changes.
>> Signed-off-by: Kishore Batta <kishore.batta@oss.qualcomm.com>
>> ---
>> drivers/accel/qaic/mhi_controller.c | 43 +++++++++++++++++++++++++++++
>> drivers/accel/qaic/sahara.c | 43 ++---------------------------
>> drivers/accel/qaic/sahara.h | 7 +++++
>> 3 files changed, 52 insertions(+), 41 deletions(-)
>>
>> diff --git a/drivers/accel/qaic/mhi_controller.c b/drivers/accel/qaic/mhi_controller.c
>> index 13a14c6c6168..5cc7994f4809 100644
>> --- a/drivers/accel/qaic/mhi_controller.c
>> +++ b/drivers/accel/qaic/mhi_controller.c
>> @@ -790,6 +790,49 @@ static struct mhi_controller_config mhi_cntrl_configs[] = {
>> },
>> };
>>
>> +const char * const aic100_image_table[] = {
>> + [1] = "qcom/aic100/fw1.bin",
>> + [2] = "qcom/aic100/fw2.bin",
>> + [4] = "qcom/aic100/fw4.bin",
>> + [5] = "qcom/aic100/fw5.bin",
>> + [6] = "qcom/aic100/fw6.bin",
>> + [8] = "qcom/aic100/fw8.bin",
>> + [9] = "qcom/aic100/fw9.bin",
>> + [10] = "qcom/aic100/fw10.bin",
>> +};
>> +
>> +const size_t aic100_image_table_size = ARRAY_SIZE(aic100_image_table);
>> +
>> +const char * const aic200_image_table[] = {
>> + [5] = "qcom/aic200/uefi.elf",
>> + [12] = "qcom/aic200/aic200-nsp.bin",
>> + [23] = "qcom/aic200/aop.mbn",
>> + [32] = "qcom/aic200/tz.mbn",
>> + [33] = "qcom/aic200/hypvm.mbn",
>> + [39] = "qcom/aic200/aic200_abl.elf",
>> + [40] = "qcom/aic200/apdp.mbn",
>> + [41] = "qcom/aic200/devcfg.mbn",
>> + [42] = "qcom/aic200/sec.elf",
>> + [43] = "qcom/aic200/aic200-hlos.elf",
>> + [49] = "qcom/aic200/shrm.elf",
>> + [50] = "qcom/aic200/cpucp.elf",
>> + [51] = "qcom/aic200/aop_devcfg.mbn",
>> + [57] = "qcom/aic200/cpucp_dtbs.elf",
>> + [62] = "qcom/aic200/uefi_dtbs.elf",
>> + [63] = "qcom/aic200/xbl_ac_config.mbn",
>> + [64] = "qcom/aic200/tz_ac_config.mbn",
>> + [65] = "qcom/aic200/hyp_ac_config.mbn",
>> + [66] = "qcom/aic200/pdp.elf",
>> + [67] = "qcom/aic200/pdp_cdb.elf",
>> + [68] = "qcom/aic200/sdi.mbn",
>> + [69] = "qcom/aic200/dcd.mbn",
>> + [73] = "qcom/aic200/gearvm.mbn",
>> + [74] = "qcom/aic200/sti.bin",
>> + [75] = "qcom/aic200/pvs.bin",
>> +};
>> +
>> +const size_t aic200_image_table_size = ARRAY_SIZE(aic200_image_table);
>> +
>> static int mhi_read_reg(struct mhi_controller *mhi_cntrl, void __iomem *addr, u32 *out)
>> {
>> u32 tmp;
>> diff --git a/drivers/accel/qaic/sahara.c b/drivers/accel/qaic/sahara.c
>> index 3ebcc1f7ff58..cf8f8b585223 100644
>> --- a/drivers/accel/qaic/sahara.c
>> +++ b/drivers/accel/qaic/sahara.c
>> @@ -177,45 +177,6 @@ struct sahara_context {
>> bool is_mem_dump_mode;
>> };
>>
>> -static const char * const aic100_image_table[] = {
>> - [1] = "qcom/aic100/fw1.bin",
>> - [2] = "qcom/aic100/fw2.bin",
>> - [4] = "qcom/aic100/fw4.bin",
>> - [5] = "qcom/aic100/fw5.bin",
>> - [6] = "qcom/aic100/fw6.bin",
>> - [8] = "qcom/aic100/fw8.bin",
>> - [9] = "qcom/aic100/fw9.bin",
>> - [10] = "qcom/aic100/fw10.bin",
>> -};
>> -
>> -static const char * const aic200_image_table[] = {
>> - [5] = "qcom/aic200/uefi.elf",
>> - [12] = "qcom/aic200/aic200-nsp.bin",
>> - [23] = "qcom/aic200/aop.mbn",
>> - [32] = "qcom/aic200/tz.mbn",
>> - [33] = "qcom/aic200/hypvm.mbn",
>> - [39] = "qcom/aic200/aic200_abl.elf",
>> - [40] = "qcom/aic200/apdp.mbn",
>> - [41] = "qcom/aic200/devcfg.mbn",
>> - [42] = "qcom/aic200/sec.elf",
>> - [43] = "qcom/aic200/aic200-hlos.elf",
>> - [49] = "qcom/aic200/shrm.elf",
>> - [50] = "qcom/aic200/cpucp.elf",
>> - [51] = "qcom/aic200/aop_devcfg.mbn",
>> - [57] = "qcom/aic200/cpucp_dtbs.elf",
>> - [62] = "qcom/aic200/uefi_dtbs.elf",
>> - [63] = "qcom/aic200/xbl_ac_config.mbn",
>> - [64] = "qcom/aic200/tz_ac_config.mbn",
>> - [65] = "qcom/aic200/hyp_ac_config.mbn",
>> - [66] = "qcom/aic200/pdp.elf",
>> - [67] = "qcom/aic200/pdp_cdb.elf",
>> - [68] = "qcom/aic200/sdi.mbn",
>> - [69] = "qcom/aic200/dcd.mbn",
>> - [73] = "qcom/aic200/gearvm.mbn",
>> - [74] = "qcom/aic200/sti.bin",
>> - [75] = "qcom/aic200/pvs.bin",
>> -};
>> -
>> static int sahara_find_image(struct sahara_context *context, u32 image_id)
>> {
>> int ret;
>> @@ -779,10 +740,10 @@ static int sahara_mhi_probe(struct mhi_device *mhi_dev, const struct mhi_device_
>>
>> if (!strcmp(mhi_dev->mhi_cntrl->name, "AIC200")) {
>> context->image_table = aic200_image_table;
>> - context->table_size = ARRAY_SIZE(aic200_image_table);
>> + context->table_size = aic200_image_table_size;
>> } else {
>> context->image_table = aic100_image_table;
>> - context->table_size = ARRAY_SIZE(aic100_image_table);
>> + context->table_size = aic100_image_table_size;
>> }
>>
>> context->active_image_id = SAHARA_IMAGE_ID_NONE;
>> diff --git a/drivers/accel/qaic/sahara.h b/drivers/accel/qaic/sahara.h
>> index 640208acc0d1..d7fd447ca85b 100644
>> --- a/drivers/accel/qaic/sahara.h
>> +++ b/drivers/accel/qaic/sahara.h
>> @@ -7,4 +7,11 @@
>>
>> int sahara_register(void);
>> void sahara_unregister(void);
>> +
>> +extern const char * const aic200_image_table[];
>> +extern const size_t aic200_image_table_size;
>> +
>> +extern const char * const aic100_image_table[];
>> +extern const size_t aic100_image_table_size;
> Making sahara.c reference these arrays through extern declarations is
> pretty ugly, and in patch 4 you're forgetting to add the "static"
> keyword to the image_tables...
>
> How about introducing patch 3 first, with special handling for AIC[12]00
> and then squash this with what is now patch 4 to make the move in one
> go?
Fixed in v2 by removing extern based cross file linkage entirely.
Firmware image tables are now defined in the Sahara driver and selected
via a probe-time variant table, so there are no externs and all tables
remain static.
>
> Still need a statement in one of these commit messages to why you don't
> just add qdu_image_table[] to sahara.c...
>
> Regards,
> Bjorn
The QDU100 image table is now part of the Sahara driver and selected via
the SAHARA channel match using the probe time variant mechanism. This
avoids a separate QDU client driver and any registration API.
>> +
>> #endif /* __SAHARA_H__ */
>> --
>> 2.34.1
>>
next prev parent reply other threads:[~2026-03-07 11:31 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 10:19 [PATCH v1 00/12] Sahara protocol enhancements Kishore Batta
2025-08-25 10:19 ` [PATCH v1 01/12] Add documentation for Sahara protocol Kishore Batta
2025-08-25 10:19 ` [PATCH v1 02/12] drivers: accel : Move AIC specific image tables to mhi_controller.c file Kishore Batta
2025-08-25 21:08 ` Bjorn Andersson
2026-03-07 11:30 ` Kishore Batta [this message]
2025-08-25 10:19 ` [PATCH v1 03/12] drivers: accel: qaic: Support for registration of image tables in Sahara Kishore Batta
2025-08-25 21:26 ` Bjorn Andersson
2026-03-07 11:31 ` Kishore Batta
2025-08-25 10:19 ` [PATCH v1 04/12] drivers: accel: Register Qualcomm AIC specific image tables with Sahara Kishore Batta
2025-08-25 21:38 ` Bjorn Andersson
2026-03-07 11:31 ` Kishore Batta
2025-08-25 10:19 ` [PATCH v1 05/12] drivers: soc: qcom: Move Sahara driver to drivers/soc/qcom directory Kishore Batta
2025-08-25 22:12 ` Bjorn Andersson
2026-03-07 11:57 ` Kishore Batta
2025-08-25 10:19 ` [PATCH v1 06/12] drivers: soc: qcom: Add support for Qualcomm QDU device Kishore Batta
2025-08-25 23:24 ` Bjorn Andersson
2025-08-28 12:48 ` Kishore Batta
2026-03-07 11:32 ` Kishore Batta
2025-08-28 14:19 ` Krzysztof Kozlowski
2026-03-07 11:33 ` Kishore Batta
2026-03-07 13:20 ` Krzysztof Kozlowski
2026-03-08 6:12 ` Kishore Batta
2026-03-09 14:25 ` Kishore Batta
2025-08-25 10:19 ` [PATCH v1 07/12] drivers: soc: qcom: Add sysfs support for DDR training data in Sahara Kishore Batta
2025-08-25 22:37 ` Bjorn Andersson
2026-03-07 11:31 ` Kishore Batta
2025-08-25 10:19 ` [PATCH v1 08/12] drivers: soc: qcom: Support Sahara command mode packets(READY and EXECUTE) Kishore Batta
2025-08-25 22:58 ` Bjorn Andersson
2026-03-07 11:32 ` Kishore Batta
2025-08-28 14:20 ` Krzysztof Kozlowski
2026-03-07 11:33 ` Kishore Batta
2025-08-25 10:19 ` [PATCH v1 09/12] drivers: soc: qcom: Remove is_mem_dump_mode variable Kishore Batta
2025-08-25 22:59 ` Bjorn Andersson
2026-03-07 11:32 ` Kishore Batta
2025-08-25 10:19 ` [PATCH v1 10/12] drivers: soc: qcom: Support for DDR training in Sahara Kishore Batta
2025-08-25 23:14 ` Bjorn Andersson
2026-03-07 11:32 ` Kishore Batta
2025-08-25 10:19 ` [PATCH v1 11/12] drivers: soc: qcom: Support to load saved DDR training data " Kishore Batta
2025-08-26 2:16 ` Bjorn Andersson
2026-03-07 11:32 ` Kishore Batta
2025-08-25 10:19 ` [PATCH v1 12/12] Add sysfs ABI documentation for DDR training data node Kishore Batta
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=84e67d29-532f-4e47-a888-aef3a553b67b@oss.qualcomm.com \
--to=kishore.batta@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bjorn.andersson@oss.qualcomm.com \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.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