Re: [PATCH v3 2/2] cache: add SMCCC-backed cache invalidate provider
From: Jonathan Cameron
Date: Thu Sep 10 2026 - 15:06:25 EST
On Thu, 10 Sep 2026 08:21:42 +0000
Srirangan Madhavan <smadhavan@xxxxxxxxxx> wrote:
> Add a cache maintenance provider for the Arm SMCCC cache clean+invalidate
> interface.
>
> The provider discovers SMCCC support and attributes at init time,
> serializes firmware calls, handles transient BUSY and RATE_LIMITED
> responses with bounded retries, and registers with the generic cache
> coherency framework used by memregion callers.
>
> Signed-off-by: Srirangan Madhavan <smadhavan@xxxxxxxxxx>
> Reviewed-by: Jonathan Cameron <jic23@xxxxxxxxxx>
One tiny thing inline.
Thanks,
Jonathan
> diff --git a/drivers/cache/arm_smccc_cache.c b/drivers/cache/arm_smccc_cache.c
> new file mode 100644
> index 000000000000..1cfa8f8809d0
> --- /dev/null
> +++ b/drivers/cache/arm_smccc_cache.c
> @@ -0,0 +1,149 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2026 NVIDIA Corporation
> + *
> + * Arm SMCCC cache maintenance provider using cache clean+invalidate calls.
> + */
> +
> +#include <linux/arm-smccc.h>
> +#include <linux/cache_coherency.h>
> +#include <linux/cleanup.h>
> +#include <linux/delay.h>
> +#include <linux/errno.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
Small thing, but can we avoid including the catch all that is kernel.h.
Generally aim for more specific headers for what is actually used.
> +#include <linux/mutex.h>
> +#include <linux/nmi.h>
> +