* [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-05-26 16:38 ` Stuart Hayes
0 siblings, 0 replies; 15+ messages in thread
From: Stuart Hayes @ 2016-05-26 16:38 UTC (permalink / raw)
To: linux-nvdimm, dan.j.williams; +Cc: linux-acpi, rjw, linux-kernel
Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
---
drivers/acpi/nfit.c | 9 ++++++---
drivers/acpi/nfit.h | 4 ++++
include/uapi/linux/ndctl.h | 1 +
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 2215fc8..48fc575 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
}
/*
- * Until standardization materializes we need to consider up to 3
+ * Until standardization materializes we need to consider several
* different command sets. Note, that checking for function0 (bit0)
* tells us if any commands are reachable through this uuid.
*/
- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
break;
@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
dsm_mask = 0x1fe;
if (disable_vendor_specific)
dsm_mask &= ~(1 << 8);
- } else {
+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
+ dsm_mask = 0xffffffff;
+ else {
dev_err(dev, "unknown dimm command family\n");
nfit_mem->family = -1;
return force_enable_dimms ? 0 : -ENODEV;
@@ -2692,6 +2694,7 @@ static __init int nfit_init(void)
acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE1, nfit_uuid[NFIT_DEV_DIMM_N_HPE1]);
acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE2, nfit_uuid[NFIT_DEV_DIMM_N_HPE2]);
+ acpi_str_to_uuid(UUID_NFIT_DIMM_N_MSFT, nfit_uuid[NFIT_DEV_DIMM_N_MSFT]);
nfit_wq = create_singlethread_workqueue("nfit");
if (!nfit_wq)
diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
index 11cb383..f06fa91 100644
--- a/drivers/acpi/nfit.h
+++ b/drivers/acpi/nfit.h
@@ -31,6 +31,9 @@
#define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6"
#define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e"
+/* https://msdn.microsoft.com/library/windows/hardware/mt604741 */
+#define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"
+
#define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \
| ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \
| ACPI_NFIT_MEM_NOT_ARMED)
@@ -40,6 +43,7 @@ enum nfit_uuids {
NFIT_DEV_DIMM = NVDIMM_FAMILY_INTEL,
NFIT_DEV_DIMM_N_HPE1 = NVDIMM_FAMILY_HPE1,
NFIT_DEV_DIMM_N_HPE2 = NVDIMM_FAMILY_HPE2,
+ NFIT_DEV_DIMM_N_MSFT = NVDIMM_FAMILY_MSFT,
NFIT_SPA_VOLATILE,
NFIT_SPA_PM,
NFIT_SPA_DCR,
diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
index 309915f..ba5a8c7 100644
--- a/include/uapi/linux/ndctl.h
+++ b/include/uapi/linux/ndctl.h
@@ -298,6 +298,7 @@ struct nd_cmd_pkg {
#define NVDIMM_FAMILY_INTEL 0
#define NVDIMM_FAMILY_HPE1 1
#define NVDIMM_FAMILY_HPE2 2
+#define NVDIMM_FAMILY_MSFT 3
#define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
struct nd_cmd_pkg)
--
1.8.3.1
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-05-26 16:38 ` Stuart Hayes
0 siblings, 0 replies; 15+ messages in thread
From: Stuart Hayes @ 2016-05-26 16:38 UTC (permalink / raw)
To: linux-nvdimm, dan.j.williams; +Cc: ross.zwisler, rjw, linux-acpi, linux-kernel
Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
---
drivers/acpi/nfit.c | 9 ++++++---
drivers/acpi/nfit.h | 4 ++++
include/uapi/linux/ndctl.h | 1 +
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 2215fc8..48fc575 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
}
/*
- * Until standardization materializes we need to consider up to 3
+ * Until standardization materializes we need to consider several
* different command sets. Note, that checking for function0 (bit0)
* tells us if any commands are reachable through this uuid.
*/
- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
break;
@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
dsm_mask = 0x1fe;
if (disable_vendor_specific)
dsm_mask &= ~(1 << 8);
- } else {
+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
+ dsm_mask = 0xffffffff;
+ else {
dev_err(dev, "unknown dimm command family\n");
nfit_mem->family = -1;
return force_enable_dimms ? 0 : -ENODEV;
@@ -2692,6 +2694,7 @@ static __init int nfit_init(void)
acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE1, nfit_uuid[NFIT_DEV_DIMM_N_HPE1]);
acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE2, nfit_uuid[NFIT_DEV_DIMM_N_HPE2]);
+ acpi_str_to_uuid(UUID_NFIT_DIMM_N_MSFT, nfit_uuid[NFIT_DEV_DIMM_N_MSFT]);
nfit_wq = create_singlethread_workqueue("nfit");
if (!nfit_wq)
diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
index 11cb383..f06fa91 100644
--- a/drivers/acpi/nfit.h
+++ b/drivers/acpi/nfit.h
@@ -31,6 +31,9 @@
#define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6"
#define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e"
+/* https://msdn.microsoft.com/library/windows/hardware/mt604741 */
+#define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"
+
#define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \
| ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \
| ACPI_NFIT_MEM_NOT_ARMED)
@@ -40,6 +43,7 @@ enum nfit_uuids {
NFIT_DEV_DIMM = NVDIMM_FAMILY_INTEL,
NFIT_DEV_DIMM_N_HPE1 = NVDIMM_FAMILY_HPE1,
NFIT_DEV_DIMM_N_HPE2 = NVDIMM_FAMILY_HPE2,
+ NFIT_DEV_DIMM_N_MSFT = NVDIMM_FAMILY_MSFT,
NFIT_SPA_VOLATILE,
NFIT_SPA_PM,
NFIT_SPA_DCR,
diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
index 309915f..ba5a8c7 100644
--- a/include/uapi/linux/ndctl.h
+++ b/include/uapi/linux/ndctl.h
@@ -298,6 +298,7 @@ struct nd_cmd_pkg {
#define NVDIMM_FAMILY_INTEL 0
#define NVDIMM_FAMILY_HPE1 1
#define NVDIMM_FAMILY_HPE2 2
+#define NVDIMM_FAMILY_MSFT 3
#define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
struct nd_cmd_pkg)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-05-26 16:38 ` Stuart Hayes
0 siblings, 0 replies; 15+ messages in thread
From: Stuart Hayes @ 2016-05-26 16:38 UTC (permalink / raw)
To: linux-nvdimm, dan.j.williams; +Cc: ross.zwisler, rjw, linux-acpi, linux-kernel
Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
---
drivers/acpi/nfit.c | 9 ++++++---
drivers/acpi/nfit.h | 4 ++++
include/uapi/linux/ndctl.h | 1 +
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 2215fc8..48fc575 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
}
/*
- * Until standardization materializes we need to consider up to 3
+ * Until standardization materializes we need to consider several
* different command sets. Note, that checking for function0 (bit0)
* tells us if any commands are reachable through this uuid.
*/
- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
break;
@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
dsm_mask = 0x1fe;
if (disable_vendor_specific)
dsm_mask &= ~(1 << 8);
- } else {
+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
+ dsm_mask = 0xffffffff;
+ else {
dev_err(dev, "unknown dimm command family\n");
nfit_mem->family = -1;
return force_enable_dimms ? 0 : -ENODEV;
@@ -2692,6 +2694,7 @@ static __init int nfit_init(void)
acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE1, nfit_uuid[NFIT_DEV_DIMM_N_HPE1]);
acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE2, nfit_uuid[NFIT_DEV_DIMM_N_HPE2]);
+ acpi_str_to_uuid(UUID_NFIT_DIMM_N_MSFT, nfit_uuid[NFIT_DEV_DIMM_N_MSFT]);
nfit_wq = create_singlethread_workqueue("nfit");
if (!nfit_wq)
diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
index 11cb383..f06fa91 100644
--- a/drivers/acpi/nfit.h
+++ b/drivers/acpi/nfit.h
@@ -31,6 +31,9 @@
#define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6"
#define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e"
+/* https://msdn.microsoft.com/library/windows/hardware/mt604741 */
+#define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"
+
#define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \
| ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \
| ACPI_NFIT_MEM_NOT_ARMED)
@@ -40,6 +43,7 @@ enum nfit_uuids {
NFIT_DEV_DIMM = NVDIMM_FAMILY_INTEL,
NFIT_DEV_DIMM_N_HPE1 = NVDIMM_FAMILY_HPE1,
NFIT_DEV_DIMM_N_HPE2 = NVDIMM_FAMILY_HPE2,
+ NFIT_DEV_DIMM_N_MSFT = NVDIMM_FAMILY_MSFT,
NFIT_SPA_VOLATILE,
NFIT_SPA_PM,
NFIT_SPA_DCR,
diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
index 309915f..ba5a8c7 100644
--- a/include/uapi/linux/ndctl.h
+++ b/include/uapi/linux/ndctl.h
@@ -298,6 +298,7 @@ struct nd_cmd_pkg {
#define NVDIMM_FAMILY_INTEL 0
#define NVDIMM_FAMILY_HPE1 1
#define NVDIMM_FAMILY_HPE2 2
+#define NVDIMM_FAMILY_MSFT 3
#define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
struct nd_cmd_pkg)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
2016-05-26 16:38 ` Stuart Hayes
(?)
@ 2016-06-08 21:47 ` Stuart Hayes
-1 siblings, 0 replies; 15+ messages in thread
From: Stuart Hayes @ 2016-06-08 21:47 UTC (permalink / raw)
To: linux-nvdimm, dan.j.williams; +Cc: linux-acpi, rjw, linux-kernel
On 5/26/2016 11:38 AM, Stuart Hayes wrote:
> Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
>
> This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
>
> Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
> ---
> drivers/acpi/nfit.c | 9 ++++++---
> drivers/acpi/nfit.h | 4 ++++
> include/uapi/linux/ndctl.h | 1 +
> 3 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index 2215fc8..48fc575 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
> @@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> }
>
> /*
> - * Until standardization materializes we need to consider up to 3
> + * Until standardization materializes we need to consider several
> * different command sets. Note, that checking for function0 (bit0)
> * tells us if any commands are reachable through this uuid.
> */
> - for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
> + for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
> if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
> break;
>
> @@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> dsm_mask = 0x1fe;
> if (disable_vendor_specific)
> dsm_mask &= ~(1 << 8);
> - } else {
> + } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
> + dsm_mask = 0xffffffff;
> + else {
> dev_err(dev, "unknown dimm command family\n");
> nfit_mem->family = -1;
> return force_enable_dimms ? 0 : -ENODEV;
> @@ -2692,6 +2694,7 @@ static __init int nfit_init(void)
> acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE1, nfit_uuid[NFIT_DEV_DIMM_N_HPE1]);
> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE2, nfit_uuid[NFIT_DEV_DIMM_N_HPE2]);
> + acpi_str_to_uuid(UUID_NFIT_DIMM_N_MSFT, nfit_uuid[NFIT_DEV_DIMM_N_MSFT]);
>
> nfit_wq = create_singlethread_workqueue("nfit");
> if (!nfit_wq)
> diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
> index 11cb383..f06fa91 100644
> --- a/drivers/acpi/nfit.h
> +++ b/drivers/acpi/nfit.h
> @@ -31,6 +31,9 @@
> #define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6"
> #define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e"
>
> +/* https://msdn.microsoft.com/library/windows/hardware/mt604741 */
> +#define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"
> +
> #define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \
> | ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \
> | ACPI_NFIT_MEM_NOT_ARMED)
> @@ -40,6 +43,7 @@ enum nfit_uuids {
> NFIT_DEV_DIMM = NVDIMM_FAMILY_INTEL,
> NFIT_DEV_DIMM_N_HPE1 = NVDIMM_FAMILY_HPE1,
> NFIT_DEV_DIMM_N_HPE2 = NVDIMM_FAMILY_HPE2,
> + NFIT_DEV_DIMM_N_MSFT = NVDIMM_FAMILY_MSFT,
> NFIT_SPA_VOLATILE,
> NFIT_SPA_PM,
> NFIT_SPA_DCR,
> diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
> index 309915f..ba5a8c7 100644
> --- a/include/uapi/linux/ndctl.h
> +++ b/include/uapi/linux/ndctl.h
> @@ -298,6 +298,7 @@ struct nd_cmd_pkg {
> #define NVDIMM_FAMILY_INTEL 0
> #define NVDIMM_FAMILY_HPE1 1
> #define NVDIMM_FAMILY_HPE2 2
> +#define NVDIMM_FAMILY_MSFT 3
>
> #define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
> struct nd_cmd_pkg)
Is there a problem with this patch? I never saw any responses, and wasn't sure if maybe I goofed. Thanks!
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-06-08 21:47 ` Stuart Hayes
0 siblings, 0 replies; 15+ messages in thread
From: Stuart Hayes @ 2016-06-08 21:47 UTC (permalink / raw)
To: linux-nvdimm, dan.j.williams; +Cc: ross.zwisler, rjw, linux-acpi, linux-kernel
On 5/26/2016 11:38 AM, Stuart Hayes wrote:
> Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
>
> This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
>
> Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
> ---
> drivers/acpi/nfit.c | 9 ++++++---
> drivers/acpi/nfit.h | 4 ++++
> include/uapi/linux/ndctl.h | 1 +
> 3 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index 2215fc8..48fc575 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
> @@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> }
>
> /*
> - * Until standardization materializes we need to consider up to 3
> + * Until standardization materializes we need to consider several
> * different command sets. Note, that checking for function0 (bit0)
> * tells us if any commands are reachable through this uuid.
> */
> - for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
> + for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
> if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
> break;
>
> @@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> dsm_mask = 0x1fe;
> if (disable_vendor_specific)
> dsm_mask &= ~(1 << 8);
> - } else {
> + } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
> + dsm_mask = 0xffffffff;
> + else {
> dev_err(dev, "unknown dimm command family\n");
> nfit_mem->family = -1;
> return force_enable_dimms ? 0 : -ENODEV;
> @@ -2692,6 +2694,7 @@ static __init int nfit_init(void)
> acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE1, nfit_uuid[NFIT_DEV_DIMM_N_HPE1]);
> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE2, nfit_uuid[NFIT_DEV_DIMM_N_HPE2]);
> + acpi_str_to_uuid(UUID_NFIT_DIMM_N_MSFT, nfit_uuid[NFIT_DEV_DIMM_N_MSFT]);
>
> nfit_wq = create_singlethread_workqueue("nfit");
> if (!nfit_wq)
> diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
> index 11cb383..f06fa91 100644
> --- a/drivers/acpi/nfit.h
> +++ b/drivers/acpi/nfit.h
> @@ -31,6 +31,9 @@
> #define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6"
> #define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e"
>
> +/* https://msdn.microsoft.com/library/windows/hardware/mt604741 */
> +#define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"
> +
> #define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \
> | ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \
> | ACPI_NFIT_MEM_NOT_ARMED)
> @@ -40,6 +43,7 @@ enum nfit_uuids {
> NFIT_DEV_DIMM = NVDIMM_FAMILY_INTEL,
> NFIT_DEV_DIMM_N_HPE1 = NVDIMM_FAMILY_HPE1,
> NFIT_DEV_DIMM_N_HPE2 = NVDIMM_FAMILY_HPE2,
> + NFIT_DEV_DIMM_N_MSFT = NVDIMM_FAMILY_MSFT,
> NFIT_SPA_VOLATILE,
> NFIT_SPA_PM,
> NFIT_SPA_DCR,
> diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
> index 309915f..ba5a8c7 100644
> --- a/include/uapi/linux/ndctl.h
> +++ b/include/uapi/linux/ndctl.h
> @@ -298,6 +298,7 @@ struct nd_cmd_pkg {
> #define NVDIMM_FAMILY_INTEL 0
> #define NVDIMM_FAMILY_HPE1 1
> #define NVDIMM_FAMILY_HPE2 2
> +#define NVDIMM_FAMILY_MSFT 3
>
> #define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
> struct nd_cmd_pkg)
Is there a problem with this patch? I never saw any responses, and wasn't sure if maybe I goofed. Thanks!
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-06-08 21:47 ` Stuart Hayes
0 siblings, 0 replies; 15+ messages in thread
From: Stuart Hayes @ 2016-06-08 21:47 UTC (permalink / raw)
To: linux-nvdimm, dan.j.williams; +Cc: ross.zwisler, rjw, linux-acpi, linux-kernel
On 5/26/2016 11:38 AM, Stuart Hayes wrote:
> Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
>
> This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
>
> Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
> ---
> drivers/acpi/nfit.c | 9 ++++++---
> drivers/acpi/nfit.h | 4 ++++
> include/uapi/linux/ndctl.h | 1 +
> 3 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index 2215fc8..48fc575 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
> @@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> }
>
> /*
> - * Until standardization materializes we need to consider up to 3
> + * Until standardization materializes we need to consider several
> * different command sets. Note, that checking for function0 (bit0)
> * tells us if any commands are reachable through this uuid.
> */
> - for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
> + for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
> if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
> break;
>
> @@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> dsm_mask = 0x1fe;
> if (disable_vendor_specific)
> dsm_mask &= ~(1 << 8);
> - } else {
> + } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
> + dsm_mask = 0xffffffff;
> + else {
> dev_err(dev, "unknown dimm command family\n");
> nfit_mem->family = -1;
> return force_enable_dimms ? 0 : -ENODEV;
> @@ -2692,6 +2694,7 @@ static __init int nfit_init(void)
> acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE1, nfit_uuid[NFIT_DEV_DIMM_N_HPE1]);
> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE2, nfit_uuid[NFIT_DEV_DIMM_N_HPE2]);
> + acpi_str_to_uuid(UUID_NFIT_DIMM_N_MSFT, nfit_uuid[NFIT_DEV_DIMM_N_MSFT]);
>
> nfit_wq = create_singlethread_workqueue("nfit");
> if (!nfit_wq)
> diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
> index 11cb383..f06fa91 100644
> --- a/drivers/acpi/nfit.h
> +++ b/drivers/acpi/nfit.h
> @@ -31,6 +31,9 @@
> #define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6"
> #define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e"
>
> +/* https://msdn.microsoft.com/library/windows/hardware/mt604741 */
> +#define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"
> +
> #define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \
> | ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \
> | ACPI_NFIT_MEM_NOT_ARMED)
> @@ -40,6 +43,7 @@ enum nfit_uuids {
> NFIT_DEV_DIMM = NVDIMM_FAMILY_INTEL,
> NFIT_DEV_DIMM_N_HPE1 = NVDIMM_FAMILY_HPE1,
> NFIT_DEV_DIMM_N_HPE2 = NVDIMM_FAMILY_HPE2,
> + NFIT_DEV_DIMM_N_MSFT = NVDIMM_FAMILY_MSFT,
> NFIT_SPA_VOLATILE,
> NFIT_SPA_PM,
> NFIT_SPA_DCR,
> diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
> index 309915f..ba5a8c7 100644
> --- a/include/uapi/linux/ndctl.h
> +++ b/include/uapi/linux/ndctl.h
> @@ -298,6 +298,7 @@ struct nd_cmd_pkg {
> #define NVDIMM_FAMILY_INTEL 0
> #define NVDIMM_FAMILY_HPE1 1
> #define NVDIMM_FAMILY_HPE2 2
> +#define NVDIMM_FAMILY_MSFT 3
>
> #define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
> struct nd_cmd_pkg)
Is there a problem with this patch? I never saw any responses, and wasn't sure if maybe I goofed. Thanks!
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
2016-06-08 21:47 ` Stuart Hayes
(?)
@ 2016-06-08 23:13 ` Dan Williams
-1 siblings, 0 replies; 15+ messages in thread
From: Dan Williams @ 2016-06-08 23:13 UTC (permalink / raw)
To: Stuart Hayes; +Cc: Linux ACPI, Rafael J. Wysocki, linux-kernel, linux-nvdimm
On Wed, Jun 8, 2016 at 2:47 PM, Stuart Hayes <stuart.w.hayes@gmail.com> wrote:
>
>
> On 5/26/2016 11:38 AM, Stuart Hayes wrote:
>>
>> Add the Microsoft _DSM command set to the white list of NVDIMM command
>> sets.
>>
>> This command set is documented at
>> https://msdn.microsoft.com/library/windows/hardware/mt604741.
>>
>> Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
>> ---
>> drivers/acpi/nfit.c | 9 ++++++---
>> drivers/acpi/nfit.h | 4 ++++
>> include/uapi/linux/ndctl.h | 1 +
>> 3 files changed, 11 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
>> index 2215fc8..48fc575 100644
>> --- a/drivers/acpi/nfit.c
>> +++ b/drivers/acpi/nfit.c
>> @@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct
>> acpi_nfit_desc *acpi_desc,
>> }
>>
>> /*
>> - * Until standardization materializes we need to consider up to 3
>> + * Until standardization materializes we need to consider several
>> * different command sets. Note, that checking for function0 (bit0)
>> * tells us if any commands are reachable through this uuid.
>> */
>> - for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
>> + for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
>> if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
>> break;
>>
>> @@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc
>> *acpi_desc,
>> dsm_mask = 0x1fe;
>> if (disable_vendor_specific)
>> dsm_mask &= ~(1 << 8);
>> - } else {
>> + } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
>> + dsm_mask = 0xffffffff;
>> + else {
>> dev_err(dev, "unknown dimm command family\n");
>> nfit_mem->family = -1;
>> return force_enable_dimms ? 0 : -ENODEV;
>> @@ -2692,6 +2694,7 @@ static __init int nfit_init(void)
>> acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
>> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE1,
>> nfit_uuid[NFIT_DEV_DIMM_N_HPE1]);
>> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE2,
>> nfit_uuid[NFIT_DEV_DIMM_N_HPE2]);
>> + acpi_str_to_uuid(UUID_NFIT_DIMM_N_MSFT,
>> nfit_uuid[NFIT_DEV_DIMM_N_MSFT]);
>>
>> nfit_wq = create_singlethread_workqueue("nfit");
>> if (!nfit_wq)
>> diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
>> index 11cb383..f06fa91 100644
>> --- a/drivers/acpi/nfit.h
>> +++ b/drivers/acpi/nfit.h
>> @@ -31,6 +31,9 @@
>> #define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6"
>> #define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e"
>>
>> +/* https://msdn.microsoft.com/library/windows/hardware/mt604741 */
>> +#define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"
>> +
>> #define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \
>> | ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \
>> | ACPI_NFIT_MEM_NOT_ARMED)
>> @@ -40,6 +43,7 @@ enum nfit_uuids {
>> NFIT_DEV_DIMM = NVDIMM_FAMILY_INTEL,
>> NFIT_DEV_DIMM_N_HPE1 = NVDIMM_FAMILY_HPE1,
>> NFIT_DEV_DIMM_N_HPE2 = NVDIMM_FAMILY_HPE2,
>> + NFIT_DEV_DIMM_N_MSFT = NVDIMM_FAMILY_MSFT,
>> NFIT_SPA_VOLATILE,
>> NFIT_SPA_PM,
>> NFIT_SPA_DCR,
>> diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
>> index 309915f..ba5a8c7 100644
>> --- a/include/uapi/linux/ndctl.h
>> +++ b/include/uapi/linux/ndctl.h
>> @@ -298,6 +298,7 @@ struct nd_cmd_pkg {
>> #define NVDIMM_FAMILY_INTEL 0
>> #define NVDIMM_FAMILY_HPE1 1
>> #define NVDIMM_FAMILY_HPE2 2
>> +#define NVDIMM_FAMILY_MSFT 3
>>
>> #define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
>> struct nd_cmd_pkg)
>
>
> Is there a problem with this patch? I never saw any responses, and wasn't
> sure if maybe I goofed. Thanks!
Nope, looks ok. I'll put it through unit testing and get it applied.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-06-08 23:13 ` Dan Williams
0 siblings, 0 replies; 15+ messages in thread
From: Dan Williams @ 2016-06-08 23:13 UTC (permalink / raw)
To: Stuart Hayes
Cc: linux-nvdimm, Ross Zwisler, Rafael J. Wysocki, Linux ACPI, linux-kernel
On Wed, Jun 8, 2016 at 2:47 PM, Stuart Hayes <stuart.w.hayes@gmail.com> wrote:
>
>
> On 5/26/2016 11:38 AM, Stuart Hayes wrote:
>>
>> Add the Microsoft _DSM command set to the white list of NVDIMM command
>> sets.
>>
>> This command set is documented at
>> https://msdn.microsoft.com/library/windows/hardware/mt604741.
>>
>> Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
>> ---
>> drivers/acpi/nfit.c | 9 ++++++---
>> drivers/acpi/nfit.h | 4 ++++
>> include/uapi/linux/ndctl.h | 1 +
>> 3 files changed, 11 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
>> index 2215fc8..48fc575 100644
>> --- a/drivers/acpi/nfit.c
>> +++ b/drivers/acpi/nfit.c
>> @@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct
>> acpi_nfit_desc *acpi_desc,
>> }
>>
>> /*
>> - * Until standardization materializes we need to consider up to 3
>> + * Until standardization materializes we need to consider several
>> * different command sets. Note, that checking for function0 (bit0)
>> * tells us if any commands are reachable through this uuid.
>> */
>> - for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
>> + for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
>> if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
>> break;
>>
>> @@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc
>> *acpi_desc,
>> dsm_mask = 0x1fe;
>> if (disable_vendor_specific)
>> dsm_mask &= ~(1 << 8);
>> - } else {
>> + } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
>> + dsm_mask = 0xffffffff;
>> + else {
>> dev_err(dev, "unknown dimm command family\n");
>> nfit_mem->family = -1;
>> return force_enable_dimms ? 0 : -ENODEV;
>> @@ -2692,6 +2694,7 @@ static __init int nfit_init(void)
>> acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
>> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE1,
>> nfit_uuid[NFIT_DEV_DIMM_N_HPE1]);
>> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE2,
>> nfit_uuid[NFIT_DEV_DIMM_N_HPE2]);
>> + acpi_str_to_uuid(UUID_NFIT_DIMM_N_MSFT,
>> nfit_uuid[NFIT_DEV_DIMM_N_MSFT]);
>>
>> nfit_wq = create_singlethread_workqueue("nfit");
>> if (!nfit_wq)
>> diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
>> index 11cb383..f06fa91 100644
>> --- a/drivers/acpi/nfit.h
>> +++ b/drivers/acpi/nfit.h
>> @@ -31,6 +31,9 @@
>> #define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6"
>> #define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e"
>>
>> +/* https://msdn.microsoft.com/library/windows/hardware/mt604741 */
>> +#define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"
>> +
>> #define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \
>> | ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \
>> | ACPI_NFIT_MEM_NOT_ARMED)
>> @@ -40,6 +43,7 @@ enum nfit_uuids {
>> NFIT_DEV_DIMM = NVDIMM_FAMILY_INTEL,
>> NFIT_DEV_DIMM_N_HPE1 = NVDIMM_FAMILY_HPE1,
>> NFIT_DEV_DIMM_N_HPE2 = NVDIMM_FAMILY_HPE2,
>> + NFIT_DEV_DIMM_N_MSFT = NVDIMM_FAMILY_MSFT,
>> NFIT_SPA_VOLATILE,
>> NFIT_SPA_PM,
>> NFIT_SPA_DCR,
>> diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
>> index 309915f..ba5a8c7 100644
>> --- a/include/uapi/linux/ndctl.h
>> +++ b/include/uapi/linux/ndctl.h
>> @@ -298,6 +298,7 @@ struct nd_cmd_pkg {
>> #define NVDIMM_FAMILY_INTEL 0
>> #define NVDIMM_FAMILY_HPE1 1
>> #define NVDIMM_FAMILY_HPE2 2
>> +#define NVDIMM_FAMILY_MSFT 3
>>
>> #define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
>> struct nd_cmd_pkg)
>
>
> Is there a problem with this patch? I never saw any responses, and wasn't
> sure if maybe I goofed. Thanks!
Nope, looks ok. I'll put it through unit testing and get it applied.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-06-08 23:13 ` Dan Williams
0 siblings, 0 replies; 15+ messages in thread
From: Dan Williams @ 2016-06-08 23:13 UTC (permalink / raw)
To: Stuart Hayes
Cc: linux-nvdimm@lists.01.org, Ross Zwisler, Rafael J. Wysocki,
Linux ACPI, linux-kernel
On Wed, Jun 8, 2016 at 2:47 PM, Stuart Hayes <stuart.w.hayes@gmail.com> wrote:
>
>
> On 5/26/2016 11:38 AM, Stuart Hayes wrote:
>>
>> Add the Microsoft _DSM command set to the white list of NVDIMM command
>> sets.
>>
>> This command set is documented at
>> https://msdn.microsoft.com/library/windows/hardware/mt604741.
>>
>> Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
>> ---
>> drivers/acpi/nfit.c | 9 ++++++---
>> drivers/acpi/nfit.h | 4 ++++
>> include/uapi/linux/ndctl.h | 1 +
>> 3 files changed, 11 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
>> index 2215fc8..48fc575 100644
>> --- a/drivers/acpi/nfit.c
>> +++ b/drivers/acpi/nfit.c
>> @@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct
>> acpi_nfit_desc *acpi_desc,
>> }
>>
>> /*
>> - * Until standardization materializes we need to consider up to 3
>> + * Until standardization materializes we need to consider several
>> * different command sets. Note, that checking for function0 (bit0)
>> * tells us if any commands are reachable through this uuid.
>> */
>> - for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
>> + for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
>> if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
>> break;
>>
>> @@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc
>> *acpi_desc,
>> dsm_mask = 0x1fe;
>> if (disable_vendor_specific)
>> dsm_mask &= ~(1 << 8);
>> - } else {
>> + } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
>> + dsm_mask = 0xffffffff;
>> + else {
>> dev_err(dev, "unknown dimm command family\n");
>> nfit_mem->family = -1;
>> return force_enable_dimms ? 0 : -ENODEV;
>> @@ -2692,6 +2694,7 @@ static __init int nfit_init(void)
>> acpi_str_to_uuid(UUID_NFIT_DIMM, nfit_uuid[NFIT_DEV_DIMM]);
>> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE1,
>> nfit_uuid[NFIT_DEV_DIMM_N_HPE1]);
>> acpi_str_to_uuid(UUID_NFIT_DIMM_N_HPE2,
>> nfit_uuid[NFIT_DEV_DIMM_N_HPE2]);
>> + acpi_str_to_uuid(UUID_NFIT_DIMM_N_MSFT,
>> nfit_uuid[NFIT_DEV_DIMM_N_MSFT]);
>>
>> nfit_wq = create_singlethread_workqueue("nfit");
>> if (!nfit_wq)
>> diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
>> index 11cb383..f06fa91 100644
>> --- a/drivers/acpi/nfit.h
>> +++ b/drivers/acpi/nfit.h
>> @@ -31,6 +31,9 @@
>> #define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6"
>> #define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e"
>>
>> +/* https://msdn.microsoft.com/library/windows/hardware/mt604741 */
>> +#define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"
>> +
>> #define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \
>> | ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \
>> | ACPI_NFIT_MEM_NOT_ARMED)
>> @@ -40,6 +43,7 @@ enum nfit_uuids {
>> NFIT_DEV_DIMM = NVDIMM_FAMILY_INTEL,
>> NFIT_DEV_DIMM_N_HPE1 = NVDIMM_FAMILY_HPE1,
>> NFIT_DEV_DIMM_N_HPE2 = NVDIMM_FAMILY_HPE2,
>> + NFIT_DEV_DIMM_N_MSFT = NVDIMM_FAMILY_MSFT,
>> NFIT_SPA_VOLATILE,
>> NFIT_SPA_PM,
>> NFIT_SPA_DCR,
>> diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
>> index 309915f..ba5a8c7 100644
>> --- a/include/uapi/linux/ndctl.h
>> +++ b/include/uapi/linux/ndctl.h
>> @@ -298,6 +298,7 @@ struct nd_cmd_pkg {
>> #define NVDIMM_FAMILY_INTEL 0
>> #define NVDIMM_FAMILY_HPE1 1
>> #define NVDIMM_FAMILY_HPE2 2
>> +#define NVDIMM_FAMILY_MSFT 3
>>
>> #define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
>> struct nd_cmd_pkg)
>
>
> Is there a problem with this patch? I never saw any responses, and wasn't
> sure if maybe I goofed. Thanks!
Nope, looks ok. I'll put it through unit testing and get it applied.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-06-19 17:59 ` Pavel Machek
0 siblings, 0 replies; 15+ messages in thread
From: Pavel Machek @ 2016-06-19 17:59 UTC (permalink / raw)
To: Stuart Hayes; +Cc: linux-nvdimm, rjw, linux-kernel, linux-acpi
Hi!
> >Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
> >
> >This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
> >
> >Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
> >---
> > drivers/acpi/nfit.c | 9 ++++++---
> > drivers/acpi/nfit.h | 4 ++++
> > include/uapi/linux/ndctl.h | 1 +
> > 3 files changed, 11 insertions(+), 3 deletions(-)
> >
> >diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> >index 2215fc8..48fc575 100644
> >--- a/drivers/acpi/nfit.c
> >+++ b/drivers/acpi/nfit.c
> >@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> > }
> >
> > /*
> >- * Until standardization materializes we need to consider up to 3
> >+ * Until standardization materializes we need to consider several
> > * different command sets. Note, that checking for function0 (bit0)
> > * tells us if any commands are reachable through this uuid.
> > */
> >- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
> >+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
> > if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
Time to introduce NVDIMM_FAMILY_MAX?
> >@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> > dsm_mask = 0x1fe;
> > if (disable_vendor_specific)
> > dsm_mask &= ~(1 << 8);
> >- } else {
> >+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
> >+ dsm_mask = 0xffffffff;
> >+ else {
> > dev_err(dev, "unknown dimm command family\n");
> > nfit_mem->family = -1;
> > return force_enable_dimms ? 0 : -ENODEV;
I'd really use {} around the if (), so that it is clear what the else belongs to.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-06-19 17:59 ` Pavel Machek
0 siblings, 0 replies; 15+ messages in thread
From: Pavel Machek @ 2016-06-19 17:59 UTC (permalink / raw)
To: Stuart Hayes
Cc: linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw, rjw-LthD3rsA81gm4RdzfppkhA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-acpi-u79uwXL29TY76Z2rM5mHXA
Hi!
> >Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
> >
> >This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
> >
> >Signed-off-by: Stuart Hayes <stuart.w.hayes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >---
> > drivers/acpi/nfit.c | 9 ++++++---
> > drivers/acpi/nfit.h | 4 ++++
> > include/uapi/linux/ndctl.h | 1 +
> > 3 files changed, 11 insertions(+), 3 deletions(-)
> >
> >diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> >index 2215fc8..48fc575 100644
> >--- a/drivers/acpi/nfit.c
> >+++ b/drivers/acpi/nfit.c
> >@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> > }
> >
> > /*
> >- * Until standardization materializes we need to consider up to 3
> >+ * Until standardization materializes we need to consider several
> > * different command sets. Note, that checking for function0 (bit0)
> > * tells us if any commands are reachable through this uuid.
> > */
> >- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
> >+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
> > if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
Time to introduce NVDIMM_FAMILY_MAX?
> >@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> > dsm_mask = 0x1fe;
> > if (disable_vendor_specific)
> > dsm_mask &= ~(1 << 8);
> >- } else {
> >+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
> >+ dsm_mask = 0xffffffff;
> >+ else {
> > dev_err(dev, "unknown dimm command family\n");
> > nfit_mem->family = -1;
> > return force_enable_dimms ? 0 : -ENODEV;
I'd really use {} around the if (), so that it is clear what the else belongs to.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-06-19 17:59 ` Pavel Machek
0 siblings, 0 replies; 15+ messages in thread
From: Pavel Machek @ 2016-06-19 17:59 UTC (permalink / raw)
To: Stuart Hayes
Cc: linux-nvdimm, dan.j.williams, ross.zwisler, rjw, linux-acpi,
linux-kernel
Hi!
> >Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
> >
> >This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
> >
> >Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
> >---
> > drivers/acpi/nfit.c | 9 ++++++---
> > drivers/acpi/nfit.h | 4 ++++
> > include/uapi/linux/ndctl.h | 1 +
> > 3 files changed, 11 insertions(+), 3 deletions(-)
> >
> >diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> >index 2215fc8..48fc575 100644
> >--- a/drivers/acpi/nfit.c
> >+++ b/drivers/acpi/nfit.c
> >@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> > }
> >
> > /*
> >- * Until standardization materializes we need to consider up to 3
> >+ * Until standardization materializes we need to consider several
> > * different command sets. Note, that checking for function0 (bit0)
> > * tells us if any commands are reachable through this uuid.
> > */
> >- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
> >+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
> > if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
Time to introduce NVDIMM_FAMILY_MAX?
> >@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
> > dsm_mask = 0x1fe;
> > if (disable_vendor_specific)
> > dsm_mask &= ~(1 << 8);
> >- } else {
> >+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
> >+ dsm_mask = 0xffffffff;
> >+ else {
> > dev_err(dev, "unknown dimm command family\n");
> > nfit_mem->family = -1;
> > return force_enable_dimms ? 0 : -ENODEV;
I'd really use {} around the if (), so that it is clear what the else belongs to.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-06-20 17:21 ` Dan Williams
0 siblings, 0 replies; 15+ messages in thread
From: Dan Williams @ 2016-06-20 17:21 UTC (permalink / raw)
To: Pavel Machek
Cc: linux-nvdimm, Rafael J. Wysocki, linux-kernel, Linux ACPI, Stuart Hayes
On Sun, Jun 19, 2016 at 10:59 AM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>> >Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
>> >
>> >This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
>> >
>> >Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
>> >---
>> > drivers/acpi/nfit.c | 9 ++++++---
>> > drivers/acpi/nfit.h | 4 ++++
>> > include/uapi/linux/ndctl.h | 1 +
>> > 3 files changed, 11 insertions(+), 3 deletions(-)
>> >
>> >diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
>> >index 2215fc8..48fc575 100644
>> >--- a/drivers/acpi/nfit.c
>> >+++ b/drivers/acpi/nfit.c
>> >@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>> > }
>> >
>> > /*
>> >- * Until standardization materializes we need to consider up to 3
>> >+ * Until standardization materializes we need to consider several
>> > * different command sets. Note, that checking for function0 (bit0)
>> > * tells us if any commands are reachable through this uuid.
>> > */
>> >- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
>> >+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
>> > if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
>
> Time to introduce NVDIMM_FAMILY_MAX?
I hope not. This is the last of what can be considered "first
generation" DSM support, everything else should wait for
standardization. I.e. no ongoing need to keep changing this line.
>
>> >@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>> > dsm_mask = 0x1fe;
>> > if (disable_vendor_specific)
>> > dsm_mask &= ~(1 << 8);
>> >- } else {
>> >+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
>> >+ dsm_mask = 0xffffffff;
>> >+ else {
>> > dev_err(dev, "unknown dimm command family\n");
>> > nfit_mem->family = -1;
>> > return force_enable_dimms ? 0 : -ENODEV;
>
> I'd really use {} around the if (), so that it is clear what the else belongs to.
Sure, I can fix this up. Stuart, no need to re-send.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-06-20 17:21 ` Dan Williams
0 siblings, 0 replies; 15+ messages in thread
From: Dan Williams @ 2016-06-20 17:21 UTC (permalink / raw)
To: Pavel Machek
Cc: linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw, Rafael J. Wysocki,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Linux ACPI, Stuart Hayes
On Sun, Jun 19, 2016 at 10:59 AM, Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org> wrote:
> Hi!
>
>> >Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
>> >
>> >This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
>> >
>> >Signed-off-by: Stuart Hayes <stuart.w.hayes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> >---
>> > drivers/acpi/nfit.c | 9 ++++++---
>> > drivers/acpi/nfit.h | 4 ++++
>> > include/uapi/linux/ndctl.h | 1 +
>> > 3 files changed, 11 insertions(+), 3 deletions(-)
>> >
>> >diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
>> >index 2215fc8..48fc575 100644
>> >--- a/drivers/acpi/nfit.c
>> >+++ b/drivers/acpi/nfit.c
>> >@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>> > }
>> >
>> > /*
>> >- * Until standardization materializes we need to consider up to 3
>> >+ * Until standardization materializes we need to consider several
>> > * different command sets. Note, that checking for function0 (bit0)
>> > * tells us if any commands are reachable through this uuid.
>> > */
>> >- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
>> >+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
>> > if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
>
> Time to introduce NVDIMM_FAMILY_MAX?
I hope not. This is the last of what can be considered "first
generation" DSM support, everything else should wait for
standardization. I.e. no ongoing need to keep changing this line.
>
>> >@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>> > dsm_mask = 0x1fe;
>> > if (disable_vendor_specific)
>> > dsm_mask &= ~(1 << 8);
>> >- } else {
>> >+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
>> >+ dsm_mask = 0xffffffff;
>> >+ else {
>> > dev_err(dev, "unknown dimm command family\n");
>> > nfit_mem->family = -1;
>> > return force_enable_dimms ? 0 : -ENODEV;
>
> I'd really use {} around the if (), so that it is clear what the else belongs to.
Sure, I can fix this up. Stuart, no need to re-send.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list
@ 2016-06-20 17:21 ` Dan Williams
0 siblings, 0 replies; 15+ messages in thread
From: Dan Williams @ 2016-06-20 17:21 UTC (permalink / raw)
To: Pavel Machek
Cc: Stuart Hayes, linux-nvdimm@lists.01.org, Ross Zwisler,
Rafael J. Wysocki, Linux ACPI, linux-kernel
On Sun, Jun 19, 2016 at 10:59 AM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>> >Add the Microsoft _DSM command set to the white list of NVDIMM command sets.
>> >
>> >This command set is documented at https://msdn.microsoft.com/library/windows/hardware/mt604741.
>> >
>> >Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
>> >---
>> > drivers/acpi/nfit.c | 9 ++++++---
>> > drivers/acpi/nfit.h | 4 ++++
>> > include/uapi/linux/ndctl.h | 1 +
>> > 3 files changed, 11 insertions(+), 3 deletions(-)
>> >
>> >diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
>> >index 2215fc8..48fc575 100644
>> >--- a/drivers/acpi/nfit.c
>> >+++ b/drivers/acpi/nfit.c
>> >@@ -1130,11 +1130,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>> > }
>> >
>> > /*
>> >- * Until standardization materializes we need to consider up to 3
>> >+ * Until standardization materializes we need to consider several
>> > * different command sets. Note, that checking for function0 (bit0)
>> > * tells us if any commands are reachable through this uuid.
>> > */
>> >- for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++)
>> >+ for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++)
>> > if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))
>
> Time to introduce NVDIMM_FAMILY_MAX?
I hope not. This is the last of what can be considered "first
generation" DSM support, everything else should wait for
standardization. I.e. no ongoing need to keep changing this line.
>
>> >@@ -1150,7 +1150,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
>> > dsm_mask = 0x1fe;
>> > if (disable_vendor_specific)
>> > dsm_mask &= ~(1 << 8);
>> >- } else {
>> >+ } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT)
>> >+ dsm_mask = 0xffffffff;
>> >+ else {
>> > dev_err(dev, "unknown dimm command family\n");
>> > nfit_mem->family = -1;
>> > return force_enable_dimms ? 0 : -ENODEV;
>
> I'd really use {} around the if (), so that it is clear what the else belongs to.
Sure, I can fix this up. Stuart, no need to re-send.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2016-06-20 17:22 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-26 16:38 [PATCH] nfit: add Microsoft NVDIMM DSM command set to white list Stuart Hayes
2016-05-26 16:38 ` Stuart Hayes
2016-05-26 16:38 ` Stuart Hayes
2016-06-08 21:47 ` Stuart Hayes
2016-06-08 21:47 ` Stuart Hayes
2016-06-08 21:47 ` Stuart Hayes
2016-06-08 23:13 ` Dan Williams
2016-06-08 23:13 ` Dan Williams
2016-06-08 23:13 ` Dan Williams
2016-06-19 17:59 ` Pavel Machek
2016-06-19 17:59 ` Pavel Machek
2016-06-19 17:59 ` Pavel Machek
2016-06-20 17:21 ` Dan Williams
2016-06-20 17:21 ` Dan Williams
2016-06-20 17:21 ` Dan Williams
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.