All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Abel Vesa" <abel.vesa@oss.qualcomm.com>
Cc: krzk+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org,
	conor+dt@kernel.org
Subject: Re: [PATCH v2 2/2] soc: qcom: llcc-qcom: Add support for Eliza
Date: Thu, 14 May 2026 04:30:26 +0000	[thread overview]
Message-ID: <20260514043026.E8B73C2BCB7@smtp.kernel.org> (raw)
In-Reply-To: <20260513-eliza-llcc-v2-2-27381ae833d5@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Dynamically calculating `num_banks` creates a critical index-shifting vulnerability for `bcast_regmap` when combined with a static 4-region DT layout.
- [Medium] The LLCC_GPU slice configuration sets `.write_scid_cacheable_en = true` but omits `.write_scid_en = true`.
--

commit 33894fa3694ee52109e04ccbe94ee141b9842f00
Author: Abel Vesa <abel.vesa@oss.qualcomm.com>

soc: qcom: llcc-qcom: Add support for Eliza

This commit adds the SoC-specific configuration and compatible string for
Eliza. Eliza uses a 4-region LLCC register layout with two per-bank base
register regions and broadcast OR/AND regions.

> diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
> index 0161ceec88421..7c05cb3619b2d 100644
> --- a/drivers/soc/qcom/llcc-qcom.c
> +++ b/drivers/soc/qcom/llcc-qcom.c

[ ... ]

> @@ -181,6 +181,171 @@ enum llcc_reg_offset {
> +	{
> +		.usecase_id = LLCC_GPU,
> +		.slice_id = 9,
> +		.max_cap = 896,
> +		.priority = 1,
> +		.bonus_ways = 0xfff,
> +		.write_scid_cacheable_en = true,
> +	},

The LLCC_GPU slice configures .write_scid_cacheable_en = true but omits
setting .write_scid_en = true. Without write_scid_en set, the corresponding
bit in the LLCC_TRP_WRS_EN register evaluates to 0 and is not enabled.

Without the hardware write allocator enabled for this SCID, could the
cacheable setting be rendered ineffective? Other comparable configurations
like glymur_data explicitly set both flags for the GPU slice.

[ ... ]

> @@ -4141,6 +4306,15 @@ static const u32 llcc_v6_reg_offset[] = {
>  	[LLCC_TRP_WRS_CACHEABLE_EN]	= 0x00042088,
>  };
>  
> +static const struct qcom_llcc_config eliza_cfg[] = {
> +	{
> +		.sct_data	= eliza_data,
> +		.size		= ARRAY_SIZE(eliza_data),
> +		.reg_offset	= llcc_v6_reg_offset,
> +		.edac_reg_offset = &llcc_v6_edac_reg_offset,
> +	},
> +};

Eliza uses a static 4-region Device Tree layout (llcc0, llcc1, bcast,
bcast_and). Since .num_banks is not hardcoded here, the driver will
dynamically read it from LLCC_COMMON_STATUS0.

If a defective bank is fused off on a lower-binned SKU, num_banks would be
read as 1. The probe function initializes regmaps based on num_banks:

qcom_llcc_probe() {
    ...
    for (i = 1; i < num_banks; i++) {
        ...
    }
    
    drv_data->bcast_regmap = qcom_llcc_init_mmio(pdev, i, "llcc_broadcast_base");
    ...
}

If num_banks is 1, the loop exits with i = 1. The driver will then map
index 1 from the Device Tree to bcast_regmap. Since index 1 corresponds to
llcc1_base in a static 4-region layout, could this result in broadcast
commands being incorrectly written to the llcc1 base registers, causing
memory corruption and non-functional broadcasts?

Should .num_banks = 2 be explicitly hardcoded here to prevent this index
shifting, or should the driver be updated to map resources by name instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260513-eliza-llcc-v2-0-27381ae833d5@oss.qualcomm.com?part=2

      reply	other threads:[~2026-05-14  4:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 11:11 [PATCH v2 0/2] soc: qcom: llcc-qcom: Add support for Eliza and document bindings Abel Vesa
2026-05-13 11:11 ` [PATCH v2 1/2] dt-bindings: cache: qcom,llcc: Document Eliza LLCC block Abel Vesa
2026-05-14  4:15   ` sashiko-bot
2026-05-13 11:11 ` [PATCH v2 2/2] soc: qcom: llcc-qcom: Add support for Eliza Abel Vesa
2026-05-14  4:30   ` sashiko-bot [this message]

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=20260514043026.E8B73C2BCB7@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=abel.vesa@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.