[PATCH] dmaengine: idxd: Restrict DSACAP reads to DSA devices
From: Guixiong Wei
Date: Thu Nov 19 2026 - 06:22:43 EST
idxd_read_caps() reads DSACAP0-2 whenever the hardware version is 3 or
later, regardless of the accelerator type. On IAA devices, offset 0x180
is IAACAP, which is already read by the separate IAA capability path.
The additional reads populate DSA capability fields that are not used
by IAA devices.
Restrict DSACAP reads to DSA devices, matching the device type check used
for dsacaps sysfs visibility and SGL support.
Signed-off-by: Guixiong Wei <weiguixiong@xxxxxxxxxxxxx>
---
drivers/dma/idxd/init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 4b827a3297564..1a8638adf8c7d 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -560,7 +560,8 @@ static void idxd_read_caps(struct idxd_device *idxd)
}
multi_u64_to_bmap(idxd->opcap_bmap, &idxd->hw.opcap.bits[0], 4);
- if (idxd->hw.version >= DEVICE_VERSION_3) {
+ if (idxd->data->type == IDXD_TYPE_DSA &&
+ idxd->hw.version >= DEVICE_VERSION_3) {
idxd->hw.dsacap0.bits = ioread64(idxd->reg_base + IDXD_DSACAP0_OFFSET);
idxd->hw.dsacap1.bits = ioread64(idxd->reg_base + IDXD_DSACAP1_OFFSET);
idxd->hw.dsacap2.bits = ioread64(idxd->reg_base + IDXD_DSACAP2_OFFSET);
base-commit: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4
--
2.55.0