Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1386931 > unrolled thread

[PATCH v3 0/2] Support ACPI 6.1 update in NFIT Control Region Structure

Started byToshi Kani <toshi.kani@hpe.com>
First post2016-04-25 23:50 +0200
Last post2016-04-27 02:00 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 0/2] Support ACPI 6.1 update in NFIT Control Region Structure Toshi Kani <toshi.kani@hpe.com> - 2016-04-25 23:50 +0200
    [PATCH v3 2/2] acpi/nfit: Add sysfs "id" for NVDIMM ID Toshi Kani <toshi.kani@hpe.com> - 2016-04-25 23:50 +0200
    [PATCH v3 1/2] acpi/nfit: Update nfit driver to comply with ACPI 6.1 Toshi Kani <toshi.kani@hpe.com> - 2016-04-25 23:50 +0200
    Re: [PATCH v3 0/2] Support ACPI 6.1 update in NFIT Control Region Structure Dan Williams <dan.j.williams@intel.com> - 2016-04-27 02:00 +0200

#1386931 — [PATCH v3 0/2] Support ACPI 6.1 update in NFIT Control Region Structure

FromToshi Kani <toshi.kani@hpe.com>
Date2016-04-25 23:50 +0200
Subject[PATCH v3 0/2] Support ACPI 6.1 update in NFIT Control Region Structure
Message-ID<rrWye-4kQ-13@gated-at.bofh.it>
ACPI 6.1, Table 5-133, updates NVDIMM Control Region Structure as
follows.
 - Valid Fields, Manufacturing Location, and Manufacturing Date
   are added from reserved range.  No change in the structure size.
 - IDs (SPD values) are stored as arrays of bytes (i.e. big-endian
   format).  The spec clarifies that they need to be represented
   as arrays of bytes as well.

Patch 1 changes the NFIT driver to comply with ACPI 6.1.
Patch 2 adds a new sysfs file "id" to show NVDIMM ID defined in ACPI 6.1.

The patch-set applies on linux-pm.git acpica.

link: http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf

---
v3:
 - Need to coordinate with ACPICA update (Bob Moore, Dan Williams)
 - Integrate with ACPICA changes in struct acpi_nfit_control_region.
   (commit 138a95547ab0)

v2:
 - Remove 'mfg_location' and 'mfg_date'. (Dan Williams)
 - Rename 'unique_id' to 'id' and make this change as a separate patch.
   (Dan Williams)

---
Toshi Kani (3):
 1/2 acpi/nfit: Update nfit driver to comply with ACPI 6.1
 2/3 acpi/nfit: Add sysfs "id" for NVDIMM ID

---
 drivers/acpi/nfit.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

[toc] | [next] | [standalone]


#1386940 — [PATCH v3 2/2] acpi/nfit: Add sysfs "id" for NVDIMM ID

FromToshi Kani <toshi.kani@hpe.com>
Date2016-04-25 23:50 +0200
Subject[PATCH v3 2/2] acpi/nfit: Add sysfs "id" for NVDIMM ID
Message-ID<rrWyf-4kQ-35@gated-at.bofh.it>
In reply to#1386931
ACPI 6.1, section 5.2.25.9, defines an identifier for an NVDIMM.

Change the NFIT driver to add a new sysfs file "id" under nfit
directory.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Robert Moore <robert.moore@intel.com>
Cc: Robert Elliott <elliott@hpe.com>
---
 drivers/acpi/nfit.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 5dc243c..5a7199d 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -870,6 +870,24 @@ static ssize_t flags_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(flags);
 
+static ssize_t id_show(struct device *dev,
+		struct device_attribute *attr, char *buf)
+{
+	struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
+
+	if (dcr->valid_fields & ACPI_NFIT_CONTROL_MFG_INFO_VALID)
+		return sprintf(buf, "%04x-%02x-%04x-%08x\n",
+				be16_to_cpu(dcr->vendor_id),
+				dcr->manufacturing_location,
+				be16_to_cpu(dcr->manufacturing_date),
+				be32_to_cpu(dcr->serial_number));
+	else
+		return sprintf(buf, "%04x-%08x\n",
+				be16_to_cpu(dcr->vendor_id),
+				be32_to_cpu(dcr->serial_number));
+}
+static DEVICE_ATTR_RO(id);
+
 static struct attribute *acpi_nfit_dimm_attributes[] = {
 	&dev_attr_handle.attr,
 	&dev_attr_phys_id.attr,
@@ -879,6 +897,7 @@ static struct attribute *acpi_nfit_dimm_attributes[] = {
 	&dev_attr_serial.attr,
 	&dev_attr_rev_id.attr,
 	&dev_attr_flags.attr,
+	&dev_attr_id.attr,
 	NULL,
 };
 

[toc] | [prev] | [next] | [standalone]


#1386941 — [PATCH v3 1/2] acpi/nfit: Update nfit driver to comply with ACPI 6.1

FromToshi Kani <toshi.kani@hpe.com>
Date2016-04-25 23:50 +0200
Subject[PATCH v3 1/2] acpi/nfit: Update nfit driver to comply with ACPI 6.1
Message-ID<rrWye-4kQ-33@gated-at.bofh.it>
In reply to#1386931
ACPI 6.1, Table 5-133, updates NVDIMM Control Region Structure
as follows.
 - Valid Fields, Manufacturing Location, and Manufacturing Date
   are added from reserved range.  No change in the structure size.
 - IDs (SPD values) are stored as arrays of bytes (i.e. big-endian
   format).  The spec clarifies that they need to be represented
   as arrays of bytes as well.

This patch makes the following changes to support this update.
 - Change the NFIT driver to show SPD ID values in big-endian
   format.
 - Change sprintf format to use "0x" instead of "#" since "%#02x"
   does not prepend '0'.

link: http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Robert Moore <robert.moore@intel.com>
Cc: Robert Elliott <elliott@hpe.com>
---
 drivers/acpi/nfit.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index d0f35e6..5dc243c 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -816,7 +816,7 @@ static ssize_t vendor_show(struct device *dev,
 {
 	struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
 
-	return sprintf(buf, "%#x\n", dcr->vendor_id);
+	return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->vendor_id));
 }
 static DEVICE_ATTR_RO(vendor);
 
@@ -825,7 +825,7 @@ static ssize_t rev_id_show(struct device *dev,
 {
 	struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
 
-	return sprintf(buf, "%#x\n", dcr->revision_id);
+	return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->revision_id));
 }
 static DEVICE_ATTR_RO(rev_id);
 
@@ -834,7 +834,7 @@ static ssize_t device_show(struct device *dev,
 {
 	struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
 
-	return sprintf(buf, "%#x\n", dcr->device_id);
+	return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->device_id));
 }
 static DEVICE_ATTR_RO(device);
 
@@ -843,7 +843,7 @@ static ssize_t format_show(struct device *dev,
 {
 	struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
 
-	return sprintf(buf, "%#x\n", dcr->code);
+	return sprintf(buf, "0x%04x\n", be16_to_cpu(dcr->code));
 }
 static DEVICE_ATTR_RO(format);
 
@@ -852,7 +852,7 @@ static ssize_t serial_show(struct device *dev,
 {
 	struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
 
-	return sprintf(buf, "%#x\n", dcr->serial_number);
+	return sprintf(buf, "0x%08x\n", be32_to_cpu(dcr->serial_number));
 }
 static DEVICE_ATTR_RO(serial);
 

[toc] | [prev] | [next] | [standalone]


#1388378

FromDan Williams <dan.j.williams@intel.com>
Date2016-04-27 02:00 +0200
Message-ID<rsl3C-89z-49@gated-at.bofh.it>
In reply to#1386931
On Mon, Apr 25, 2016 at 2:34 PM, Toshi Kani <toshi.kani@hpe.com> wrote:
> ACPI 6.1, Table 5-133, updates NVDIMM Control Region Structure as
> follows.
>  - Valid Fields, Manufacturing Location, and Manufacturing Date
>    are added from reserved range.  No change in the structure size.
>  - IDs (SPD values) are stored as arrays of bytes (i.e. big-endian
>    format).  The spec clarifies that they need to be represented
>    as arrays of bytes as well.
>
> Patch 1 changes the NFIT driver to comply with ACPI 6.1.
> Patch 2 adds a new sysfs file "id" to show NVDIMM ID defined in ACPI 6.1.
>
> The patch-set applies on linux-pm.git acpica.
>
> link: http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf
>
> ---
> v3:
>  - Need to coordinate with ACPICA update (Bob Moore, Dan Williams)
>  - Integrate with ACPICA changes in struct acpi_nfit_control_region.
>    (commit 138a95547ab0)
>
> v2:
>  - Remove 'mfg_location' and 'mfg_date'. (Dan Williams)
>  - Rename 'unique_id' to 'id' and make this change as a separate patch.
>    (Dan Williams)
>
> ---
> Toshi Kani (3):
>  1/2 acpi/nfit: Update nfit driver to comply with ACPI 6.1
>  2/3 acpi/nfit: Add sysfs "id" for NVDIMM ID

Thanks Toshi, I've applied these.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web