Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5912736rwb; Wed, 7 Sep 2022 09:43:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR6KnAyVzwbhVbFUbEMkXkZcfQdEaNksQZrbXCsSQVRwY5u4cKl2TeAWCCaGWSt1k57GinEX X-Received: by 2002:a05:6402:50cb:b0:440:87d4:3ad2 with SMTP id h11-20020a05640250cb00b0044087d43ad2mr3804345edb.219.1662568989084; Wed, 07 Sep 2022 09:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662568989; cv=none; d=google.com; s=arc-20160816; b=z0tDYqBDZ8H0j0DX2XNFTtS+oXowCt1vOcNKt2ZQW9BjUDJ/IqZUkHxikhhaZJSs2c GbfgCB2UXXdQFUzit2b/Qv8m0nGLqQ3jEg5Ff8yq43DpyPokZlG5I8WEmqpMML11tVWy Ba4MKG2DuBll1wOQPOuiR574nqfHMzbWKb2Zjpp52awQ3jHlj/aceNQ9aV5/FrAscXNe xkmh8bGdzYQWreNLlrjCUElgsPkzR6z3F3GIOe4x32ZtREjyfCNbKF3n9Ahivs7Mpm26 3DfKroy71za4QBY3ru+QRd73opMafws8P+oCdUoAgHJYvdw/BLOFKZWofu15TT7tMD0T /QjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=StSbeLKkQsBW687yXIYnESATFgq2OlrI3HyGiBwcGyI=; b=Rb90cnMEub+nPdELZuKzuEmJOHZLcZiuzu/zGbjphn1TLurvb3LWNaarrP+3O9lJ4L W0qm6QyRTSfvSjgS5FM2pf3m/mEwWs9n5f7OiSnODxTKOC21o++xDkiJlQD8VHSfgqOC L7RpXnE96h59Omd5jl3DB8O5ILWHjCFDxB7vm0uhNX4ME3Ul95/po2uyu7NDGmnJWfVM vQW+vJ3s0IAZsZbHXWsSAkmhkkYF0mQrG3Ef0LJ2uxcmGQDj6f575EPkiRD3BRHcLz5n ftvug7Fbr0LZZXi8IEME/AtWAAV8PRIlx9yxY/LqEVf5vdGgizumdGN4RhGByBMbcKZj qsWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=e3QKD24O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t9-20020aa7d709000000b0044ec6cf0f93si4088877edq.577.2022.09.07.09.42.44; Wed, 07 Sep 2022 09:43:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=e3QKD24O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbiIGQBU (ORCPT + 99 others); Wed, 7 Sep 2022 12:01:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbiIGQAe (ORCPT ); Wed, 7 Sep 2022 12:00:34 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F18F9413A for ; Wed, 7 Sep 2022 09:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662566404; x=1694102404; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ctTJMUTnAD3HTjtYrfTyMDMJuY75ucboxfaHNzv14NA=; b=e3QKD24OYT3rz+uoeP+64t9sFtKJFqhy4dD+tHL5F1f9X9jlLbfkOxWn vItiGmYCb6piFq0eBgxaBzKzw1DIcoXZphh6SkyPVhw0co/kE1NjoA1AI jUN4dDetNBtXFRJUXz4X/6mjKe/dOsZHg9tDU4x9sHpDYrGbNEiD2u6Zb +haq2OuNBOAZ5C9lcr1jMzRGBT+BoP11YjbHlousM0di3loQFUGiqQ2td 6/dlI91N1xGqxAzIooUPZlHlPXTJTUfi4Cc7ZEvkr5wfN/meh/9QQzGqi b41OUujniMHS0QnGzUYc0zuXDPC+VM/R3Cz3aYyUVa2BhSugy183sBqmw Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10463"; a="297701606" X-IronPort-AV: E=Sophos;i="5.93,297,1654585200"; d="scan'208";a="297701606" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 08:59:38 -0700 X-IronPort-AV: E=Sophos;i="5.93,297,1654585200"; d="scan'208";a="676248239" Received: from twinkler-lnx.jer.intel.com ([10.12.87.143]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 08:59:34 -0700 From: Tomas Winkler To: Greg Kroah-Hartman , David Airlie , Daniel Vetter Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomas Winkler , Alexander Usyskin , Vitaly Lubart Subject: [PATCH v8 14/16] mei: debugfs: add pxp mode to devstate in debugfs Date: Wed, 7 Sep 2022 18:58:11 +0300 Message-Id: <20220907155813.1427526-15-tomas.winkler@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907155813.1427526-1-tomas.winkler@intel.com> References: <20220907155813.1427526-1-tomas.winkler@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add pxp mode devstate to debugfs to monitor pxp state machine progress. This is useful to debug issues in scenarios in which the pxp state needs to be re-initialized, like during power transitions such as suspend/resume. With this debugfs the state could be monitored to ensure that pxp is in the ready state. CC: Vitaly Lubart Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/debugfs.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c index 1ce61e9e24fc..3b098d4c8e3d 100644 --- a/drivers/misc/mei/debugfs.c +++ b/drivers/misc/mei/debugfs.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright (c) 2012-2016, Intel Corporation. All rights reserved + * Copyright (c) 2012-2022, Intel Corporation. All rights reserved * Intel Management Engine Interface (Intel MEI) Linux driver */ @@ -86,6 +86,20 @@ static int mei_dbgfs_active_show(struct seq_file *m, void *unused) } DEFINE_SHOW_ATTRIBUTE(mei_dbgfs_active); +static const char *mei_dev_pxp_mode_str(enum mei_dev_pxp_mode state) +{ +#define MEI_PXP_MODE(state) case MEI_DEV_PXP_##state: return #state + switch (state) { + MEI_PXP_MODE(DEFAULT); + MEI_PXP_MODE(INIT); + MEI_PXP_MODE(SETUP); + MEI_PXP_MODE(READY); + default: + return "unknown"; + } +#undef MEI_PXP_MODE +} + static int mei_dbgfs_devstate_show(struct seq_file *m, void *unused) { struct mei_device *dev = m->private; @@ -112,6 +126,9 @@ static int mei_dbgfs_devstate_show(struct seq_file *m, void *unused) seq_printf(m, "pg: %s, %s\n", mei_pg_is_enabled(dev) ? "ENABLED" : "DISABLED", mei_pg_state_str(mei_pg_state(dev))); + + seq_printf(m, "pxp: %s\n", mei_dev_pxp_mode_str(dev->pxp_mode)); + return 0; } DEFINE_SHOW_ATTRIBUTE(mei_dbgfs_devstate); -- 2.37.2