Skip to content

Commit

Permalink
dmaengine: idxd: fix opcap sysfs attribute output
Browse files Browse the repository at this point in the history
[ Upstream commit ea6a573 ]

The operation capability register is 256bits. The current output only
prints out the first 64bits. Fix to output the entire 256bits. The current
code omits operation caps from IAX devices.

Fixes: c52ca47 ("dmaengine: idxd: add configuration component of driver")
Reported-by: Lucas Van <lucas.van@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/161645624963.2003736.829798666998490151.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
davejiang authored and gregkh committed Apr 21, 2021
1 parent 7f9b39e commit 60673d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/dma/idxd/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,8 +1449,14 @@ static ssize_t op_cap_show(struct device *dev,
{
struct idxd_device *idxd =
container_of(dev, struct idxd_device, conf_dev);
int i, rc = 0;

for (i = 0; i < 4; i++)
rc += sysfs_emit_at(buf, rc, "%#llx ", idxd->hw.opcap.bits[i]);

return sprintf(buf, "%#llx\n", idxd->hw.opcap.bits[0]);
rc--;
rc += sysfs_emit_at(buf, rc, "\n");
return rc;
}
static DEVICE_ATTR_RO(op_cap);

Expand Down

0 comments on commit 60673d3

Please sign in to comment.