From patchwork Wed Nov 24 16:03:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 12637129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25621C433F5 for ; Wed, 24 Nov 2021 16:03:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231804AbhKXQGg (ORCPT ); Wed, 24 Nov 2021 11:06:36 -0500 Received: from mail-sn1anam02on2061.outbound.protection.outlook.com ([40.107.96.61]:10431 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229961AbhKXQGf (ORCPT ); Wed, 24 Nov 2021 11:06:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YR+z47ubrz4vyMcHV3y/0yUB4AEu5C0Coxux9BgSW81e0PQjP5AUe7bYJPzNt3PRKgPKa1qlk2hMlrLHfmU1mUNQKf0Bz+jHG/gC5A49oT9Eec6LLSB0M0N/0U3KS18UhVTCrHPJk09ZnZH1mYkfdouFpS3uQ1iL0cEwnbIuFmsQTGzK24UXMskEjOEUaE1/4fJcgMDJHwaeinae2VIptyV5tAxxsyumg5yycw/NMsQ2gQVhybYz1aSFn/mCDIUB9Dk6RqyN+SlPrPD3dPLFcZ1fWRQD+Zbrdj4UlqyP2Fr4B8QOq7fbxeUeBy8iAVVeGazklVqL7qvrRIsQkjvXNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nBHftbLvocSey+dJXNRqAy1saukbwhnpvwoNajaaePo=; b=GlYqvWxzK8EQMQBqaHNx6ccI46QGbvYUCdkpaJexrmxCgAfrSAde2x1Buh71mPXUkMdFdvuFt12YZwLA4Be6zkbPxxGX4g8rIZeirz8jy/f4SbuC+Zi4UGqFmiUMz1QqnhyhyMakuHxcKi5huUZO8hwD6rggmpBqg8i0X3Q0ooYsKU7YBKA5hXTXflZoAHFvqe5/4DHesLN38frV8ozUivBXsGKbZyDQ6nqgNNxKGRLKPvEilhJahdwiDidw4NiIBtbLgDI7xMW8sQ9avUw67AA1QzKFJP9/7cxrP/FOHDbpb0A0jQzINp75FRfurYveBb5eCkjU55zeOoppsuo2Yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nBHftbLvocSey+dJXNRqAy1saukbwhnpvwoNajaaePo=; b=brN6sGytj4dWRrr/BNBjTOD+KvBvXqRihMDn6m+b10bjNNe/m5n63wCwqB30vD5zTnO7wrqbq7KrjHEpd8KJuFlc0vFO8kIyLDj0qL8KAXuWHaDqiSOWyomm+wL6PRh5UtoiuZxoUajLD2q+Rc2jv6DaQ+ubHhdVwEcIfXwU550= Received: from BN0PR10CA0007.namprd10.prod.outlook.com (2603:10b6:408:143::25) by DM5PR12MB1402.namprd12.prod.outlook.com (2603:10b6:3:73::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22; Wed, 24 Nov 2021 16:03:23 +0000 Received: from BN8NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::d9) by BN0PR10CA0007.outlook.office365.com (2603:10b6:408:143::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.24 via Frontend Transport; Wed, 24 Nov 2021 16:03:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT037.mail.protection.outlook.com (10.13.177.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4713.20 via Frontend Transport; Wed, 24 Nov 2021 16:03:23 +0000 Received: from [127.0.1.1] (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 24 Nov 2021 10:03:14 -0600 Subject: [PATCH v2] hwmon: (k10temp) Support up to 12 CCDs on AMD Family of processors From: Babu Moger To: , , CC: , Date: Wed, 24 Nov 2021 10:03:13 -0600 Message-ID: <163776976762.904164.5618896687524494215.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d9b7ddaf-e7dc-4467-8ad1-08d9af63f13e X-MS-TrafficTypeDiagnostic: DM5PR12MB1402: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassif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.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(7916004)(4636009)(36840700001)(46966006)(70586007)(70206006)(44832011)(33716001)(36860700001)(4326008)(186003)(5660300002)(9686003)(508600001)(356005)(81166007)(83380400001)(966005)(16526019)(8936002)(47076005)(26005)(103116003)(426003)(8676002)(336012)(82310400004)(110136005)(54906003)(2906002)(86362001)(316002)(16576012)(71626007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2021 16:03:23.3247 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9b7ddaf-e7dc-4467-8ad1-08d9af63f13e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1402 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org The current driver can read the temperatures from upto 8 CCDs (Core-Complex Die). The newer AMD Family 19h Models 10h-1Fh and A0h-AFh can support up to 12 CCDs. Update the driver to read up to 12 CCDs. Signed-off-by: Babu Moger --- v2: Removed the date structure changes based on comment from Guenter. v1: https://lore.kernel.org/lkml/163770219414.777059.5794961910830381329.stgit@bmoger-ubuntu/ drivers/hwmon/k10temp.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c index 880990fa4795..4e239bd75b1d 100644 --- a/drivers/hwmon/k10temp.c +++ b/drivers/hwmon/k10temp.c @@ -171,6 +171,10 @@ static const char *k10temp_temp_label[] = { "Tccd6", "Tccd7", "Tccd8", + "Tccd9", + "Tccd10", + "Tccd11", + "Tccd12", }; static int k10temp_read_labels(struct device *dev, @@ -206,7 +210,7 @@ static int k10temp_read_temp(struct device *dev, u32 attr, int channel, if (*val < 0) *val = 0; break; - case 2 ... 9: /* Tccd{1-8} */ + case 2 ... 13: /* Tccd{1-12} */ amd_smn_read(amd_pci_dev_to_node_id(data->pdev), ZEN_CCD_TEMP(data->ccd_offset, channel - 2), ®val); @@ -341,6 +345,10 @@ static const struct hwmon_channel_info *k10temp_info[] = { HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL), NULL }; @@ -433,12 +441,15 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id) data->ccd_offset = 0x154; k10temp_get_ccd_support(pdev, data, 8); break; - case 0x10 ... 0x1f: case 0x40 ... 0x4f: /* Yellow Carp */ - case 0xa0 ... 0xaf: data->ccd_offset = 0x300; k10temp_get_ccd_support(pdev, data, 8); break; + case 0x10 ... 0x1f: + case 0xa0 ... 0xaf: + data->ccd_offset = 0x300; + k10temp_get_ccd_support(pdev, data, 12); + break; } } else { data->read_htcreg = read_htcreg_pci;