All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Vinod Koul <vkoul@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Fenghua Yu <fenghuay@nvidia.com>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/9] dmaengine: idxd: Fix crash when the event log is disabled
Date: Wed, 6 Aug 2025 10:07:05 -0700	[thread overview]
Message-ID: <585a324d-3a88-42e0-b4bf-2e757dcf5108@intel.com> (raw)
In-Reply-To: <20250804-idxd-fix-flr-on-kernel-queues-v3-v1-2-4e020fbf52c1@intel.com>



On 8/4/25 6:27 PM, Vinicius Costa Gomes wrote:
> If reporting errors to the event log is not supported by the hardware,
> and an error that causes Field 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")
> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/dma/idxd/device.c | 3 +++
>  drivers/dma/idxd/init.c   | 3 ++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
> index 5cf419fe6b4645337cf361305ca066d34763b3c2..c599a902767ee9904d75a0510a911596e35a259b 100644
> --- a/drivers/dma/idxd/device.c
> +++ b/drivers/dma/idxd/device.c
> @@ -815,6 +815,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;
> diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
> index d828d352ab008127e5e442e7072c9d5df0f2c6cf..a58b8cdbfa60ba9f00b91a737df01517885bc41a 100644
> --- a/drivers/dma/idxd/init.c
> +++ b/drivers/dma/idxd/init.c
> @@ -959,7 +959,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;
> 


  reply	other threads:[~2025-08-06 17:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-05  1:27 [PATCH 0/9] dmaengine: idxd: Memory leak and FLR fixes Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 1/9] dmaengine: idxd: Fix lockdep warnings when calling idxd_device_config() Vinicius Costa Gomes
2025-08-06 17:02   ` Dave Jiang
2025-08-06 20:25     ` Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 2/9] dmaengine: idxd: Fix crash when the event log is disabled Vinicius Costa Gomes
2025-08-06 17:07   ` Dave Jiang [this message]
2025-08-05  1:27 ` [PATCH 3/9] dmaengine: idxd: Fix possible invalid memory access after FLR Vinicius Costa Gomes
2025-08-06 17:09   ` Dave Jiang
2025-08-15 19:26   ` Nathan Lynch
2025-08-15 22:45     ` Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 4/9] dmaengine: idxd: Flush kernel workqueues on Field Level Reset Vinicius Costa Gomes
2025-08-06 17:12   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 5/9] dmaengine: idxd: Allow DMA clients to empty the pending queue Vinicius Costa Gomes
2025-08-06 17:17   ` Dave Jiang
2025-08-06 20:30     ` Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 6/9] dmaengine: idxd: Fix not releasing workqueue on .release() Vinicius Costa Gomes
2025-08-06 17:24   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 7/9] dmaengine: idxd: Fix memory leak when a wq is reset Vinicius Costa Gomes
2025-08-06 17:25   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 8/9] dmaengine: idxd: Fix freeing the allocated ida too late Vinicius Costa Gomes
2025-08-06 17:27   ` Dave Jiang
2025-08-05  1:28 ` [PATCH 9/9] dmaengine: idxd: Fix leaking event log memory Vinicius Costa Gomes
2025-08-06 17:29   ` Dave Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=585a324d-3a88-42e0-b4bf-2e757dcf5108@intel.com \
    --to=dave.jiang@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghuay@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinicius.gomes@intel.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.