summaryrefslogtreecommitdiff
path: root/drivers/dma/idxd/init.c
diff options
context:
space:
mode:
authorFenghua Yu <fenghua.yu@intel.com>2023-01-27 22:28:55 +0300
committerVinod Koul <vkoul@kernel.org>2023-02-16 16:15:48 +0300
commit601bdadadb505a72d9a76cc20cdfa252cba7ddc0 (patch)
tree5e788a051c0a71fdc0d758c5ee648f19ae0849c4 /drivers/dma/idxd/init.c
parentb02e07015a5ac7bbc029da931ae17914b8ae0339 (diff)
downloadlinux-601bdadadb505a72d9a76cc20cdfa252cba7ddc0.tar.xz
dmaengine: idxd: Fix default allowed read buffers value in group
Currently default read buffers that is allowed in a group is 0. grpcfg will be configured to max read buffers that IDXD can support if the group's allowed read buffers value is 0. But 0 is an invalid read buffers value and user may get confused when seeing the invalid initial value 0 through sysfs interface. To show only valid allowed read buffers value and eliminate confusion, directly initialize the allowed read buffers to IDXD's max read buffers. User still can change the value through sysfs interface. Suggested-by: Ramesh Thomas <ramesh.thomas@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20230127192855.966929-1-fenghua.yu@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idxd/init.c')
-rw-r--r--drivers/dma/idxd/init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index e63b0c674d88..640d3048368e 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -302,6 +302,11 @@ static int idxd_setup_groups(struct idxd_device *idxd)
group->tc_a = -1;
group->tc_b = -1;
}
+ /*
+ * The default value is the same as the value of
+ * total read buffers in GRPCAP.
+ */
+ group->rdbufs_allowed = idxd->max_rdbufs;
}
return 0;