Re: [PATCH 02/15] cxl/core: Check physical address before mapping it in devm_cxl_iomap_block()

From: Robert Richter
Date: Thu Sep 01 2022 - 01:31:36 EST


On 31.08.22 09:56:51, Jonathan Cameron wrote:
> On Wed, 31 Aug 2022 10:15:50 +0200
> Robert Richter <rrichter@xxxxxxx> wrote:
>
> > The physical base address of a CXL range can be invalid and is then
> > set to CXL_RESOURCE_NONE. Early check this case before mapping a
> > memory block in devm_cxl_iomap_block().
>
> An example of when it is invalid would be a useful addition
> to this description. Feels to me like this is papering over the cracks
> in something we should have ruled out earlier in the flow.

IIRC this happened during code development in cxl_pci_probe() when
cxl_map_regs() is called but the base addr was not determined
correctly before. It's similar to a NULL pointer check.

-Robert