From patchwork Fri Oct 30 06:02:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1390814 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=GSz+KGOO; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CMsDh5qhgz9sTD; Fri, 30 Oct 2020 17:03:16 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1kYNVI-0007vl-1b; Fri, 30 Oct 2020 06:03:12 +0000 Received: from mail-pf1-f195.google.com ([209.85.210.195]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kYNVD-0007hp-6P for kernel-team@lists.ubuntu.com; Fri, 30 Oct 2020 06:03:07 +0000 Received: by mail-pf1-f195.google.com with SMTP id 13so4347284pfy.4 for ; Thu, 29 Oct 2020 23:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dvnwmBYgyoIvrISpKSKNXUGWT6O+UCtaRzQtlHq7w88=; b=GSz+KGOON9LA4w91g8Y5zXyc2aczt6/zRR77I1zqEjDstvh7uC2+WdtKEl6vDm1piS S8Z7HYQTYEFGGxixWI9TSDHPzktFul68H9UYcXHLIfU6d6hgZwN8fy632Od0QfRj1rWr o2VisNyUFi0kgTVrYsZZ0AIt/CH2ZQRw3ZigxWf3l4qjgftxmAoRzZMhWbVgJ8VpeSZB XdZ+7//ltYZxSZp0zzhOnqNEZ8cpwLfaThy5dFHU7aaj6AIW++HlMZptXh+vunu9jCQ8 14qUvFfVgFLeB1bmgVwJZL2AE957WzZLBx3cJFhRLDMn7qFX4mYl8uYwmYtLlXzxi7pH BHlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dvnwmBYgyoIvrISpKSKNXUGWT6O+UCtaRzQtlHq7w88=; b=m2UdfYuEgtlciyI9y0FQk0tOBxgHVh5PJWYGxoCf+By0kSd3dGqwIhgGcs3f0ystUM 1r1feMID7ulaW1FWbJ51xUgAuaoXKEEXqAzJLa1b8EUvxLooejsB/M4kft6VbzubID7f az8ZADzgZVnWWNjbkVsfW1ReN9gVGC3oAFqBjizfqcqKAXC3B/g9CKQto/T+qibdYpwH fn6pXF399N5OvXwxP0Hhhxjsz0eWLZXxA9XvUkebqAgLpmgT+N3rux6PJP1WDrXCgG2F 0Iu9HBkE+GZgLrdi0ZPZ9dNmzDmm8HXJz7c8Fj3NYXt1tqxrXZx6p3xgPq90lsFyXal+ KqfQ== X-Gm-Message-State: AOAM533sDLoLIv/qjjg0WuD68AXegTC2ixSQiyEnk+JoxDQDQFXNLhlJ qfBu9QNohqDZm6PU265CXirMkWnSpj+TdQ== X-Google-Smtp-Source: ABdhPJwHqKQKPKX7iAQ0GQ3L208gkeUN57XMWt2uefFykpdMXcIwI3TRiE8bY6BDn2T5ssuybO4z5w== X-Received: by 2002:a17:90b:3882:: with SMTP id mu2mr930773pjb.112.1604037775667; Thu, 29 Oct 2020 23:02:55 -0700 (PDT) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id r8sm4386541pgl.57.2020.10.29.23.02.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 23:02:55 -0700 (PDT) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 10/23][SRU][OEM-5.6] platform/x86: intel_pmc_core: Dump low power status registers on an S0ix.y failure Date: Fri, 30 Oct 2020 14:02:01 +0800 Message-Id: <20201030060214.780883-16-acelan.kao@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201030060214.780883-1-acelan.kao@canonical.com> References: <20201030060214.780883-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.195; envelope-from=acelan@gmail.com; helo=mail-pf1-f195.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Gayatri Kammela BugLink: https://bugs.launchpad.net/bugs/1899883 Platforms prior to Tiger Lake has no sub-states of S0ix and accessing device PM states that are latched whenever there is a PC10 entry is possible with the help of slp_s0_debug_status and slp_s0_dbg_latch debugfs entries. If a platform has sub-states of S0ix, no such entries are created. Hence, dump low power status registers on resume When any attempt to enter any low power state was unsuccessful. Cc: Srinivas Pandruvada Cc: Andy Shevchenko Cc: David Box Suggested-by: David Box Signed-off-by: Gayatri Kammela Signed-off-by: Andy Shevchenko (cherry picked from commit 2e36ac08a98829b132a9d0bf1ca281af1a931747) Signed-off-by: AceLan Kao --- drivers/platform/x86/intel_pmc_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index 19cd852293ff..20950b3d49fa 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -1285,6 +1285,8 @@ static inline bool pmc_core_is_s0ix_failed(struct pmc_dev *pmcdev) static int pmc_core_resume(struct device *dev) { struct pmc_dev *pmcdev = dev_get_drvdata(dev); + const struct pmc_bit_map **maps = pmcdev->map->lpm_sts; + int offset = pmcdev->map->lpm_status_offset; if (!pmcdev->check_counters) return 0; @@ -1304,6 +1306,8 @@ static int pmc_core_resume(struct device *dev) pmcdev->s0ix_counter); if (pmcdev->map->slps0_dbg_maps) pmc_core_slps0_display(pmcdev, dev, NULL); + if (pmcdev->map->lpm_sts) + pmc_core_lpm_display(pmcdev, dev, NULL, offset, "STATUS", maps); return 0; }