Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4477218imw; Tue, 19 Jul 2022 07:20:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tS+1ObwR/fFo66AVIGY5iz2izlboOg52WuxGKd2CwoBACH44Ehnwz4J0BjfpOuOE91Kz5C X-Received: by 2002:a05:6402:1d50:b0:43a:737c:289c with SMTP id dz16-20020a0564021d5000b0043a737c289cmr43529702edb.47.1658240437949; Tue, 19 Jul 2022 07:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658240437; cv=none; d=google.com; s=arc-20160816; b=Kam7D6aVV5J1Ghtr9qwBTjbR9b3Ms0LWV6hP3Yy/Px+LHTL5XGHNwMBb6rBKfKdCD+ bmmIF5D6uQzLnEACCmBRrLGHAbx9Lr76jp7Fso8PmBe5g/Z7ifEH17edzenKvkRXTfkz LSh3VgZU0oSTaeADYXFtpjX3BLQOFjAByw9Iy1aTiMsKQLyf7BHXr+np+/nG/YPFwplK ADQodaEr+rPZ/uJ49YcVCGzYOmJoVyg4Uh/UQpun4vhemps6WTabru+BI5XLbEdf47ek OSSq8hSL+tuMJwtMzGleQef2ZHqezPpubnLU1YUWqfi1+sfAqzekS0zSfBN8huMn6n7r 6tuA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JF6hITDLylvVQUs+lOIuiAJUDNejvtLDkFFnOIsaB4o=; b=m0H9VlAXeESv3NtoL+pGm7fgJgxlf9yeT0tCmdnFgJPsH2Z3DYTSVHS9X0kzMz2U8R bvhcYZPizAfH+7FnR16PGsEu4j86zck/dC8zckl6iYx0jXv3m1DGe3YLzjmU5UP/+PeS 3hsrKI1Rn8en37TubTiZEY2GsdSexG/226TshFz1dMyyWPouhCAARQIphZloU2bSArjq Qy18KaIWhC4swuOmZSLpSB77RR2zFhLywd74Dkwb+yZ7O+PVTQAfJDl2IInyGvF0Ypct B0bvKHvsfnkecDwFHHLCx2/LKP6k0YLL+Z+UQftALwFUGlDTqfx0fyZL6M1+rRcKQU5z kK3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2ctSLlvW; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q8-20020a056402518800b0043a923324c1si20990170edd.11.2022.07.19.07.20.12; Tue, 19 Jul 2022 07:20:37 -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=@linuxfoundation.org header.s=korg header.b=2ctSLlvW; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243390AbiGSNLj (ORCPT + 99 others); Tue, 19 Jul 2022 09:11:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243256AbiGSNKb (ORCPT ); Tue, 19 Jul 2022 09:10:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 589CB66AE6; Tue, 19 Jul 2022 05:29:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D45AEB81B29; Tue, 19 Jul 2022 12:28:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47A65C341CF; Tue, 19 Jul 2022 12:28:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658233737; bh=R9Q4XuOpLZEJ+9h3KSB3O61IiWX3lDtzEd0A+CAwXhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ctSLlvWQKp1tLb+KRhPV5FwUJzPlhuc6ot1Z7ijPztW54DEcrqfOczcbbZj4BmEP u7dmxBhysMza5YzC09/79wHNdKV1PzRX8Hxy45uPoNGJnRvIqRoIX3mx8gTC23F4kz pV6l836CQBgDVfZ7kp5sNYffRbBhQ4SIWgIf+FUA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mario Limonciello , "Rafael J. Wysocki" , Oleksandr Natalenko Subject: [PATCH 5.18 224/231] ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory Date: Tue, 19 Jul 2022 13:55:09 +0200 Message-Id: <20220719114732.537637737@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114714.247441733@linuxfoundation.org> References: <20220719114714.247441733@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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: Mario Limonciello commit fbd74d16890b9f5d08ea69b5282b123c894f8860 upstream. When commit 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported") was introduced, we found collateral damage that a number of AMD systems that supported CPPC but didn't advertise support in _OSC stopped having a functional amd-pstate driver. The _OSC was only enforced on Intel systems at that time. This was fixed for the MSR based designs by commit 8b356e536e69f ("ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported") but some shared memory based designs also support CPPC but haven't advertised support in the _OSC. Add support for those designs as well by hardcoding the list of systems. Fixes: 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported") Fixes: 8b356e536e69f ("ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported") Link: https://lore.kernel.org/all/3559249.JlDtxWtqDm@natalenko.name/ Cc: 5.18+ # 5.18+ Reported-and-tested-by: Oleksandr Natalenko Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/acpi/cppc.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/arch/x86/kernel/acpi/cppc.c +++ b/arch/x86/kernel/acpi/cppc.c @@ -16,6 +16,12 @@ bool cpc_supported_by_cpu(void) switch (boot_cpu_data.x86_vendor) { case X86_VENDOR_AMD: case X86_VENDOR_HYGON: + if (boot_cpu_data.x86 == 0x19 && ((boot_cpu_data.x86_model <= 0x0f) || + (boot_cpu_data.x86_model >= 0x20 && boot_cpu_data.x86_model <= 0x2f))) + return true; + else if (boot_cpu_data.x86 == 0x17 && + boot_cpu_data.x86_model >= 0x70 && boot_cpu_data.x86_model <= 0x7f) + return true; return boot_cpu_has(X86_FEATURE_CPPC); } return false;