RE: [PATCH v4 1/5] cxl: Add function to count regblocks of a given type

From: Dan Williams
Date: Mon Apr 03 2023 - 23:59:38 EST


Jonathan Cameron wrote:
> Until the recently release CXL 3.0 specification, there
> was only ever one instance of any given register block pointed
> to by the Register Block Locator DVSEC. Now, the specification allows
> for multiple CXL PMU instances, each with their own register block.
>
> To enable this add an index parameter to cxl_find_regblock()
> and use that to implement cxl_count_regblock().
>
> Reviewed-by: Davidlohr Bueso <dave@xxxxxxxxxxxx>
> Reviewed-by: Dave Jiang <dave.jiang@xxxxxxxxx>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

If PMUs are the only consumer of multi-instance register blocks and all
other callers remain oblivious perhaps leave cxl_find_regblock() alone
and have it call a new cxl_find_regblock_instance() internally?

Otherwise, looks good to me.