Re: [PATCH v8 5/5] riscv_cbqri: Add CBQRI capacity allocation platform driver

From: sashiko-bot

Date: Thu Sep 17 2026 - 15:47:24 EST


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] cbqri: probe fails for monitoring-only capacity controllers
--

commit 8ddfa638686f4f96df4bb905203f8a16edb1ece7
Author: Drew Fustini <fustini@xxxxxxxxxx>

riscv_cbqri: Add CBQRI capacity allocation platform driver

This commit adds a platform driver for CBQRI capacity controllers
described in device tree. The driver registers the controller with
the CBQRI core to expose it through resctrl.

> diff --git a/drivers/resctrl/cbqri_capacity.c b/drivers/resctrl/cbqri_capacity.c
> new file mode 100644
> index 0000000000000..0670a676bdb1f
> --- /dev/null
> +++ b/drivers/resctrl/cbqri_capacity.c
> @@ -0,0 +1,127 @@
[ ... ]
> +static int cbqri_capacity_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct cbqri_controller_info info = {};
> + struct device_node *cache_np;
> + struct resource *res;
> + u32 rcid_count, cache_level;
> + int cache_id, cpu, ret;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res)
> + return -EINVAL;
> +
> + ret = of_property_read_u32(dev->of_node, "riscv,cbqri-rcid", &rcid_count);
> + if (ret) {
> + dev_err(dev, "missing riscv,cbqri-rcid\n");
> + return ret;
> + }

[Severity: Medium]
Does this unconditionally fail probe for valid monitoring-only capacity
controllers?

Monitoring-only controllers legitimately omit the riscv,cbqri-rcid property,
but this unconditional check returns an error if the property is missing.

The core driver riscv_cbqri_register_cc_dt() explicitly supports
rcid_count == 0 for monitoring-only controllers, but making this property
mandatory here prevents them from being used.

> +
> + cache_np = of_parse_phandle(dev->of_node, "riscv,cbqri-cache", 0);
> + if (!cache_np) {
> + dev_err(dev, "missing riscv,cbqri-cache phandle\n");
> + return -EINVAL;
> + }

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-dfustini-atl-sc-cbqri-dt-v8-0-7964e8d73fe8@xxxxxxxxxx?part=5