Re: [PATCH RFC v2 08/17] RISC-V: QoS: add resctrl interface for CBQRI controllers

Radim Krčmář <[email protected]>
Newsgroups dev.linux.lists.acpica-devel,org.infradead.lists.linux-riscv,org.kernel.vger.linux-acpi,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
2026-01-28T12:27:29-08:00, Drew Fustini <[email protected]>:
> Add interface for CBQRI controller drivers to make use of the resctrl
> filesystem.
>
> Co-developed-by: Adrien Ricciardi <[email protected]>
> Signed-off-by: Adrien Ricciardi <[email protected]>
> Signed-off-by: Drew Fustini <[email protected]>
> ---

Hi Drew, I have just a few minor comments as I noticed that you plan to
send a new version soon, so I'll try for a review then...

> diff --git a/arch/riscv/kernel/qos/qos_resctrl.c b/arch/riscv/kernel/qos/qos_resctrl.c
> +static int cbqri_probe_controller(struct cbqri_controller_info *ctrl_info,
> +				  struct cbqri_controller *ctrl)
> +{
> +	int err = 0, status;
> +	u64 reg;
[...]
> +	ctrl->base = ioremap(ctrl_info->addr, ctrl_info->size);
> +	if (!ctrl->base) {
> +		pr_warn("%s(): goto err_release_mem_region", __func__);

Missing "err = -E...".

> +		goto err_release_mem_region;
> +	}
[...]
> +		ctrl->ver_minor = reg & CBQRI_CC_CAPABILITIES_VER_MINOR_MASK;
> +		ctrl->ver_major = reg & CBQRI_CC_CAPABILITIES_VER_MAJOR_MASK;

Major version is shifted.

> +
> +		ctrl->cc.supports_alloc_op_flush_rcid = (reg >> CBQRI_CC_CAPABILITIES_FRCID_SHIFT)
> +			& CBQRI_CC_CAPABILITIES_FRCID_MASK;

FIELD_GET() could be used to make the mask+shift pattern nicer when
defined by GENMASK().

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.