Re: [PATCH v6 8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver
From: sashiko-bot
Date: Wed Jul 29 2026 - 21:24:15 EST
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The probe function unconditionally fails if the `riscv,cbqri-rcid` device tree property is missing, which breaks support for monitoring-only capacity controllers.
--
--- Patch [8]: [PATCH v6 8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver ---
commit 954af62b51bb07d376a8671fb6db032a2ae482bc
Author: Drew Fustini <fustini@xxxxxxxxxx>
riscv_cbqri: Add CBQRI capacity allocation platform driver
This commit adds a device-tree platform driver for the RISC-V CBQRI capacity
controller. It binds to the "riscv,cbqri-capacity-controller" compatible,
determines the cache domain, and registers the controller with the resctrl
framework.
> 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
[ ... ]
> +static int cbqri_capacity_probe(struct platform_device *pdev)
> +{
[ ... ]
> + 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]
Will this unconditionally failing check prevent monitoring-only controllers
from probing?
The core registration logic in riscv_cbqri_register_cc_dt() indicates that
monitoring-only controllers do not need an RCID count.
However, by returning an error when the riscv,cbqri-rcid property is absent,
the driver appears to reject valid monitoring-only controllers before they
can be registered.
Would it be better to treat this property as optional and default rcid_count
to 0 if it is missing?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260729-dfustini-atl-sc-cbqri-dt-v6-0-7c22b05d461b@xxxxxxxxxx?part=8