Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1165674rdb; Fri, 9 Feb 2024 12:17:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEN38N0iDKGESOTv26Qybz47MiZFYRVCUHYld37SBKb35u1ATU4BKHCw55RceRFF1sVh5+Q X-Received: by 2002:aa7:da51:0:b0:560:e89b:eabc with SMTP id w17-20020aa7da51000000b00560e89beabcmr1735eds.39.1707509860618; Fri, 09 Feb 2024 12:17:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707509860; cv=pass; d=google.com; s=arc-20160816; b=N52t2gOyVhRg6qqktBF5U0vo4KcpTlhtfG7JxfTCcNCdqI9LA/Dh0+fqjQwr1i20fn BQRJkjGTtFrj5MkLRfbOIiQaVsPi/mu5ws+NsjboClCQ8jqrLp31S/6VVIHrZND0Tu7/ FamXaLkQ0Q5rTYe5MsOA/7sASPq6LThYgc+1CTPrT0EpSjVgqiSdHfVT52CJV2Zs+xem zAVKbVsZmS7x1nklvBhoYbelnxJu93ncygz6wxTdT3WHRTCgyCRrdMYlTwq9NvOho1DR QK/c1tafd5jIUFr6zObSiB658qs8yL6DKE4PtG7kZlF+Z9L7+FkjdVu2IpRWUbHzNhWf vIRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=dIdCblPcOP+K7e2WF07TCsTf8iPg9qp0U9RM7dnBNS4=; fh=iJEMTWLQ92RcbArtYZ5J8cx5QMVSRojAsnk0n+A6tlo=; b=05YtdNoxAd5SqYnqZxneTRCsb/aMTE2jowWTmWutUydgbXE4nfXJtjtfQL6eFWb5D1 e0cQhkZNmm3WVuhc1oU5VXUSc3xmp/vbjOWt1+59nJ9oqF5Ecu8NUQ+kJ4Q7hXEDcQjG g/117se6NFbfxP5yl/ejxLJ9FQbYK0FjBVst7nKQXONe4t5yASk+V54mLikmww0Fa+OE RWl+z6gVjAVoGi8ts1bss+YNy6dAsYamSbq5FomCNuW2LNI1e7JKLQUYD+afLfm4XiUL q62VnleS/QwwYuZdzwrvFZhJ7JKzWmuLxRa72wov76P4ZkQvY8dn5luz4ZIUgA62w08I OrAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=E6RRmuXv; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-59925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59925-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUZ2KO6GvOuA7Sd7r0P3bGHn3I1XugE5QyYQCgPmkWVCK9K/diT5PPMcaa7KrOGcoxUke9AfC5HZ+ltMToyoW65au0bHpJL9Gr4vbvLPg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k13-20020aa7c38d000000b00561401dbd48si70401edq.387.2024.02.09.12.17.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 12:17:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=E6RRmuXv; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-59925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59925-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4DC401F23EB9 for ; Fri, 9 Feb 2024 20:17:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9709D86ADE; Fri, 9 Feb 2024 20:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="E6RRmuXv" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50AA580BFA; Fri, 9 Feb 2024 20:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707509851; cv=none; b=CAvAvdntK9NWTph6gwUHA2B6wQQzHRt3lxTNXqv/D8O6AaRLFh8bnyDuR//hm7h81nmWFaz2NMKliSOIjJPhcbUldjTBxKiwrDcy6xSH4PQdIK0V4sbyvCTScGUU7pnsmx//Vh/U+iatv8K80Q6TflvRLovOyKSektTfsu66I0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707509851; c=relaxed/simple; bh=m4xOEA3wNI35EO0PmV1sH9LQsIloPJsMjTAyAAODgYo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hmSjhecjdQtrF5rnZOTIxWv9TEsJtuyUgT6Ppkr/nMkEIiEyN7DEc+0XiwhL0z3mu7Bn4CAdI6/uVLUxFHpeK4WEeL3wkk63f01BQDNaRKOmIuBIIkHVDV7YkdUq/XuKke1DUlVKCnKDqfFu7l5FLBq3iMWYPRhJbr4oa68SiEE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=E6RRmuXv; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707509850; x=1739045850; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=m4xOEA3wNI35EO0PmV1sH9LQsIloPJsMjTAyAAODgYo=; b=E6RRmuXvgnOQOepwIN3pEhHeJOT9gXwGW/EesKD/HXei2GGLb9VYSZJC /y9ZQrJ5J2vB/oOICgTlS7bj+oTYw9Fm5m0f9kf0kACgQniSR1fdl3ZiT BqNfhJgJAtlydAwFsOzCNH09J8ba8j+ndEpcI8T5dLSJEuBNC2TEsVDA3 cQ9XPjF/viao2P8Qh8/S64Z+ZbyE+UHOdJ/Dcz+B/uqaPojAWoro9r/cM EokqEc7WdTrA6alad8nRfUT5T9YxfnrMQawaw8JWC790me1+sKxO6L1SL tfo8bnuGNwMaMLPwRu075z8mDzpu+9eJVKpjD1ubJ8kJtrsZeimbET3DC g==; X-IronPort-AV: E=McAfee;i="6600,9927,10979"; a="19000632" X-IronPort-AV: E=Sophos;i="6.05,257,1701158400"; d="scan'208";a="19000632" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 12:17:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,257,1701158400"; d="scan'208";a="2327257" Received: from djiang5-mobl3.amr.corp.intel.com (HELO [10.246.112.114]) ([10.246.112.114]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 12:17:29 -0800 Message-ID: <36895817-8f71-461a-93e0-5db1a39cd3c4@intel.com> Date: Fri, 9 Feb 2024 13:17:27 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] dmaengine: idxd: Clear Event Log head in idxd upon completion of the Enable Device command Content-Language: en-US To: Fenghua Yu , Vinod Koul Cc: dmaengine@vger.kernel.org, linux-kernel , Lingyan Guo References: <20240209191851.1050501-1-fenghua.yu@intel.com> From: Dave Jiang In-Reply-To: <20240209191851.1050501-1-fenghua.yu@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 > Signed-off-by: Fenghua Yu > --- > 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; > }