* [PATCH] dmaengine: idxd: Restrict DSACAP reads to DSA devices
@ 2026-11-19 11:22 Guixiong Wei
2026-11-19 11:26 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Guixiong Wei @ 2026-11-19 11:22 UTC (permalink / raw)
To: Vinicius Costa Gomes, dmaengine
Cc: Guixiong Wei, Dave Jiang, Vinod Koul, Frank Li, linux-kernel,
Yi Sun
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@bytedance.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: idxd: Restrict DSACAP reads to DSA devices
2026-11-19 11:22 [PATCH] dmaengine: idxd: Restrict DSACAP reads to DSA devices Guixiong Wei
@ 2026-11-19 11:26 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-19 11:26 UTC (permalink / raw)
To: Guixiong Wei, dmaengine; +Cc: vkoul, Frank.Li
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dmaengine: idxd: missing Fixes trailer for unguarded DSACAP
register reads
--
commit 20d136fa0348a2bd1e8670da1c059a69c7edbff4
Author: Guixiong Wei <weiguixiong@bytedance.com>
> dmaengine: idxd: Restrict DSACAP reads to DSA devices
>
> 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@bytedance.com>
[Severity: Low]
Since this fixes the unguarded DSACAP0-2 reads in idxd_read_caps(),
should it include a Fixes: tag?
Fixes: 8308510b9365 ("dmaengine: idxd: Expose DSA3.0 capabilities through sysfs")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119112212.92663-2-weiguixiong@bytedance.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-19 11:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 11:22 [PATCH] dmaengine: idxd: Restrict DSACAP reads to DSA devices Guixiong Wei
2026-11-19 11:26 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox