Skip to content

Commit 0e76107

Browse files
vcgomesgregkh
authored andcommitted
dmaengine: idxd: Fix crash when the event log is disabled
[ Upstream commit 52d2ede ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6d7e5a9 commit 0e76107

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
@@ -830,6 +830,9 @@ static void idxd_device_evl_free(struct idxd_device *idxd)
830830
struct device *dev = &idxd->pdev->dev;
831831
struct idxd_evl *evl = idxd->evl;
832832

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

drivers/dma/idxd/init.c

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

963963
idxd->rdbuf_limit = idxd_saved->saved_idxd.rdbuf_limit;
964964

965-
idxd->evl->size = saved_evl->size;
965+
if (idxd->evl)
966+
idxd->evl->size = saved_evl->size;
966967

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

0 commit comments

Comments
 (0)