]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dmaengine: idxd: Fix crash when the event log is disabled
authorVinicius Costa Gomes <vinicius.gomes@intel.com>
Wed, 21 Jan 2026 18:34:28 +0000 (10:34 -0800)
committerVinod Koul <vkoul@kernel.org>
Wed, 25 Feb 2026 11:09:17 +0000 (16:39 +0530)
If reporting errors to the event log is not supported by the hardware,
and an error that causes Function Level Reset (FLR) is received, the
driver will try to restore the event log even if it was not allocated.

Also, only try to free the event log if it was properly allocated.

Fixes: 6078a315aec1 ("dmaengine: idxd: Add idxd_device_config_save() and idxd_device_config_restore() helpers")
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-2-7ed70658a9d1@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/device.c
drivers/dma/idxd/init.c

index a704475d87b323a21657545670f8cc02c1e06dd6..5265925f30764233374f41e148b25badb8f79840 100644 (file)
@@ -831,6 +831,9 @@ static void idxd_device_evl_free(struct idxd_device *idxd)
        struct device *dev = &idxd->pdev->dev;
        struct idxd_evl *evl = idxd->evl;
 
+       if (!evl)
+               return;
+
        gencfg.bits = ioread32(idxd->reg_base + IDXD_GENCFG_OFFSET);
        if (!gencfg.evl_en)
                return;
index dd32b81a3108c47e6e303a4bbd3d39e96049f907..1c3f9bc7364b515f79ba4e2050410a41a09d5d4a 100644 (file)
@@ -973,7 +973,8 @@ static void idxd_device_config_restore(struct idxd_device *idxd,
 
        idxd->rdbuf_limit = idxd_saved->saved_idxd.rdbuf_limit;
 
-       idxd->evl->size = saved_evl->size;
+       if (idxd->evl)
+               idxd->evl->size = saved_evl->size;
 
        for (i = 0; i < idxd->max_groups; i++) {
                struct idxd_group *saved_group, *group;