From: Toshi Kani <toshi.kani@hpe.com>
To: rjw@rjwysocki.net, dan.j.williams@intel.com
Cc: robert.moore@intel.com, elliott@hpe.com,
linux-nvdimm@lists.01.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, Toshi Kani <toshi.kani@hpe.com>
Subject: [PATCH v3 1/2] acpi/nfit: Update nfit driver to comply with ACPI 6.1
Date: Mon, 25 Apr 2016 15:34:58 -0600 [thread overview]
Message-ID: <1461620099-11933-2-git-send-email-toshi.kani@hpe.com> (raw)
In-Reply-To: <1461620099-11933-1-git-send-email-toshi.kani@hpe.com>
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);
next prev parent reply other threads:[~2016-04-25 21:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-25 21:34 [PATCH v3 0/2] Support ACPI 6.1 update in NFIT Control Region Structure Toshi Kani
2016-04-25 21:34 ` Toshi Kani [this message]
[not found] ` <1461620099-11933-2-git-send-email-toshi.kani-ZPxbGqLxI0U@public.gmane.org>
2018-06-18 19:01 ` [PATCH v3 1/2] acpi/nfit: Update nfit driver to comply with ACPI 6.1 Dan Williams
[not found] ` <CAA9_cmenbY9GStibRjO0BfTq0kzzzqThiLeOygJsT9L03BFsBQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-18 19:39 ` Kani, Toshi
2018-06-18 19:46 ` Dan Williams
[not found] ` <CAPcyv4jbctFgCob58sjQZ8msGOT7GBe=+Z_2P6YvNrrK-ztMag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-18 21:37 ` Elliott, Robert (Persistent Memory)
[not found] ` <AT5PR8401MB1169FA8B55B36BAE8DF0F6EBAB710-TASIVIpwxD5P8eCFU2xCp5pmD3emsgjRq6DjORPBYUW4xSMpw2roznzNABE0Ld/Y@public.gmane.org>
2018-06-18 21:46 ` Dan Williams
[not found] ` <CAPcyv4goV+VR15qpio-wqDpDS3nXsfYEbTSk1Ws6DPp6ECKcRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-19 14:31 ` Elliott, Robert (Persistent Memory)
[not found] ` <AT5PR8401MB1169ECE7D26644D39DB735D5AB700-TASIVIpwxD5P8eCFU2xCp5pmD3emsgjRq6DjORPBYUW4xSMpw2roznzNABE0Ld/Y@public.gmane.org>
2018-06-19 15:28 ` Dan Williams
[not found] ` <CAPcyv4joz7OemcKvJMJVhqKEVgSMpfLbm2DRP9B=S3vRPUAGkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-19 19:53 ` Elliott, Robert (Persistent Memory)
[not found] ` <AT5PR8401MB1169CBD96EE6C152A24D9FD3AB700-TASIVIpwxD5P8eCFU2xCp5pmD3emsgjRq6DjORPBYUW4xSMpw2roznzNABE0Ld/Y@public.gmane.org>
2018-06-19 23:46 ` Dan Williams
2016-04-25 21:34 ` [PATCH v3 2/2] acpi/nfit: Add sysfs "id" for NVDIMM ID Toshi Kani
2016-04-26 23:54 ` [PATCH v3 0/2] Support ACPI 6.1 update in NFIT Control Region Structure Dan Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461620099-11933-2-git-send-email-toshi.kani@hpe.com \
--to=toshi.kani@hpe.com \
--cc=dan.j.williams@intel.com \
--cc=elliott@hpe.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).