Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2360420imw; Wed, 6 Jul 2022 04:47:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sweEWnq/qp4dHh+EEUH9UnAeOe234OTPuLGdfvYEkYfZQH/NLi1y60bYftePXVt75Eq3TZ X-Received: by 2002:a17:907:2808:b0:72a:822e:b80e with SMTP id eb8-20020a170907280800b0072a822eb80emr29136779ejc.256.1657108077033; Wed, 06 Jul 2022 04:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657108077; cv=none; d=google.com; s=arc-20160816; b=Hr+veNZxw9xUcXXNZMYSBb+rBxmOIl5kj4jH1B3t1c8JkUFXPVVHR9qC/gdrkYglDP QsJ29Ht4A7KeWRkpNsiBPUy7+cusYJk9D2M37Jd/C3yOKCoefR7FcHz+b8aHieIoTuCt 6XGpjMfHOcF1JdE2JevSNp6UpC81JIEr70vGqyuL39qO6CFbKqAEVf7copBF0Mx+AF5I g9aqFYqXBF00VvvUw58+hYPM1n9bcZrqz2UEUWiNruVvR6tDSZ7YHVT5PT/x5cffirs9 4GIbwd6F0Dn4QX36Q8TCztrU7yknEn01XDcF6/oc6S8N/rNOCQmVVCAIQliN/XUxqGML Wvwg== 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=j0zfUG4uZDP5zmvhj9i/oF7yGUFLDpxVN38fSs5Xyb0=; b=GTtBqmv1X/qTYk0+GJcISp7xfj9qrtR5Yz0nJsjY0tBr8lorahDOMqR7+Q4Gttr4xJ 4+jC91/rLdWF7yE+cBcu1Bn5wibG4QSEsfIy6Btri6XxGusQQb4aZh3YN8Z+vyDY7RyZ hcdoPioyhq4Qroasl+/9ef1V2SsZCQ/45nEc/agywm/mD1zkqa6z+ey5F2uOwPzOXIa7 zjH5iqtAOZ3mG4+4te+g2S1qMD0teOuPDNZYY0f5P2n8TE5QFPre4xlgpCRgjSB+vPj+ FA/yheoPXV9kt+mSzqpAYufzVDGEVqGSAsuQw3CVHIqBCGfxw9gSN6WP4EB6yRAH2Bqr 5/YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BWKFRXEH; 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 s4-20020a17090699c400b0072ae04fe6c9si4268442ejn.246.2022.07.06.04.47.31; Wed, 06 Jul 2022 04:47:57 -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=BWKFRXEH; 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 S233112AbiGFLpZ (ORCPT + 99 others); Wed, 6 Jul 2022 07:45:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233252AbiGFLoo (ORCPT ); Wed, 6 Jul 2022 07:44:44 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93428286DF for ; Wed, 6 Jul 2022 04:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657107878; x=1688643878; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bcNuYR0ON77X4etBFhJ68qoXGVrYaYDrSU1eNp2bRz4=; b=BWKFRXEHycsQjC8A1y2Mv3WTLxPogQNKxFDTQeXPCkUk0whX1DzVu23R 5MPl01TIAxDaxgj9Eq1/z5POQwvRSGDV+H6fZW03mcGQGPpnPeRsG3JCf e58IcSnloTH+gJu2hF68uVkdanUkYylntgqdg2V3680TnFCFbgub+pe9r cBhJa/pBEWxGaamW6vAPXOfTTCPkBBZJ0ltUJRKrPGYEb6MLeTEtlxtKr /UPU1P/+XruWiK7fTZmNZr9BLeTbfLG5r+l+WO9ZnkCbK4hmx0KnpWBNL yjJk9gYRf/2f1Yy2voulgzPAAXLqaoVI9m/DIpnkaYBbiE+F2+zNTKD7p Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10399"; a="347707574" X-IronPort-AV: E=Sophos;i="5.92,249,1650956400"; d="scan'208";a="347707574" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2022 04:44:38 -0700 X-IronPort-AV: E=Sophos;i="5.92,249,1650956400"; d="scan'208";a="650630287" Received: from sannilnx.jer.intel.com ([10.12.26.175]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2022 04:44:35 -0700 From: Alexander Usyskin To: Greg Kroah-Hartman , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Tvrtko Ursulin Cc: Tomas Winkler , Alexander Usyskin , Vitaly Lubart , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 12/14] mei: debugfs: add pxp mode to devstate in debugfs Date: Wed, 6 Jul 2022 14:43:43 +0300 Message-Id: <20220706114345.1128018-13-alexander.usyskin@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220706114345.1128018-1-alexander.usyskin@intel.com> References: <20220706114345.1128018-1-alexander.usyskin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 From: Tomas Winkler 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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c index 1ce61e9e24fc..4074fec866a6 100644 --- a/drivers/misc/mei/debugfs.c +++ b/drivers/misc/mei/debugfs.c @@ -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.34.1