Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp865402iog; Wed, 29 Jun 2022 11:46:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tl+WKcX5eQ1LFrKqU+hMMOOSi74C+EMlN5aXqU0hMD2euUw5Y6U5R/6gaSVIuH1Og2KAmW X-Received: by 2002:a63:b00e:0:b0:40c:c685:d45 with SMTP id h14-20020a63b00e000000b0040cc6850d45mr4081652pgf.494.1656528361074; Wed, 29 Jun 2022 11:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656528361; cv=none; d=google.com; s=arc-20160816; b=CP7zOzfrFoqzXBhpW7hoLZWUW5CHUhG4y+JGJcxQ/Q+Hk68ghni4ZIp+IhQQ4x67C0 T1VCI40iZbpNC6ABc7NhOnBewvoyO+RCVlHCDw8X605r7Y/aw0f+IOrkV33sI9rko9si V/2W5I9s/0p4H4a29zckmTwxg0HEclpEWYTk3bmQe/pWcadgc2Rwi/PBn+AGXDRyHWgf upwAEsrfCClX3ng6gyTn1zlwvuZGQVs7RdobPlE5aA1JGvwuYrqaNxrNp6PYksZx84cg 5RJJOyaWp8OX0x9UQiXYDJHX7vSoq792V8JH/NyFo6olkvjy91k+ZOQNodGUNlr+2aRc tL3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=niDepKniCB5d3I07y4zpYfnckX8GQNMPL/217Nk44uM=; b=kpDsm8S3W5W5mNw2EkMFMJjMLi8uTbAl0ByjN3Dcyk9CIl8gdsDAUnFAjGRhKmOedd FhyU3pt1bryHZWZAWG/uyYM0itjwdWgv/59XI6NH5hg80+yesIHoUEPsaIQTuRbzCu+d 23dKBswV9E91Vx7aOKnvjUaxLZcRQ8wBeMewR23qv5wPSG9kbVpG9pta/nUvLeTseuZo MEpxrHWgSTSSIRqCjhAi8BR9EDF7ayzH3r+dbQu2GyndNCbFhU7Xe0WOwNLs749j1/MU LdOFmypE8/MacWBT97aQoDig5/5CfAhMhrQaoNYPa6bg6Q45TdEKOvnLOZvYhCCOqDas TQTA== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a170902b78900b0016a39d0b2fbsi20131566pls.323.2022.06.29.11.45.40; Wed, 29 Jun 2022 11:46:01 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbiF2SmI (ORCPT + 99 others); Wed, 29 Jun 2022 14:42:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbiF2SmG (ORCPT ); Wed, 29 Jun 2022 14:42:06 -0400 Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8A9D29827; Wed, 29 Jun 2022 11:42:04 -0700 (PDT) Received: by mail-yb1-f169.google.com with SMTP id d5so29545964yba.5; Wed, 29 Jun 2022 11:42:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=niDepKniCB5d3I07y4zpYfnckX8GQNMPL/217Nk44uM=; b=364Lo2zzksxZUBSXzgrA+UfG7auHtNmoAZcSnFq8vTie+mrlVHVOEYS6DLv3zkRk3R 1wstW/FG9jnhBZlhibDelgcvyqCRPO8KQ0KKEEpkW7bnDHxsP3s8jnUF0JU88JkB7z6B TCDM0Fh4RYYlbXPJHQ+LPSaok8H6OGmDo/ZMJ+bNCz1vyEfWSHuvclQrrVWPs+5uwBy+ mgtRcd0CU7SEjaT3MHShhiq6rJqHnth8kv/tvdgUbFLx6s62pzHtLrTNCjzxiJp4Eino dikTAlfY/riGRTRPYfNXqhXd/ZuJnSaKlLIP4HLWkRt5+j/6fejwWkX4Kl1vx0H5wvlP nw1g== X-Gm-Message-State: AJIora8UNbTa4dp76VvM3MYGq7h+oFhitZkgjJQgRAWwcAeI2yQ8S35j r803I0KPIS/psry5R9lPOuPIFpCCJ0JOwz/tVPoH5yMD X-Received: by 2002:a25:5d8:0:b0:66c:dbd1:b2bb with SMTP id 207-20020a2505d8000000b0066cdbd1b2bbmr4996934ybf.81.1656528124098; Wed, 29 Jun 2022 11:42:04 -0700 (PDT) MIME-Version: 1.0 References: <20220627165832.10246-1-mario.limonciello@amd.com> In-Reply-To: <20220627165832.10246-1-mario.limonciello@amd.com> From: "Rafael J. Wysocki" Date: Wed, 29 Jun 2022 20:41:53 +0200 Message-ID: Subject: Re: [PATCH] ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported To: Mario Limonciello Cc: "Rafael J. Wysocki" , Len Brown , Pierre Gondois , Sudeep Holla , Perry Yuan , ACPI Devel Maling List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 On Mon, Jun 27, 2022 at 6:58 PM Mario Limonciello wrote: > > commit 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and > when CPPC_LIB is supported") added support for claiming to > support CPPC in _OSC on non-Intel platforms. > > This unfortunately caused a regression on a vartiety of AMD > platforms in the field because a number of AMD platforms don't set > the `_OSC` bit 5 or 6 to indicate CPPC or CPPC v2 support. > > As these AMD platforms already claim CPPC support via `X86_FEATURE_CPPC`, > use this enable this feature rather than requiring the `_OSC`. > > Fixes: 72f2ecb7ece7 ("Set CPPC _OSC bits for all and when CPPC_LIB is supported") > Reported-by: Perry Yuan > Signed-off-by: Mario Limonciello > --- > drivers/acpi/cppc_acpi.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c > index 903528f7e187..5463e6309b9a 100644 > --- a/drivers/acpi/cppc_acpi.c > +++ b/drivers/acpi/cppc_acpi.c > @@ -629,6 +629,15 @@ static bool is_cppc_supported(int revision, int num_ent) > return false; > } > > + if (osc_sb_cppc_not_supported) { > + pr_debug("Firmware missing _OSC support\n"); > +#ifdef CONFIG_X86 > + return boot_cpu_has(X86_FEATURE_CPPC); > +#else > + return false; > +#endif What about doing if (osc_sb_cppc_not_supported) { pr_debug("Firmware missing _OSC support\n"); return IS_ENABLED(CONFIG_X86) && boot_cpu_has(X86_FEATURE_CPPC); } instead for the sake of reducing #ifdeffery? Also, this is somewhat risky, because even if the given processor has X86_FEATURE_CPPC set, the platform may still not want to expose CPPC through ACPI. How's that going to work after this change? > + } > + > return true; > } > > @@ -684,9 +693,6 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) > acpi_status status; > int ret = -ENODATA; > > - if (osc_sb_cppc_not_supported) > - return -ENODEV; > - > /* Parse the ACPI _CPC table for this CPU. */ > status = acpi_evaluate_object_typed(handle, "_CPC", NULL, &output, > ACPI_TYPE_PACKAGE); > -- > 2.34.1 >