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: Babu Moger 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;