Re: [PATCH v10 02/15] cxl/regs: Prepare for multiple users of register mappings

From: Robert Richter
Date: Sat Sep 02 2023 - 09:55:18 EST


On 01.09.23 10:15:27, Jonathan Cameron wrote:
> On Thu, 31 Aug 2023 10:20:18 -0500
> Terry Bowman <terry.bowman@xxxxxxx> wrote:
>
> > From: Robert Richter <rrichter@xxxxxxx>
> >
> > The function devm_cxl_iomap_block() is used to map register mappings
> > of CXL component or device registers. A @dev is used to unmap the IO
> > regions during device removal.
> >
> > Now, there are multiple devices using the register mappings. E.g. the
> > RAS cap of the Component Registers is used by cxl_pci, the HDM cap
> > used in cxl_mem. This could cause IO blocks not being freed and a
> > subsequent reinitialization to fail if the same device is used for
> > both.
> >
> > To prevent that, expand cxl_map_component_regs() to pass a @dev to be
> > used with devm to IO unmap. This allows to pass the device that
> > actually is creating and using the IO region.
> >
> > For symmetry also change the function i/f of cxl_map_device_regs().
> >
> > Signed-off-by: Robert Richter <rrichter@xxxxxxx>
> > Signed-off-by: Terry Bowman <terry.bowman@xxxxxxx>
> > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
>
> I was ambiguous in reply to previous, but my RB not valid here as it
> stands. Just replying so that doesn't get lost for v11!

Yes, sorry, I wrongly assumed it here. Will remove for v11.

Thanks,

-Robert