dmaengine: idxd: Make read buffer sysfs attributes invisible for Intel IAA
authorXiaochen Shen <xiaochen.shen@intel.com>
Sat, 22 Oct 2022 07:49:49 +0000 (15:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:47 +0000 (13:32 +0100)
commitc91e4513bc182901fcc7590aa5cf51d058205818
tree68cd818dd8713d200df9b1b5b69a45a4dc788ba7
parentf2f10a2db278b13f5e532b512a64e79c5b956eb6
dmaengine: idxd: Make read buffer sysfs attributes invisible for Intel IAA

[ Upstream commit 9a8ddb35a9d5d3ad76784a012459b256a9d7de7e ]

In current code, the following sysfs attributes are exposed to user to
show or update the values:
  max_read_buffers (max_tokens)
  read_buffer_limit (token_limit)
  group/read_buffers_allowed (group/tokens_allowed)
  group/read_buffers_reserved (group/tokens_reserved)
  group/use_read_buffer_limit (group/use_token_limit)

>From Intel IAA spec [1], Intel IAA does not support Read Buffer
allocation control. So these sysfs attributes should not be supported on
IAA device.

Fix this issue by making these sysfs attributes invisible through
is_visible() filter when the device is IAA.

Add description in the ABI documentation to mention that these
attributes are not visible when the device does not support Read Buffer
allocation control.

[1]: https://cdrdv2.intel.com/v1/dl/getContent/721858

Fixes: fde212e44f45 ("dmaengine: idxd: deprecate token sysfs attributes for read buffers")
Fixes: c52ca478233c ("dmaengine: idxd: add configuration component of driver")
Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20221022074949.11719-1-xiaochen.shen@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Documentation/ABI/stable/sysfs-driver-dma-idxd
drivers/dma/idxd/sysfs.c