Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1670952 > unrolled thread
| Started by | Jerry Hoemann <jerry.hoemann@hpe.com> |
|---|---|
| First post | 2017-06-20 19:00 +0200 |
| Last post | 2017-06-26 19:40 +0200 |
| Articles | 9 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v2 0/7] Enable DSM pass thru for root functions Jerry Hoemann <jerry.hoemann@hpe.com> - 2017-06-20 19:00 +0200
[PATCH v2 1/7] libnvdimm: passthru functions clear to send Jerry Hoemann <jerry.hoemann@hpe.com> - 2017-06-20 19:00 +0200
[PATCH v2 3/7] libnvdimm: Add bus level dsm mask. Jerry Hoemann <jerry.hoemann@hpe.com> - 2017-06-20 19:00 +0200
[PATCH v2 7/7] acpi, nfit: override mask Jerry Hoemann <jerry.hoemann@hpe.com> - 2017-06-20 19:00 +0200
[PATCH v2 4/7] acpi, nfit: Use bus_dsm_mask for passthru Jerry Hoemann <jerry.hoemann@hpe.com> - 2017-06-20 19:00 +0200
Re: [PATCH v2 4/7] acpi, nfit: Use bus_dsm_mask for passthru Dan Williams <dan.j.williams@intel.com> - 2017-06-28 23:10 +0200
[PATCH v2 6/7] libnvdimm: New ACPI 6.2 DSM functions Jerry Hoemann <jerry.hoemann@hpe.com> - 2017-06-20 19:00 +0200
Re: [PATCH v2 6/7] libnvdimm: New ACPI 6.2 DSM functions Dan Williams <dan.j.williams@intel.com> - 2017-06-28 23:20 +0200
Re: [PATCH v2 0/7] Enable DSM pass thru for root functions Jerry Hoemann <jerry.hoemann@hpe.com> - 2017-06-26 19:40 +0200
| From | Jerry Hoemann <jerry.hoemann@hpe.com> |
|---|---|
| Date | 2017-06-20 19:00 +0200 |
| Subject | [PATCH v2 0/7] Enable DSM pass thru for root functions |
| Message-ID | <tUuFr-2G9-5@gated-at.bofh.it> |
The new ACPI 6.2 spec has added new NVDIMM root DSM functions that managibility and test software needs to call. This patch set enables the calling root functions DSM via the pass thru mechanism. Changes v2 ---------- 1. Add bus_dsm_mask to filter root pass thru calls. 2. Add bus_dsm_mask_show to display bus_dsm_mask in sysfs 3. Extend override_dsm_mask to be used for bus_dms_mask also. Details v1 ---------- __nd_ioctl: Check pass thru functions against nd_cmd_clear_to_send. acpi_nfit_init_dsms: Set additional bits in cmd_mask for new functions. ndctl.h: Define data structure for the new 6.2 functions. Add new function names to nvdimm_bus_cmd_name. Jerry Hoemann (7): libnvdimm: passthru functions clear to send acpi, nfit: Enable DSM pass thru for root functions. libnvdimm: Add bus level dsm mask. acpi, nfit: Use bus_dsm_mask for passthru acpi, nfit: Show bus_dsm_mask libnvdimm: New ACPI 6.2 DSM functions acpi, nfit: override mask drivers/acpi/nfit/core.c | 20 ++++++++++++++++++++ drivers/nvdimm/bus.c | 4 +++- include/linux/libnvdimm.h | 1 + include/uapi/linux/ndctl.h | 41 ++++++++++++++++++++++++++++++++++++++++- 4 files changed, 64 insertions(+), 2 deletions(-) -- 1.8.5.6
[toc] | [next] | [standalone]
| From | Jerry Hoemann <jerry.hoemann@hpe.com> |
|---|---|
| Date | 2017-06-20 19:00 +0200 |
| Subject | [PATCH v2 1/7] libnvdimm: passthru functions clear to send |
| Message-ID | <tUuFs-2G9-17@gated-at.bofh.it> |
| In reply to | #1670952 |
Have dsm functions called via the pass thru mechanism also
be checked against clear to send.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
---
drivers/nvdimm/bus.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
index e9361bf..e16427d 100644
--- a/drivers/nvdimm/bus.c
+++ b/drivers/nvdimm/bus.c
@@ -907,6 +907,7 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
static char in_env[ND_CMD_MAX_ENVELOPE];
const struct nd_cmd_desc *desc = NULL;
unsigned int cmd = _IOC_NR(ioctl_cmd);
+ unsigned int func = cmd;
void __user *p = (void __user *) arg;
struct device *dev = &nvdimm_bus->dev;
struct nd_cmd_pkg pkg;
@@ -972,6 +973,7 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
}
if (cmd == ND_CMD_CALL) {
+ func = pkg.nd_command;
dev_dbg(dev, "%s:%s, idx: %llu, in: %zu, out: %zu, len %zu\n",
__func__, dimm_name, pkg.nd_command,
in_len, out_len, buf_len);
@@ -1020,7 +1022,7 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
}
nvdimm_bus_lock(&nvdimm_bus->dev);
- rc = nd_cmd_clear_to_send(nvdimm_bus, nvdimm, cmd, buf);
+ rc = nd_cmd_clear_to_send(nvdimm_bus, nvdimm, func, buf);
if (rc)
goto out_unlock;
--
1.8.5.6
[toc] | [prev] | [next] | [standalone]
| From | Jerry Hoemann <jerry.hoemann@hpe.com> |
|---|---|
| Date | 2017-06-20 19:00 +0200 |
| Subject | [PATCH v2 3/7] libnvdimm: Add bus level dsm mask. |
| Message-ID | <tUuFt-2G9-31@gated-at.bofh.it> |
| In reply to | #1670952 |
Add a bus level dsm_mask to nvdimm_bus_descriptor to allow the passthru
calling mechanism to specify a different mask from the cmd_mask.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
---
include/linux/libnvdimm.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index 6c80701..f8b8f43 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -54,6 +54,7 @@ typedef int (*ndctl_fn)(struct nvdimm_bus_descriptor *nd_desc,
struct nvdimm_bus_descriptor {
const struct attribute_group **attr_groups;
+ unsigned long bus_dsm_mask;
unsigned long cmd_mask;
struct module *module;
char *provider_name;
--
1.8.5.6
[toc] | [prev] | [next] | [standalone]
| From | Jerry Hoemann <jerry.hoemann@hpe.com> |
|---|---|
| Date | 2017-06-20 19:00 +0200 |
| Subject | [PATCH v2 7/7] acpi, nfit: override mask |
| Message-ID | <tUuFt-2G9-33@gated-at.bofh.it> |
| In reply to | #1670952 |
Add module parameter override_dsm_mask_root for overriding the dsm_mask like we do for non-root dsm calls. Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.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 f133b3e..456fcc2 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -1624,6 +1624,7 @@ static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc) struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc; const u8 *uuid = to_nfit_uuid(NFIT_DEV_BUS); struct acpi_device *adev; + unsigned long dsm_mask; int i; nd_desc->cmd_mask = acpi_desc->bus_cmd_force_en; @@ -1635,7 +1636,11 @@ static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc) if (acpi_check_dsm(adev->handle, uuid, 1, 1ULL << i)) set_bit(i, &nd_desc->cmd_mask); set_bit(ND_CMD_CALL, &nd_desc->cmd_mask); - for (i = 0; i < ND_CMD_CALL; i++) + + dsm_mask = 0x3bf; + if (override_dsm_mask) + dsm_mask = override_dsm_mask; + for_each_set_bit(i, &dsm_mask, BITS_PER_LONG) if (acpi_check_dsm(adev->handle, uuid, 1, 1ULL << i)) set_bit(i, &nd_desc->bus_dsm_mask); } -- 1.8.5.6
[toc] | [prev] | [next] | [standalone]
| From | Jerry Hoemann <jerry.hoemann@hpe.com> |
|---|---|
| Date | 2017-06-20 19:00 +0200 |
| Subject | [PATCH v2 4/7] acpi, nfit: Use bus_dsm_mask for passthru |
| Message-ID | <tUuFt-2G9-39@gated-at.bofh.it> |
| In reply to | #1670952 |
Populate bus_dsm_mask and use it to filter dsm calls that user can make through the pass thru interface. Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com> --- drivers/acpi/nfit/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index b46fca2..9d281a4 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -253,6 +253,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, cmd_name = nvdimm_bus_cmd_name(cmd); cmd_mask = nd_desc->cmd_mask; dsm_mask = cmd_mask; + if (cmd == ND_CMD_CALL) dsm_mask = nd_desc->bus_dsm_mask; desc = nd_cmd_bus_desc(cmd); uuid = to_nfit_uuid(NFIT_DEV_BUS); handle = adev->handle; @@ -1624,6 +1625,9 @@ static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc) if (acpi_check_dsm(adev->handle, uuid, 1, 1ULL << i)) set_bit(i, &nd_desc->cmd_mask); set_bit(ND_CMD_CALL, &nd_desc->cmd_mask); + for (i = 0; i < ND_CMD_CALL; i++) + if (acpi_check_dsm(adev->handle, uuid, 1, 1ULL << i)) + set_bit(i, &nd_desc->bus_dsm_mask); } static ssize_t range_index_show(struct device *dev, -- 1.8.5.6
[toc] | [prev] | [next] | [standalone]
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2017-06-28 23:10 +0200 |
| Subject | Re: [PATCH v2 4/7] acpi, nfit: Use bus_dsm_mask for passthru |
| Message-ID | <tXsnM-2zA-27@gated-at.bofh.it> |
| In reply to | #1670960 |
On Tue, Jun 20, 2017 at 9:51 AM, Jerry Hoemann <jerry.hoemann@hpe.com> wrote: > Populate bus_dsm_mask and use it to filter dsm calls that user can > make through the pass thru interface. > > Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com> > --- > drivers/acpi/nfit/core.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c > index b46fca2..9d281a4 100644 > --- a/drivers/acpi/nfit/core.c > +++ b/drivers/acpi/nfit/core.c > @@ -253,6 +253,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, > cmd_name = nvdimm_bus_cmd_name(cmd); > cmd_mask = nd_desc->cmd_mask; > dsm_mask = cmd_mask; > + if (cmd == ND_CMD_CALL) dsm_mask = nd_desc->bus_dsm_mask; Checkpatch complains about this: ERROR: trailing statements should be on next line #118: FILE: drivers/acpi/nfit/core.c:256: + if (cmd == ND_CMD_CALL) dsm_mask = nd_desc->bus_dsm_mask;
[toc] | [prev] | [next] | [standalone]
| From | Jerry Hoemann <jerry.hoemann@hpe.com> |
|---|---|
| Date | 2017-06-20 19:00 +0200 |
| Subject | [PATCH v2 6/7] libnvdimm: New ACPI 6.2 DSM functions |
| Message-ID | <tUuFt-2G9-41@gated-at.bofh.it> |
| In reply to | #1670952 |
ACPI 6.2 added new NVDIMM root DSM functions. Define their
data structures.
Update the definition of nd_cmd_ars_cap to match the 6.2 spec.
Add the new 6.2 functions names to nvdimm_bus_cmd_name.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
---
include/uapi/linux/ndctl.h | 40 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
index e23c37f..e15768f 100644
--- a/include/uapi/linux/ndctl.h
+++ b/include/uapi/linux/ndctl.h
@@ -105,7 +105,8 @@ struct nd_cmd_ars_cap {
__u32 status;
__u32 max_ars_out;
__u32 clear_err_unit;
- __u32 reserved;
+ __u16 flags;
+ __u16 reserved;
} __packed;
struct nd_cmd_ars_start {
@@ -144,6 +145,43 @@ struct nd_cmd_clear_error {
__u64 cleared;
} __packed;
+struct nd_cmd_trans_spa {
+ __u64 spa;
+ __u32 status;
+ __u8 flags;
+ __u8 _reserved[3];
+ __u64 trans_length;
+ __u32 num_nvdimms;
+ struct nd_nvdimm_device {
+ __u32 nfit_device_handle;
+ __u32 _reserved;
+ __u64 dpa;
+ } __packed devices[0];
+
+} __packed;
+
+struct nd_cmd_ars_err_inj {
+ __u64 err_inj_spa_range_base;
+ __u64 err_inj_spa_range_length;
+ __u8 err_inj_options;
+ __u32 status;
+} __packed;
+
+struct nd_cmd_ars_err_inj_clr {
+ __u64 err_inj_clr_spa_range_base;
+ __u64 err_inj_clr_spa_range_length;
+ __u32 status;
+} __packed;
+
+struct nd_cmd_ars_err_inj_stat {
+ __u32 status;
+ __u32 inj_err_rec_count;
+ struct nd_error_stat_query_record {
+ __u64 err_inj_stat_spa_range_base;
+ __u64 err_inj_stat_spa_range_length;
+ } __packed record[0];
+} __packed;
+
enum {
ND_CMD_IMPLEMENTED = 0,
--
1.8.5.6
[toc] | [prev] | [next] | [standalone]
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2017-06-28 23:20 +0200 |
| Subject | Re: [PATCH v2 6/7] libnvdimm: New ACPI 6.2 DSM functions |
| Message-ID | <tXsxs-2Do-21@gated-at.bofh.it> |
| In reply to | #1670961 |
On Tue, Jun 20, 2017 at 9:51 AM, Jerry Hoemann <jerry.hoemann@hpe.com> wrote: > ACPI 6.2 added new NVDIMM root DSM functions. Define their > data structures. > > Update the definition of nd_cmd_ars_cap to match the 6.2 spec. > > Add the new 6.2 functions names to nvdimm_bus_cmd_name. This part of the changelog is stale, just trim it when you resend the series with the other fixups.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Hoemann <jerry.hoemann@hpe.com> |
|---|---|
| Date | 2017-06-26 19:40 +0200 |
| Message-ID | <tWG9r-5iW-7@gated-at.bofh.it> |
| In reply to | #1670952 |
On Tue, Jun 20, 2017 at 10:51:19AM -0600, Jerry Hoemann wrote: > The new ACPI 6.2 spec has added new NVDIMM root DSM functions > that managibility and test software needs to call. > > This patch set enables the calling root functions DSM via the > pass thru mechanism. > > Changes v2 > ---------- > 1. Add bus_dsm_mask to filter root pass thru calls. > > 2. Add bus_dsm_mask_show to display bus_dsm_mask in sysfs > > 3. Extend override_dsm_mask to be used for bus_dms_mask also. > Dan, Did you have any feedback? Thanks Jerry > > > > Details v1 > ---------- > > __nd_ioctl: > Check pass thru functions against nd_cmd_clear_to_send. > > acpi_nfit_init_dsms: > Set additional bits in cmd_mask for new functions. > > ndctl.h: > Define data structure for the new 6.2 functions. > Add new function names to nvdimm_bus_cmd_name. > > > > Jerry Hoemann (7): > libnvdimm: passthru functions clear to send > acpi, nfit: Enable DSM pass thru for root functions. > libnvdimm: Add bus level dsm mask. > acpi, nfit: Use bus_dsm_mask for passthru > acpi, nfit: Show bus_dsm_mask > libnvdimm: New ACPI 6.2 DSM functions > acpi, nfit: override mask > > drivers/acpi/nfit/core.c | 20 ++++++++++++++++++++ > drivers/nvdimm/bus.c | 4 +++- > include/linux/libnvdimm.h | 1 + > include/uapi/linux/ndctl.h | 41 ++++++++++++++++++++++++++++++++++++++++- > 4 files changed, 64 insertions(+), 2 deletions(-) > > -- > 1.8.5.6 -- ----------------------------------------------------------------------------- Jerry Hoemann Software Engineer Hewlett Packard Enterprise -----------------------------------------------------------------------------
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web