[PATCH] ACPI: NFIT:Advertise DSM function 0xA (Query ARS error inject capabilities)

Shubhakar Gowda posted 1 patch 2 weeks, 6 days ago
drivers/acpi/nfit/core.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
[PATCH] ACPI: NFIT:Advertise DSM function 0xA (Query ARS error inject capabilities)
Posted by Shubhakar Gowda 2 weeks, 6 days ago
ACPI 6.6 defines DSM function index 0xA to Query Address Range Scrub
(ARS) error injection capabilities. This patch adds support for this
DSM function in the NFIT DSM mask so that userspace and ndctl tool can
detect platform support for Query ARS error injection capabilities features.

The patch updates NFIT initialization to include DSM 0xA, logs
supported DSMs for debugging, and uses the existing DSM infrastructure.
No kernel ABI changes are introduced.

Signed-off-by: Shubhakar Gowda <Shubhakar_gowda.P_s@dell.com>
---
 drivers/acpi/nfit/core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 5a1ced5..6cc863e 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -2113,6 +2113,8 @@ enum nfit_aux_cmds {
 	NFIT_CMD_ARS_INJECT_SET = 7,
 	NFIT_CMD_ARS_INJECT_CLEAR = 8,
 	NFIT_CMD_ARS_INJECT_GET = 9,
+	/* ACPI 6.6: DSM function 0xA — Query ARS Error Inject Capabilities */
+	NFIT_CMD_ARS_QUERY_CAP = 10,
 };
 
 static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc)
@@ -2152,10 +2154,13 @@ static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc)
 		(1 << NFIT_CMD_TRANSLATE_SPA) |
 		(1 << NFIT_CMD_ARS_INJECT_SET) |
 		(1 << NFIT_CMD_ARS_INJECT_CLEAR) |
-		(1 << NFIT_CMD_ARS_INJECT_GET);
+		(1 << NFIT_CMD_ARS_INJECT_GET)	|
+		(1 << NFIT_CMD_ARS_QUERY_CAP);
 	for_each_set_bit(i, &dsm_mask, BITS_PER_LONG)
 		if (acpi_check_dsm(adev->handle, guid, 1, 1ULL << i))
 			set_bit(i, &acpi_desc->bus_dsm_mask);
+	dev_dbg(acpi_desc->dev, "NFIT DSM mask detected: %#lx\n",
+	acpi_desc->bus_dsm_mask);
 
 	/* Enumerate allowed NVDIMM_BUS_FAMILY_INTEL commands */
 	dsm_mask = NVDIMM_BUS_INTEL_FW_ACTIVATE_CMDMASK;
-- 
2.43.0

Re: [PATCH] ACPI: NFIT:Advertise DSM function 0xA (Query ARS error inject capabilities)
Posted by dan.j.williams@intel.com 2 weeks, 2 days ago
Shubhakar Gowda wrote:
> ACPI 6.6 defines DSM function index 0xA to Query Address Range Scrub
> (ARS) error injection capabilities. This patch adds support for this
> DSM function in the NFIT DSM mask so that userspace and ndctl tool can
> detect platform support for Query ARS error injection capabilities features.
> 
> The patch updates NFIT initialization to include DSM 0xA, logs
> supported DSMs for debugging, and uses the existing DSM infrastructure.
> No kernel ABI changes are introduced.

It does introduce new ABI. This new command can now be passed from
userspace. Can you say a bit more about why this is needed and the plans
for userspace to consume this? Like proposed changes to the "ndctl
inject-error" command, and otherwise what problems occur today with the
kernel blocking this command code?
Re: [PATCH] ACPI: NFIT:Advertise DSM function 0xA (Query ARS error inject capabilities)
Posted by Shubhakar Gowda 2 weeks, 3 days ago
Hi Ira,

Yes, this is a replacement for the earlier submission.

The previous patch incorrectly referenced ACPI 6.5 in the source code
comments, while the commit message stated ACPI 6.6. This version fixes
the inconsistency by updating the code to correctly reference ACPI 6.6
and resubmitting the patch.

Apologies for the confusion caused by the earlier version.

Thanks,
Shubhakar Gowda
Re: [PATCH] ACPI: NFIT:Advertise DSM function 0xA (Query ARS error inject capabilities)
Posted by Ira Weiny 2 weeks, 4 days ago
Shubhakar Gowda wrote:
> ACPI 6.6 defines DSM function index 0xA to Query Address Range Scrub
> (ARS) error injection capabilities. This patch adds support for this
> DSM function in the NFIT DSM mask so that userspace and ndctl tool can
> detect platform support for Query ARS error injection capabilities features.
> 
> The patch updates NFIT initialization to include DSM 0xA, logs
> supported DSMs for debugging, and uses the existing DSM infrastructure.
> No kernel ABI changes are introduced.

Is this a duplicate of...

http://lore.kernel.org/20260119181824.15408-1-Shubhakar_gowda.P_s@dell.com

?

If so why?

Ira

> 
> Signed-off-by: Shubhakar Gowda <Shubhakar_gowda.P_s@dell.com>
> ---
>  drivers/acpi/nfit/core.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 5a1ced5..6cc863e 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -2113,6 +2113,8 @@ enum nfit_aux_cmds {
>  	NFIT_CMD_ARS_INJECT_SET = 7,
>  	NFIT_CMD_ARS_INJECT_CLEAR = 8,
>  	NFIT_CMD_ARS_INJECT_GET = 9,
> +	/* ACPI 6.6: DSM function 0xA — Query ARS Error Inject Capabilities */
> +	NFIT_CMD_ARS_QUERY_CAP = 10,
>  };
>  
>  static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc)
> @@ -2152,10 +2154,13 @@ static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc)
>  		(1 << NFIT_CMD_TRANSLATE_SPA) |
>  		(1 << NFIT_CMD_ARS_INJECT_SET) |
>  		(1 << NFIT_CMD_ARS_INJECT_CLEAR) |
> -		(1 << NFIT_CMD_ARS_INJECT_GET);
> +		(1 << NFIT_CMD_ARS_INJECT_GET)	|
> +		(1 << NFIT_CMD_ARS_QUERY_CAP);
>  	for_each_set_bit(i, &dsm_mask, BITS_PER_LONG)
>  		if (acpi_check_dsm(adev->handle, guid, 1, 1ULL << i))
>  			set_bit(i, &acpi_desc->bus_dsm_mask);
> +	dev_dbg(acpi_desc->dev, "NFIT DSM mask detected: %#lx\n",
> +	acpi_desc->bus_dsm_mask);
>  
>  	/* Enumerate allowed NVDIMM_BUS_FAMILY_INTEL commands */
>  	dsm_mask = NVDIMM_BUS_INTEL_FW_ACTIVATE_CMDMASK;
> -- 
> 2.43.0
>