Commit 52d2edea authored by Vinicius Costa Gomes's avatar Vinicius Costa Gomes Committed by Vinod Koul
Browse files

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: 6078a315 ("dmaengine: idxd: Add idxd_device_config_save() and idxd_device_config_restore() helpers")
Reviewed-by: default avatarDave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarVinicius 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: default avatarVinod Koul <vkoul@kernel.org>
parent caf91cdf
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;
+2 −1
Original line number Diff line number Diff line
@@ -973,6 +973,7 @@ static void idxd_device_config_restore(struct idxd_device *idxd,

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

	if (idxd->evl)
		idxd->evl->size = saved_evl->size;

	for (i = 0; i < idxd->max_groups; i++) {