From patchwork Tue Nov 23 21:16:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 12635473 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 84D09C433EF for ; Tue, 23 Nov 2021 21:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240373AbhKWVTp (ORCPT ); Tue, 23 Nov 2021 16:19:45 -0500 Received: from mail-dm6nam10on2045.outbound.protection.outlook.com ([40.107.93.45]:19297 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239630AbhKWVTo (ORCPT ); Tue, 23 Nov 2021 16:19:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fSWe8+a/qwU5zFlTbHLnM5LV5huFn29z6Wi8C/OThCRLsDsL7MrNRnBpC9QchLKpgUVPMrYHs/6Rl2Gvmcxx4JfDVxXvtsACoaICpdPCmBKQ0t06kMaGN28V1CY/7wjeGw7KrirbkzQ2YfiSS1gufJyQEVGpK3vDgLNTefzFIW1Cl3oZH7Et6of8lmNU3Rh86BalGjoSWZWf4dRbD8c6sTyUZT9dzQ279Bnen+SNb2qqhVpAbMkArJpqS7fIpokRpFv1MNMkZm3WEx6FEJZF9Fj4/lJMPFADYY+TQuDEdhYRga707oweWHmNjczyv4QsM4GeTofgbZ6VSOjVHV/Opw== 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=8QmYMef9ORmx30J6vdBxzucnHFXl4ltdHRVZgaOCwn4=; b=SErt38AaeyGY6UHxl+Vdv1iSvU38KCGBMEnnPPsImKw0+V1SDXXzTklyZjISAecYCxBBS08fcGFqoKjQuMpWRb2V478eIOsVeF4IOAjFd/jLF0PCAlJkqmluUCRjGZMnqVkrIzCgf42Auaz/GXTJcuECtDUTf/IOE6K0mdIOiwcI2j9kKrs0oEmRzRNGKGSJY46lE8e9L0JJT4569hSWkNVaWjXUMV0wWUNsOwwBtB0ZUWMF57JUN5Lmjyc/mEtY9X3t+CYVVplmFwx3jR31zV0YuZVt8VCoNRl4Pr+fQbOx2Crkou/fanNU3BUQWmb68RjBqKsmWgplCm65/JtZcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com 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=8QmYMef9ORmx30J6vdBxzucnHFXl4ltdHRVZgaOCwn4=; b=zdsxMQyNNwjGbRUIoB2BUjFkTaqpRsdNLLQmdq/6AwzLAB5dnJzBNgu166G+SCjittp9bTy8K0utHzsLu3VJC2iglAHpXBELxNUichd7jfmQNt4dsQTBAYmkhEv26eZS+9xYcsqG9w1jTlftsZ5vbGAM9hy6zDdpYnNfM6RIJk4= Received: from BN0PR04CA0022.namprd04.prod.outlook.com (2603:10b6:408:ee::27) by MN2PR12MB3390.namprd12.prod.outlook.com (2603:10b6:208:c9::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22; Tue, 23 Nov 2021 21:16:32 +0000 Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ee:cafe::7f) by BN0PR04CA0022.outlook.office365.com (2603:10b6:408:ee::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.19 via Frontend Transport; Tue, 23 Nov 2021 21:16:32 +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 BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4713.20 via Frontend Transport; Tue, 23 Nov 2021 21:16:30 +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; Tue, 23 Nov 2021 15:16:28 -0600 Subject: [PATCH 1/2] hwmon: (k10temp) Move the CCD limit info inside k10temp_data structure From: Babu Moger To: , , CC: , Date: Tue, 23 Nov 2021 15:16:28 -0600 Message-ID: <163770216907.777059.6947726637265961161.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 856ad192-4615-4571-1c35-08d9aec68526 X-MS-TrafficTypeDiagnostic: MN2PR12MB3390: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BSS4mEsty6NHWENqETU9U0dfYO9/ik2GY0USuq9Eu/A4QUZjw/YNeNm3sVdHwkHaNbaGAKuKMmx95nyaxCNtHjl0077djG6TT9yJ30CXbEH9p7CreNfyT3M7/mbvufaH7uiXpAlIZ3noYf7bJ28unsKlDx5EpNiA9ofHV9NJ8N3g6ezfiUWJEHHm2K88rc5b9qy8UL/Hb6NSN/D9njrZD89FeGbmebHySx029JQZzJrIhXP/4RDp4Gla/lhAwcJTJX+5cp2fIVvHYcwyoKK6umAunCeejzHCTt0SB5uD37fEUHSuIZ2MCeQcTFKLAtnTl6HyxRHDfqQLydn1fokLhSm9+qzFviV/UYMBCGlmNjSrSPxgNd8RdQCO82W7JP+Az0gTVAu4r/c/kNKHnZGXtNq3WhrObPooZ4k3GF0mfgLWzlDCv610QvpFWDg3fWmb+sulDuLqvjXpuEiok9w6XnZmm91kdREtXHz/fPfnm+g/H6KRNIqE5yQPQLjljCEQ9UGhuaUNNOELd3lZzeqhYPIeWKa7tQA3hWMORmhcwvctb5Rhdomv5rfdc8d5ZejHPt2JFSvUfqX7zicsHnFbd2jas1NWXD0hkE3dCG3ByvZSmuqnmOtpamnuy+QuTfUUwqF56iZo4ejN8poQPKRDLQG2nxM5M0NWCme6DFZvXZRJT+o+FGgi7vDzmCaD4VMzpVcjvzGW6ktpDk+piROR6QLH+0NtNZdDb+tJa9U2CQzI4pazM+uGRTSR/nTNmPEUSFcpDF00Stxfkjz1y1jIdA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(7916004)(4636009)(36840700001)(46966006)(5660300002)(33716001)(336012)(110136005)(8936002)(356005)(426003)(70586007)(103116003)(2906002)(4326008)(186003)(26005)(54906003)(8676002)(508600001)(16526019)(16576012)(9686003)(81166007)(47076005)(86362001)(36860700001)(70206006)(83380400001)(44832011)(316002)(82310400004)(71626007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2021 21:16:30.9821 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 856ad192-4615-4571-1c35-08d9aec68526 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: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3390 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org It seems appropriate to move the CCD specific information inside the k10temp_data structure. Signed-off-by: Babu Moger --- Note: Generated the patch on top of hwmon-next. drivers/hwmon/k10temp.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c index 880990fa4795..bd436b380a02 100644 --- a/drivers/hwmon/k10temp.c +++ b/drivers/hwmon/k10temp.c @@ -85,6 +85,7 @@ struct k10temp_data { u32 show_temp; bool is_zen; u32 ccd_offset; + u32 ccd_limit; }; #define TCTL_BIT 0 @@ -357,12 +358,12 @@ static const struct hwmon_chip_info k10temp_chip_info = { }; static void k10temp_get_ccd_support(struct pci_dev *pdev, - struct k10temp_data *data, int limit) + struct k10temp_data *data) { u32 regval; int i; - for (i = 0; i < limit; i++) { + for (i = 0; i < data->ccd_limit; i++) { amd_smn_read(amd_pci_dev_to_node_id(pdev), ZEN_CCD_TEMP(data->ccd_offset, i), ®val); if (regval & ZEN_CCD_TEMP_VALID) @@ -411,14 +412,16 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id) case 0x11: /* Zen APU */ case 0x18: /* Zen+ APU */ data->ccd_offset = 0x154; - k10temp_get_ccd_support(pdev, data, 4); + data->ccd_limit = 4; + k10temp_get_ccd_support(pdev, data); break; case 0x31: /* Zen2 Threadripper */ case 0x60: /* Renoir */ case 0x68: /* Lucienne */ case 0x71: /* Zen2 */ data->ccd_offset = 0x154; - k10temp_get_ccd_support(pdev, data, 8); + data->ccd_limit = 8; + k10temp_get_ccd_support(pdev, data); break; } } else if (boot_cpu_data.x86 == 0x19) { @@ -431,13 +434,15 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id) case 0x21: /* Zen3 Ryzen Desktop */ case 0x50 ... 0x5f: /* Green Sardine */ data->ccd_offset = 0x154; - k10temp_get_ccd_support(pdev, data, 8); + data->ccd_limit = 8; + k10temp_get_ccd_support(pdev, data); break; case 0x10 ... 0x1f: case 0x40 ... 0x4f: /* Yellow Carp */ case 0xa0 ... 0xaf: data->ccd_offset = 0x300; - k10temp_get_ccd_support(pdev, data, 8); + data->ccd_limit = 8; + k10temp_get_ccd_support(pdev, data); break; } } else { From patchwork Tue Nov 23 21:16:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 12635475 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 19EFBC433EF for ; Tue, 23 Nov 2021 21:16:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240404AbhKWVUB (ORCPT ); Tue, 23 Nov 2021 16:20:01 -0500 Received: from mail-dm6nam11on2060.outbound.protection.outlook.com ([40.107.223.60]:47585 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239281AbhKWVUA (ORCPT ); Tue, 23 Nov 2021 16:20:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cNtO6CVCcQNoFiXybFOuAvnVFLV0Vu8v8kpZ1j3LlO2Tl5oRAEozNm3tq7M0pFtf3KxsopgXYi9VLgFNJJvWD0DqipSKnoJhSLM61qG49PlmMLNrMl8ASi89HEYeY+PztDHzjwxwNhq87x2uqY4HB8pQUULNYJErlzgRnmE+lcn3CBc9KYJKZtTRzao8XyxyD0ojlboFBYqTittjC0+aBtSzdagFvCDvI4AUjznFNSXPYyVJOtQl1vvkiga1TpIJbBiLV4lXB1W3dLvnZvJ9163a7OqxJddefWSUVyYQBNzJeK4pukUF5ft4M/h6KA/WtXpraLRLK/EOUhl3md+fGw== 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=vNNadnQacmsXi9h43nNDWzREnDzpWVuWvhQdjVzJjcI=; b=IH5wyANirW7qpBbbR+vCPI/WT/nxUWKbISYWvsZE9TfiwY2crwvTw4QTSOpEp71SJmlhNPJ7GMYB1KtrL6DXsBL70drPynbdYcBXkls8QTwF07h5X0DAd+Iu+IzUlgBosRI5pJJLHk4rHr4h79RUJcRRVjspeu1ijOZ7HvCU7/X797Dq+ujJj/8RxvCX9v8gbWuxH/mD1C+q1wD3fPROTHjsDeSZ43GGQgwf5ROGsuFYoMJs12Xc32K86d0YfoQuFVJtjCYFxhFop9iwp16KDDL13878WtIUF7WmW7PvGo9gUyYUXNWLHqP5eW5LhOh+BGb0PKVt/OIeL+6pN3Jt8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com 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=vNNadnQacmsXi9h43nNDWzREnDzpWVuWvhQdjVzJjcI=; b=z8oI5lpyfeUnPFMrc+QLmzp8U+JO9puTW7w15yCoHPyh7eZ3Td2J7zQVIilzhfnCNGv2agLUNtS+xFTPyK8FY3WMtZpvZZaYDqDwVafzKUh5Z71GrRpWjTYufS2qT8dKIcLBREpu6d0BOKLvIx2NNJD+y9xVoUJORUfy4C9Trlg= Received: from BN0PR04CA0015.namprd04.prod.outlook.com (2603:10b6:408:ee::20) by CH2PR12MB3989.namprd12.prod.outlook.com (2603:10b6:610:23::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Tue, 23 Nov 2021 21:16:45 +0000 Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ee:cafe::e9) by BN0PR04CA0015.outlook.office365.com (2603:10b6:408:ee::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Tue, 23 Nov 2021 21:16:45 +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 BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4713.20 via Frontend Transport; Tue, 23 Nov 2021 21:16:45 +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; Tue, 23 Nov 2021 15:16:44 -0600 Subject: [PATCH 2/2] hwmon: (k10temp) Support up to 12 CCDs on AMD Family of processors From: Babu Moger To: , , CC: , Date: Tue, 23 Nov 2021 15:16:44 -0600 Message-ID: <163770219414.777059.5794961910830381329.stgit@bmoger-ubuntu> In-Reply-To: <163770216907.777059.6947726637265961161.stgit@bmoger-ubuntu> References: <163770216907.777059.6947726637265961161.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9bd9a34-bfd5-49c2-66a1-08d9aec68dee X-MS-TrafficTypeDiagnostic: CH2PR12MB3989: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dmVXHXCm5alu+e/g6BiIWQmXuvcF3aRZ3antmAmHdL+IUcoYGC7hOnmFWr3FOrNxqcE0HR0A1Jn5Iy/ceF/jK6O5K+FKu0nF2sqMINEfG+YSSE8mMeFu+eB1dZ8D+gfOZsJGdhdDPgnhid/v99Of825uhDfOWlR2AEWCSgmxO8B5W7J5P9ZW+HDDq7GNerG0kdWYkPQx3WcNcp6PSIJ1EvYRDXADgE2mbl4OYC1xFCr4CLrcOkYripUIWmEqeGZzFQJs/Hb+PC0r8UFdgOC7p5ecF2HVmrOyel8kMvjEpOBHML0ZwTSOKkSV+lMUDh9ygm7IfIaiPlt5wecn9b1LuEzC8d91ckaEbf3MSuVnDhZ0PqcnAPK1rVLQFPJHVLJmWsdHuMfNFnMsBOndr+K37K3Zexwflo6GkMHQ4JjSGJEWWwPlvGX1MOfJwsD4V/hKsrgsWuIYYWneyeCh+/x4YmCaE4P+bOL7clRU8aHQpnuu4oj3eCXO1X7ukB52KfiJJM3cvLNNhXKcztLc+P8OfeNF+UWUyoZorcTOPUANUK+m7PE7H9b/QSe0Ib22IvzSu0/mwDzJNnz54YDWOWhg9ywocjRO/8qJ40Jz2YACHKKkfmEDDb4rjGC12RQrU/ws41atGXWej+5cr32VG6nbrgkYuLdpKF7OIf3uXIjArVMEVpaErbcqYgxU0CmG/LDwveRiY/0hQkiox3NT0LbGTs2HBIHoImjV/MwQSA4Dg+AmsrVOe/1UXPLti4HR9x0CjQ4MCs+LNbKP5dytsowywA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(7916004)(4636009)(46966006)(36840700001)(336012)(83380400001)(81166007)(44832011)(508600001)(426003)(33716001)(8676002)(8936002)(5660300002)(16526019)(186003)(36860700001)(47076005)(9686003)(103116003)(82310400004)(86362001)(2906002)(356005)(110136005)(70586007)(4326008)(316002)(70206006)(54906003)(26005)(16576012)(71626007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2021 21:16:45.7165 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f9bd9a34-bfd5-49c2-66a1-08d9aec68dee 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: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3989 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 --- Note: Generated the patch on top of hwmon-next drivers/hwmon/k10temp.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c index bd436b380a02..d20159e082ab 100644 --- a/drivers/hwmon/k10temp.c +++ b/drivers/hwmon/k10temp.c @@ -172,6 +172,10 @@ static const char *k10temp_temp_label[] = { "Tccd6", "Tccd7", "Tccd8", + "Tccd9", + "Tccd10", + "Tccd11", + "Tccd12", }; static int k10temp_read_labels(struct device *dev, @@ -207,7 +211,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); @@ -342,6 +346,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 }; @@ -437,13 +445,17 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id) data->ccd_limit = 8; k10temp_get_ccd_support(pdev, data); break; - case 0x10 ... 0x1f: case 0x40 ... 0x4f: /* Yellow Carp */ - case 0xa0 ... 0xaf: data->ccd_offset = 0x300; data->ccd_limit = 8; k10temp_get_ccd_support(pdev, data); break; + case 0x10 ... 0x1f: + case 0xa0 ... 0xaf: + data->ccd_offset = 0x300; + data->ccd_limit = 12; + k10temp_get_ccd_support(pdev, data); + break; } } else { data->read_htcreg = read_htcreg_pci;