Skip to content

Commit 52d2ede

Browse files
vcgomesvinodkoul
authored andcommitted
dmaengine: idxd: Fix crash when the event log is disabled
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: 6078a31 ("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>
1 parent caf91cd commit 52d2ede

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/dma/idxd/device.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,9 @@ static void idxd_device_evl_free(struct idxd_device *idxd)
831831
struct device *dev = &idxd->pdev->dev;
832832
struct idxd_evl *evl = idxd->evl;
833833

834+
if (!evl)
835+
return;
836+
834837
gencfg.bits = ioread32(idxd->reg_base + IDXD_GENCFG_OFFSET);
835838
if (!gencfg.evl_en)
836839
return;

drivers/dma/idxd/init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,8 @@ static void idxd_device_config_restore(struct idxd_device *idxd,
973973

974974
idxd->rdbuf_limit = idxd_saved->saved_idxd.rdbuf_limit;
975975

976-
idxd->evl->size = saved_evl->size;
976+
if (idxd->evl)
977+
idxd->evl->size = saved_evl->size;
977978

978979
for (i = 0; i < idxd->max_groups; i++) {
979980
struct idxd_group *saved_group, *group;

0 commit comments

Comments
 (0)