Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4155489pxb; Mon, 21 Feb 2022 13:30:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcPwEdCjxMim0JWZ4fHHla591QUEk77WSZkfN5eJhPdsIJgHEVyEDcaDdVJ5kb7/4XkYs5 X-Received: by 2002:a17:906:d205:b0:6d1:4446:d950 with SMTP id w5-20020a170906d20500b006d14446d950mr6422526ejz.702.1645479024270; Mon, 21 Feb 2022 13:30:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645479024; cv=none; d=google.com; s=arc-20160816; b=pEKx8ztJDss5pRFFGA3UGPNdISqdKTZ5glMq7YXcGvghs+uc1oSYNK61lOQ0BBx/hh U+BJzT61tCISFy3Xp3yh/syi7/FqaOEJhEL5K4DNSkUs2e10grYGmGv040Gboan1jMqI mDBXLXIZrXPuKxy0oAO/LBZI7Jsg34eHfeeymbi3b6psPZKvzkmGwGJCDBy3iWTpYxMz 9IKeneC+wweXfc27bV5MFSwyNIp2Zx8uNQfL/kLR2W/RgFPbr0bqg0XsWake4DReklF0 qgFABfJf/rS5+R+LQQMzzYkSe+CmTy10d2eJc7PIScHH/NyuOZuYOgInrA/hVsbmi/jn LpWQ== 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=Nk44IUpwLSNqXlgekINMQlW3zEmMa3twn3BCMp8oZsc=; b=jFr90LBfpCcorAwU2bwCoCFUVnkKrZ1m/wVI99IOh10PE9DAupvmDh3uLlDPnhCJa+ P/y3HfrKCc4MrSABswggC4VMIGJYkyTpQRajqhUclXwB7/thiBUOdtZKTLEkxBlC5pu4 ySc9XHTVquWJf+cp8Ss9xwqVFx4rFYoTIRyuhDb+ESFMlzvcWbVUFuBWm8QnqwxCfp8Z CiTEjSgCNPHtMdttOiCUWCR7ioIZqqp7L51jKEk3N7c1dZkmTA2mYJqvKQLyrGDndvj0 WyL899JRci1T2TgSY6W9J1k5IhQrBrD5Xb+kprmrJk/WrV/60lJLVBiPvrPmXuuNIjqn pHgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cSEuEkop; 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 jj8si8564181ejc.577.2022.02.21.13.30.01; Mon, 21 Feb 2022 13:30:24 -0800 (PST) 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=cSEuEkop; 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 S238124AbiBUJth (ORCPT + 99 others); Mon, 21 Feb 2022 04:49:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351132AbiBUJmo (ORCPT ); Mon, 21 Feb 2022 04:42:44 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 399173335D; Mon, 21 Feb 2022 01:17:54 -0800 (PST) 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 sin.source.kernel.org (Postfix) with ESMTPS id BA8FACE0E76; Mon, 21 Feb 2022 09:17:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0F23C340E9; Mon, 21 Feb 2022 09:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645435072; bh=4/ma2ZF00qjEG7nCuaP9vuHb1u63RSWI+qRUAE66LXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cSEuEkopwUyEc/hjqx45yS8KXP2ZN1hZpZlw5y0npiU1ihxVeoO8lm7sIOKjfQcFn vwyuePXwxk0SB+/QZcmwtSTURG1yGep5V3jNu+gNmL/YEjCEdzgJ20xY3wEi5IcKLm H0TBzVEp3j+/EldYZW283w8muTspKEHH6Qa0tkek= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mario Limonciello , Hans de Goede , Sasha Levin Subject: [PATCH 5.16 034/227] platform/x86: amd-pmc: Correct usage of SMU version Date: Mon, 21 Feb 2022 09:47:33 +0100 Message-Id: <20220221084935.996720783@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084934.836145070@linuxfoundation.org> References: <20220221084934.836145070@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.1 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,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: Mario Limonciello [ Upstream commit b8fb0d9b47660ddb8a8256412784aad7cee9f21a ] Yellow carp has been outputting versions like `1093.24.0`, but this is supposed to be 69.24.0. That is the MSB is being interpreted incorrectly. The MSB is not part of the major version, but has generally been treated that way thus far. It's actually the program, and used to distinguish between two programs from a similar family but different codebase. Link: https://patchwork.freedesktop.org/patch/469993/ Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220120174439.12770-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Sasha Levin --- drivers/platform/x86/amd-pmc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c index 230593ae5d6de..8c74733530e3d 100644 --- a/drivers/platform/x86/amd-pmc.c +++ b/drivers/platform/x86/amd-pmc.c @@ -117,9 +117,10 @@ struct amd_pmc_dev { u32 cpu_id; u32 active_ips; /* SMU version information */ - u16 major; - u16 minor; - u16 rev; + u8 smu_program; + u8 major; + u8 minor; + u8 rev; struct device *dev; struct mutex lock; /* generic mutex lock */ #if IS_ENABLED(CONFIG_DEBUG_FS) @@ -166,11 +167,13 @@ static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev) if (rc) return rc; - dev->major = (val >> 16) & GENMASK(15, 0); + dev->smu_program = (val >> 24) & GENMASK(7, 0); + dev->major = (val >> 16) & GENMASK(7, 0); dev->minor = (val >> 8) & GENMASK(7, 0); dev->rev = (val >> 0) & GENMASK(7, 0); - dev_dbg(dev->dev, "SMU version is %u.%u.%u\n", dev->major, dev->minor, dev->rev); + dev_dbg(dev->dev, "SMU program %u version is %u.%u.%u\n", + dev->smu_program, dev->major, dev->minor, dev->rev); return 0; } -- 2.34.1