Re: [PATCH] cxl/acpi: fix null dereference on probe for missing ACPI_COMPANION()

From: Dan Williams
Date: Thu Dec 15 2022 - 12:37:18 EST


Davidlohr Bueso wrote:
> On Wed, 14 Dec 2022, Luis Chamberlain wrote:
>
> >Groovy thanks. Progress, but still fails now on the cxl-xor-region.sh line 29
> >
> >https://gist.github.com/mcgrof/aeac639365a651bd77f143cf38eb7493
>
> Unrelated, but looking at this log I noticed that we should limit the amount
> of noise "Bypassing cpu_cache_invalidate_memregion() for testing" emits.
>
> Thanks,
> Davidlohr
>
> -----8<-------------------------------------
> [PATCH] cxl/region: Only warn about cpu_cache_invalidate_memregion() once
>
> No need for more than once per region.

Hmm, the below isn't once per region, it's once per cxl_core module
load.

>
> Signed-off-by: Davidlohr Bueso <dave@xxxxxxxxxxxx>
> ---
> drivers/cxl/core/region.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index b1281f528d7f..f367d1c10357 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -2006,8 +2006,7 @@ static int cxl_region_invalidate_memregion(struct cxl_region *cxlr)
>
> if (!cpu_cache_has_invalidate_memregion()) {
> if (IS_ENABLED(CONFIG_CXL_REGION_INVALIDATION_TEST)) {
> - dev_warn(
> - &cxlr->dev,
> + dev_WARN_ONCE(&cxlr->dev, 1,
> "Bypassing cpu_cache_invalidate_memregion() for testing!\n");

This will end up failing the unit tests because those want to have a
clean kernel log from a "Call Trace" perspective. So either
dev_warn_once() or just live with the noise since the message is more
for awareness in production environments and test environments can
ignore it.