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

Drew Fustini <[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 <ac3YJMI2U/zGEBM0@x1>
On Tue, Mar 31, 2026 at 07:48:27PM +0200, Radim Krčmář wrote:
> 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...

Thanks for reviewing.

> > 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...".

Good point, I will fix.

> 
> > +		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.

Thanks, I will fix.

> 
> > +
> > +		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().

Good point, I will switch to GENMASK and FIELD_GET.

Thanks,
Drew
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.