@@ -946,6 +946,7 @@ static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc)
if (!adev)
return;
+ nd_desc->call_dsm = 1;
for (i = ND_CMD_ARS_CAP; i <= ND_CMD_ARS_STATUS; i++)
if (acpi_check_dsm(adev->handle, uuid, 1, 1ULL << i))
set_bit(i, &nd_desc->dsm_mask);
@@ -252,6 +252,9 @@ static ssize_t commands_show(struct device *dev,
for_each_set_bit(cmd, &nd_desc->dsm_mask, BITS_PER_LONG)
len += sprintf(buf + len, "%s ", nvdimm_bus_cmd_name(cmd));
+ if (nd_desc->call_dsm)
+ len += sprintf(buf + len, "%s ",
+ nvdimm_bus_cmd_name(ND_CMD_CALL_DSM));
len += sprintf(buf + len, "\n");
return len;
}
@@ -274,14 +274,20 @@ EXPORT_SYMBOL_GPL(nvdimm_provider_data);
static ssize_t commands_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
+ struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(dev);
struct nvdimm *nvdimm = to_nvdimm(dev);
+ struct nvdimm_bus_descriptor *nd_desc;
int cmd, len = 0;
- if (!nvdimm->dsm_mask)
+ if (!nvdimm->dsm_mask || !nvdimm_bus)
return sprintf(buf, "\n");
for_each_set_bit(cmd, nvdimm->dsm_mask, BITS_PER_LONG)
len += sprintf(buf + len, "%s ", nvdimm_cmd_name(cmd));
+ nd_desc = nvdimm_bus->nd_desc;
+ if (nd_desc->call_dsm)
+ len += sprintf(buf + len, "%s ",
+ nvdimm_cmd_name(ND_CMD_CALL_DSM));
len += sprintf(buf + len, "\n");
return len;
}
@@ -69,6 +69,7 @@ struct nd_mapping {
struct nvdimm_bus_descriptor {
const struct attribute_group **attr_groups;
+ unsigned int call_dsm:1;
unsigned long dsm_mask;
char *provider_name;
ndctl_fn ndctl;
Indicate to userspace that the generic 'dsm_call' capability is available for the given control device. Over time we want to deprecate the per-dsm function ioctl commands and direct everything through the generic envelope. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- drivers/acpi/nfit.c | 1 + drivers/nvdimm/core.c | 3 +++ drivers/nvdimm/dimm_devs.c | 8 +++++++- include/linux/libnvdimm.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-)