@@ -253,6 +253,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;
}
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/nvdimm/core.c | 3 +++ drivers/nvdimm/dimm_devs.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-)