From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09FB6C7EE2A for ; Fri, 27 Jun 2025 20:43:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C105E10EA8C; Fri, 27 Jun 2025 20:43:53 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="ZwwMbJFN"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 64FA010EA89 for ; Fri, 27 Jun 2025 20:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1751057027; x=1782593027; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BJcfpLwdp7OjNfdXNRDZjblDyEz0umlF3JSqpfLr03I=; b=ZwwMbJFNVI5aihYrjzEoXIRttaR3mlpwNh8hZ5/Bl7USJZPR3GQfaYW1 /ZYgSq64YbtiEh8YKCws0AGvFYIBd+36kdjw44w5xW/CdRsYPf8td6LjT BJZVT+rafXlrKJwMOyc8KFGJ9/8F/bKt+hL/0kQQH3Y9LbEuZWFS+AOff fkwkIYI6+UjJv++CKvh+duiheqRXZh1AwdmmiHQiLRpAzEfRYE99Fb/sV U2U7/SvL6d4QCqPiwQaYhA7tUvxLE7y3/fG629a/EgmVFjYHeIX6oILAW PPxJwvK4cyPtmF1m1rmtxqGBpqYmvv/OFOhYKxB7Js3KCQr+RqPFD1Kaa Q==; X-CSE-ConnectionGUID: EpI8i0/iQU+YW7jsIdt26g== X-CSE-MsgGUID: pa+WSOjTR52Xok8xPyOl0w== X-IronPort-AV: E=McAfee;i="6800,10657,11477"; a="41003205" X-IronPort-AV: E=Sophos;i="6.16,271,1744095600"; d="scan'208";a="41003205" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2025 13:43:47 -0700 X-CSE-ConnectionGUID: MrFUUSUVQYG9uiqArmvggQ== X-CSE-MsgGUID: fKjYIsXeTieh7RqGhOq4GA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,271,1744095600"; d="scan'208";a="156939019" Received: from mjruhl-desk.amr.corp.intel.com (HELO mjruhl-desk.intel.com) ([10.124.220.252]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2025 13:43:46 -0700 From: "Michael J. Ruhl" To: platform-driver-x86@vger.kernel.org, intel-xe@lists.freedesktop.org, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, lucas.demarchi@intel.com, rodrigo.vivi@intel.com, thomas.hellstrom@linux.intel.com, airlied@gmail.com, simona@ffwll.ch, david.e.box@linux.intel.com Cc: "Michael J. Ruhl" Subject: [PATCH v5 06/12] platform/x86/intel/pmt: re-order trigger logic Date: Fri, 27 Jun 2025 16:43:15 -0400 Message-ID: <20250627204321.521628-7-michael.j.ruhl@intel.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250627204321.521628-1-michael.j.ruhl@intel.com> References: <20250627204321.521628-1-michael.j.ruhl@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Setting the clear bit or checking the complete bit before checking to see if crashlog is disabled seems incorrect. Check disable before accessing any other bits. Reviewed-by: Ilpo Järvinen Reviewed-by: David E. Box Signed-off-by: Michael J. Ruhl --- drivers/platform/x86/intel/pmt/crashlog.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/intel/pmt/crashlog.c b/drivers/platform/x86/intel/pmt/crashlog.c index c3ca95854aba..440d2045e90d 100644 --- a/drivers/platform/x86/intel/pmt/crashlog.c +++ b/drivers/platform/x86/intel/pmt/crashlog.c @@ -193,6 +193,10 @@ trigger_store(struct device *dev, struct device_attribute *attr, guard(mutex)(&entry->control_mutex); + /* if device is currently disabled, return busy */ + if (pmt_crashlog_disabled(&entry->entry)) + return -EBUSY; + if (!trigger) { pmt_crashlog_set_clear(&entry->entry); return count; @@ -202,10 +206,6 @@ trigger_store(struct device *dev, struct device_attribute *attr, if (pmt_crashlog_complete(&entry->entry)) return -EEXIST; - /* if device is currently disabled, return busy */ - if (pmt_crashlog_disabled(&entry->entry)) - return -EBUSY; - pmt_crashlog_set_execute(&entry->entry); return count; -- 2.49.0