* [PATCH] dmaengine: idxd: export hw version through sysfs
@ 2020-04-03 20:52 Dave Jiang
2020-04-15 15:59 ` Vinod Koul
0 siblings, 1 reply; 3+ messages in thread
From: Dave Jiang @ 2020-04-03 20:52 UTC (permalink / raw)
To: vkoul; +Cc: dmaengine
Some user apps would like to know the hardware version in order to
determine the variation of the hardware. Export the hardware version number
to userspace via sysfs.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
drivers/dma/idxd/sysfs.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
index 5fb6b5cafb55..bd05a04d3aa3 100644
--- a/drivers/dma/idxd/sysfs.c
+++ b/drivers/dma/idxd/sysfs.c
@@ -1377,6 +1377,16 @@ static const struct attribute_group *idxd_wq_attribute_groups[] = {
};
/* IDXD device attribs */
+static ssize_t version_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct idxd_device *idxd =
+ container_of(dev, struct idxd_device, conf_dev);
+
+ return sprintf(buf, "%#x\n", idxd->hw.version);
+}
+static DEVICE_ATTR_RO(version);
+
static ssize_t max_work_queues_size_show(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -1618,6 +1628,7 @@ static ssize_t cdev_major_show(struct device *dev,
static DEVICE_ATTR_RO(cdev_major);
static struct attribute *idxd_device_attributes[] = {
+ &dev_attr_version.attr,
&dev_attr_max_groups.attr,
&dev_attr_max_work_queues.attr,
&dev_attr_max_work_queues_size.attr,
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dmaengine: idxd: export hw version through sysfs
2020-04-03 20:52 [PATCH] dmaengine: idxd: export hw version through sysfs Dave Jiang
@ 2020-04-15 15:59 ` Vinod Koul
2020-04-15 16:04 ` Dave Jiang
0 siblings, 1 reply; 3+ messages in thread
From: Vinod Koul @ 2020-04-15 15:59 UTC (permalink / raw)
To: Dave Jiang; +Cc: dmaengine
On 03-04-20, 13:52, Dave Jiang wrote:
> Some user apps would like to know the hardware version in order to
> determine the variation of the hardware. Export the hardware version number
> to userspace via sysfs.
Documentation update?
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/dma/idxd/sysfs.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
> index 5fb6b5cafb55..bd05a04d3aa3 100644
> --- a/drivers/dma/idxd/sysfs.c
> +++ b/drivers/dma/idxd/sysfs.c
> @@ -1377,6 +1377,16 @@ static const struct attribute_group *idxd_wq_attribute_groups[] = {
> };
>
> /* IDXD device attribs */
> +static ssize_t version_show(struct device *dev, struct device_attribute *attr,
> + char *buf)
> +{
> + struct idxd_device *idxd =
> + container_of(dev, struct idxd_device, conf_dev);
> +
> + return sprintf(buf, "%#x\n", idxd->hw.version);
> +}
> +static DEVICE_ATTR_RO(version);
> +
> static ssize_t max_work_queues_size_show(struct device *dev,
> struct device_attribute *attr,
> char *buf)
> @@ -1618,6 +1628,7 @@ static ssize_t cdev_major_show(struct device *dev,
> static DEVICE_ATTR_RO(cdev_major);
>
> static struct attribute *idxd_device_attributes[] = {
> + &dev_attr_version.attr,
> &dev_attr_max_groups.attr,
> &dev_attr_max_work_queues.attr,
> &dev_attr_max_work_queues_size.attr,
--
~Vinod
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dmaengine: idxd: export hw version through sysfs
2020-04-15 15:59 ` Vinod Koul
@ 2020-04-15 16:04 ` Dave Jiang
0 siblings, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2020-04-15 16:04 UTC (permalink / raw)
To: Vinod Koul; +Cc: dmaengine
On 4/15/2020 8:59 AM, Vinod Koul wrote:
> On 03-04-20, 13:52, Dave Jiang wrote:
>> Some user apps would like to know the hardware version in order to
>> determine the variation of the hardware. Export the hardware version number
>> to userspace via sysfs.
>
> Documentation update?
Ah right! Will add that.
>
>>
>> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
>> ---
>> drivers/dma/idxd/sysfs.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
>> index 5fb6b5cafb55..bd05a04d3aa3 100644
>> --- a/drivers/dma/idxd/sysfs.c
>> +++ b/drivers/dma/idxd/sysfs.c
>> @@ -1377,6 +1377,16 @@ static const struct attribute_group *idxd_wq_attribute_groups[] = {
>> };
>>
>> /* IDXD device attribs */
>> +static ssize_t version_show(struct device *dev, struct device_attribute *attr,
>> + char *buf)
>> +{
>> + struct idxd_device *idxd =
>> + container_of(dev, struct idxd_device, conf_dev);
>> +
>> + return sprintf(buf, "%#x\n", idxd->hw.version);
>> +}
>> +static DEVICE_ATTR_RO(version);
>> +
>> static ssize_t max_work_queues_size_show(struct device *dev,
>> struct device_attribute *attr,
>> char *buf)
>> @@ -1618,6 +1628,7 @@ static ssize_t cdev_major_show(struct device *dev,
>> static DEVICE_ATTR_RO(cdev_major);
>>
>> static struct attribute *idxd_device_attributes[] = {
>> + &dev_attr_version.attr,
>> &dev_attr_max_groups.attr,
>> &dev_attr_max_work_queues.attr,
>> &dev_attr_max_work_queues_size.attr,
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-15 16:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03 20:52 [PATCH] dmaengine: idxd: export hw version through sysfs Dave Jiang
2020-04-15 15:59 ` Vinod Koul
2020-04-15 16:04 ` Dave Jiang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.