From patchwork Fri Oct 21 06:33:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1692867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mtvnd1X2xz1ygT for ; Fri, 21 Oct 2022 17:34:11 +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 1ollbU-0003YD-Im; Fri, 21 Oct 2022 06:34:00 +0000 Received: from mail-pl1-f173.google.com ([209.85.214.173]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ollbQ-0003XP-LM for kernel-team@lists.ubuntu.com; Fri, 21 Oct 2022 06:33:56 +0000 Received: by mail-pl1-f173.google.com with SMTP id 10so1539320pli.0 for ; Thu, 20 Oct 2022 23:33:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WwpvT5dnvr6ME7UOHKOgCDGAEGZCi7ea46/K7Nbeg28=; b=DpV9sIsx6HL0SwPq3654UTVTOHe2M7EGBzzdXTZNpavjrXDcnWgBudNGM4sGVhmLqt WNefJhrqae2B5DIU+muyjVxkm6fau7rEJ+Z1zyVvFOFwfjdQqWyolGQVM4xDbp44eJps jVMW1+sUw6QM5uRMyTDCF2EZ+DPTlayrUdArmArEMSD441eY1g+h1J478m2xCih9FUWE ahud7Ckg5nyj01kgfTN+C6y9n/7JH0O7Uh/xjDoRnlKbriM2/rwrSCnAp5guOKPzOhg3 H9GGXq2O4F1knUBdX7zAAC/9hsgDNITqcxbA759tc8/91qj+ifedc1qikn+5gsIW4+BS vSjQ== X-Gm-Message-State: ACrzQf0O6aRE4i9DP+6tjD2oUPRGa06ZYaYQ5zKHNruINbbPlYTaob7v a3QUujZ4OfISYJP5NOERFdwMGy+ypQ7ncQ== X-Google-Smtp-Source: AMsMyM7eegBReq78qcQPM2a8QDeQXQ8+6rjBlmd8EpAFLx1jCNEHv5lVeZouLNWJheW/2C/fEAWckw== X-Received: by 2002:a17:902:8c92:b0:178:29d4:600f with SMTP id t18-20020a1709028c9200b0017829d4600fmr18119177plo.40.1666334034553; Thu, 20 Oct 2022 23:33:54 -0700 (PDT) Received: from yewun.. (61-227-97-250.dynamic-ip.hinet.net. [61.227.97.250]) by smtp.gmail.com with ESMTPSA id m4-20020a170902f64400b00176b84eb29asm13730242plg.301.2022.10.20.23.33.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 23:33:53 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][SRU][Unstable/OEM-6.0] UBUNTU: SAUCE: platform/x86/amd: pmc: Read SMU version during suspend on Cezanne systems Date: Fri, 21 Oct 2022 14:33:48 +0800 Message-Id: <20221021063348.3340028-3-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221021063348.3340028-1-vicamo.yang@canonical.com> References: <20221021063348.3340028-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.173; envelope-from=vicamo@gmail.com; helo=mail-pl1-f173.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: Mario Limonciello BugLink: https://bugs.launchpad.net/bugs/1993715 commit b0c07116c8943 ("platform/x86: amd-pmc: Avoid reading SMU version at probe time") adjusted the behavior for amd-pmc to avoid reading the SMU version at startup but rather on first use to improve boot time. However the SMU version is also used to decide whether to place a timer based wakeup in the OS_HINT message. If the idlemask hasn't been read before this message was sent then the SMU version will not have been cached. Ensure the SMU version has been read before deciding whether or not to run this codepath. Cc: stable@vger.kernel.org # 6.0 Reported-by: You-Sheng Yang Tested-by: Anson Tsao Fixes: b0c07116c8943 ("platform/x86: amd-pmc: Avoid reading SMU version at probe time") Signed-off-by: Mario Limonciello (cherry-picked from https://lore.kernel.org/all/20221020113749.6621-1-mario.limonciello@amd.com/) Signed-off-by: You-Sheng Yang (vicamo) --- drivers/platform/x86/amd/pmc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/platform/x86/amd/pmc.c b/drivers/platform/x86/amd/pmc.c index ce859b300712..96e790e639a2 100644 --- a/drivers/platform/x86/amd/pmc.c +++ b/drivers/platform/x86/amd/pmc.c @@ -663,6 +663,13 @@ static int amd_pmc_verify_czn_rtc(struct amd_pmc_dev *pdev, u32 *arg) struct rtc_time tm; int rc; + /* we haven't yet read SMU version */ + if (!pdev->major) { + rc = amd_pmc_get_smu_version(pdev); + if (rc) + return rc; + } + if (pdev->major < 64 || (pdev->major == 64 && pdev->minor < 53)) return 0;