dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kishore Batta" <kishore.batta@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v7 4/7] bus: mhi: Add QDU100 Sahara variant and firmware fallback
Date: Thu, 08 Oct 2026 06:35:24 +0000	[thread overview]
Message-ID: <sashiko-outbox-163699@kernel.org> (raw)
In-Reply-To: <20261008-sahara_protocol_new_v2-v7-4-90d278bd7414@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] sahara: unintended firmware fallback behavior for AIC100/AIC200
--

commit 02c795f9adf45b209ef5da56b858e0490ac4667d
Author: Kishore Batta <kishore.batta@oss.qualcomm.com>

bus: mhi: Add QDU100 Sahara variant and firmware fallback

This commit extends the Sahara driver to recognize QDU100 devices and adds
a firmware lookup fallback for unspecified image IDs. It allows QDU100
devices to request required images to be provisioned by the platform.

> bus: mhi: Add QDU100 Sahara variant and firmware fallback
>
> The Sahara driver currently selects a firmware image table based on the
> attached device, but it does not recognize QDU100 devices that expose the
> protocol on the SAHARA MHI channel. As a result, the host cannot associate
> QDU100 devices with the correct firmware namespace during image transfer.
>
> Extend the probe time variant selection to match the SAHARA MHI channel and
> associate it with the QDU100 firmware folder. Add a firmware lookup
> fallback for cases where an image does not have an explicit entry in the
> device's firmware table. This allows required images to be provisioned by
> the platform.
>
> This change only affects devices matched on the SAHARA MHI channel and
> does not change behavior for existing AIC100 and AIC200 devices.

[Severity: Medium]
Is this statement accurate?

Since fw_folder is populated for existing AIC100 devices (for example, in
drivers/accel/qaic/mhi_controller.c where aic100_sahara_fw sets
fw_folder = "aic100"), the new fallback lookup in sahara_find_image() will
also apply to them. If an AIC100 target requests an unspecified image ID, it
will now trigger a filesystem lookup instead of being immediately rejected.

Does this unintentionally change the behavior for existing devices?

> Signed-off-by: Kishore Batta <kishore.batta@oss.qualcomm.com>

> diff --git a/drivers/bus/mhi/host/clients/sahara/sahara.c b/drivers/bus/mhi/host/clients/sahara/sahara.c
> index e339c67e236af..7fe5158c17e98 100644
> --- a/drivers/bus/mhi/host/clients/sahara/sahara.c
> +++ b/drivers/bus/mhi/host/clients/sahara/sahara.c
[ ... ]
> @@ -201,8 +202,28 @@ static int sahara_find_image(struct sahara_context *context, u32 image_id)
>  	}
>  
>  	if (image_id >= context->table_size || !context->image_table[image_id]) {
> -		dev_err(&context->mhi_dev->dev, "request for unknown image: %d\n", image_id);
> -		return -EINVAL;
> +		if (!context->fw_folder) {
> +			dev_err(&context->mhi_dev->dev,
> +				"Request for unknown image: %u (no fw folder)\n", image_id);
> +			return -EINVAL;
> +		}
> +
> +		fw_path = kasprintf(GFP_KERNEL, "qcom/%s/%u",
> +				    context->fw_folder, image_id);

[Severity: Medium]
Could this unintentionally execute for AIC100 and AIC200 devices?

Because aic100_sahara_fw sets .fw_folder = "aic100", context->fw_folder will
be valid for these devices. An unknown image_id request from an AIC100 device
will fall through to this path and perform a filesystem lookup instead of
returning -EINVAL immediately.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261008-sahara_protocol_new_v2-v7-0-90d278bd7414@oss.qualcomm.com?part=4

  reply	other threads:[~2026-10-08  6:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08  6:23 [PATCH v7 0/7] Qualcomm Sahara protocol enhancements Kishore Batta
2026-10-08  6:23 ` [PATCH v7 1/7] Add documentation for Sahara protocol Kishore Batta
2026-10-08  6:28   ` sashiko-bot
2026-10-08  6:23 ` [PATCH v7 2/7] bus: mhi: Move Sahara protocol driver under MHI host client drivers Kishore Batta
2026-10-08  6:36   ` sashiko-bot
2026-10-08  6:23 ` [PATCH v7 3/7] bus: mhi: Centralize Sahara firmware image table selection at probe time Kishore Batta
2026-10-08  6:23 ` [PATCH v7 4/7] bus: mhi: Add QDU100 Sahara variant and firmware fallback Kishore Batta
2026-10-08  6:35   ` sashiko-bot [this message]
2026-10-08  6:23 ` [PATCH v7 5/7] bus: mhi: Load DDR training data using device serial number Kishore Batta
2026-10-08  6:23 ` [PATCH v7 6/7] bus: mhi: Capture DDR training data via command mode Kishore Batta
2026-10-08  6:35   ` sashiko-bot
2026-10-08  6:23 ` [PATCH v7 7/7] bus: mhi: Expose DDR training data via controller sysfs Kishore Batta
2026-10-08  6:39   ` sashiko-bot
2026-10-11 16:33 ` [PATCH v7 0/7] Qualcomm Sahara protocol enhancements Manivannan Sadhasivam
2026-10-12 18:12   ` 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=sashiko-outbox-163699@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kishore.batta@oss.qualcomm.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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