mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Fenghua Yu <fenghua.yu@intel.com>, Vinod Koul <vkoul@kernel.org>
Cc: dmaengine@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Lingyan Guo <lingyan.guo@intel.com>
Subject: Re: [PATCH] dmaengine: idxd: Clear Event Log head in idxd upon completion of the Enable Device command
Date: Fri, 9 Feb 2024 13:17:27 -0700	[thread overview]
Message-ID: <36895817-8f71-461a-93e0-5db1a39cd3c4@intel.com> (raw)
In-Reply-To: <20240209191851.1050501-1-fenghua.yu@intel.com>



On 2/9/24 12:18 PM, Fenghua Yu wrote:
> If Event Log is supported, upon completion of the Enable Device command,
> the Event Log head in the variable idxd->evl->head should be cleared to
> match the state of the EVLSTATUS register. But the variable is not reset
> currently, leading mismatch of the variable and the register state.
> The mismatch causes incorrect processing of Event Log entries.
> 
> Fix the issue by clearing the variable after completion of the command.

Should this be done in idxd_device_clear_state() instead?

> 
> Fixes: 2f431ba908d2 ("dmaengine: idxd: add interrupt handling for event log")
> Tested-by: Lingyan Guo <lingyan.guo@intel.com>
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
> ---
>  drivers/dma/idxd/device.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
> index ecfdf4a8f1f8..7c9fb9b3e110 100644
> --- a/drivers/dma/idxd/device.c
> +++ b/drivers/dma/idxd/device.c
> @@ -546,6 +546,14 @@ int idxd_device_enable(struct idxd_device *idxd)
>  		return -ENXIO;
>  	}
>  
> +	/*
> +	 * If Event Log is supported, Event Log Status register was
> +	 * cleared after the Enable Device command. Clear Event Log
> +	 * head value that is stored in idxd to match the register state.
> +	 */
> +	if (idxd->evl)
> +		idxd->evl->head = 0;
> +
>  	idxd->state = IDXD_DEV_ENABLED;
>  	return 0;
>  }

  reply	other threads:[~2024-02-09 20:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 19:18 Fenghua Yu
2024-02-09 20:17 ` Dave Jiang [this message]
2024-02-11  1:49   ` Fenghua Yu
2024-02-12 16:39     ` Dave Jiang
2024-02-12 16:56       ` Fenghua Yu

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=36895817-8f71-461a-93e0-5db1a39cd3c4@intel.com \
    --to=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghua.yu@intel.com \
    --cc=lingyan.guo@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®