Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4980767ybl; Wed, 22 Jan 2020 08:09:30 -0800 (PST) X-Google-Smtp-Source: APXvYqz+St3pF4YfJngwatX+WHejzTLuYgkBL4ekR3WpsOkzws3MK4Cb2jatk9edifbVnYJhRbXG X-Received: by 2002:a9d:6c52:: with SMTP id g18mr7959120otq.356.1579709370017; Wed, 22 Jan 2020 08:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579709370; cv=none; d=google.com; s=arc-20160816; b=y4/Qi95dodYjTh+3GU8U82Lg5KGKD+7vQDJU64MIPKdS1dWzXHsD56vXj4VwPwUZvk WGM+ckHkApX+qrxKOxdXVgCejOombQsDiwP55kpmQPzsXaDuyQZyMielhs73qm+fSMS2 P1ZdMEPV8bhAz/sWk6Qb/TEpp4QC+FKIdwWHXTcIA4c1d8uDoSEYv0aiVJHq7f7mNl8i 8B5ZZGGIVNCTzXMlXyalOZaQ2pdGw01wy1UhvcWyGYSqTKQjsjFgAgrAe0JY19DlPUA9 7YguwhyDOrZyP9jYx/+9RxdTp8bSisjtjFkJ4NsTu8SeMmlcw0xQdvdQwz5gJoJt2HLZ spBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4RwmVjb1P+TinMgl/i9OOzkk8Hc144qqJmxw0PSemH0=; b=Ox+QLk33ZLVTDPBW/Olufdfk0H4quV1L0iYmfnXFP/IKG0/BNGkMc7gRNKSBqw0/1N OaztPlGI93VJg9mPu55OfRn7KzSDXsonRVSn9tyiwbdSaY78biX4X+/KNWzZhF9rbW1E tLt7pic8s+Uux30/iLLDCL8mLvZgMGbPqdcbuUzrlcPENymiK0vo0PCjeEsw0NIrZUeX GtAoIk1JeNxO7aaItExzZOzLulWfRKHqMVYSka5K9G5zuvmp4dn2kXpyS3o80zMj4hJt vUBPffKITFnLwPrtPzX6UVTR4JGiCSjNR60SinGnFyaKdZOwil41YGqEcd+nMmvTT930 /koQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=UDESidat; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si22991078otq.156.2020.01.22.08.09.17; Wed, 22 Jan 2020 08:09:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=UDESidat; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726026AbgAVQIH (ORCPT + 99 others); Wed, 22 Jan 2020 11:08:07 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:42196 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbgAVQIH (ORCPT ); Wed, 22 Jan 2020 11:08:07 -0500 Received: by mail-pl1-f193.google.com with SMTP id p9so3188412plk.9; Wed, 22 Jan 2020 08:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4RwmVjb1P+TinMgl/i9OOzkk8Hc144qqJmxw0PSemH0=; b=UDESidatWuSTvj7S76hWmq58ZgfYBFUicwm9GTv/O5TYUkrgNsZ+YYuf0sJw8pyWSR rV8tQi/o6SF20xXJEBa9ZHSKfa9lfzMe2npXa5xIB/U5qelmjf7TCidbDUSw9x7TWoTj ryK7MFFvpSt7b6NeUaeaMYO2680MmiFGhbraldCs8NYzYYI/vEnA7LZOUYggnuS0BNB7 dnWKHnyKXAiQxEs7E1McfhSevTAj2R5LilbM8/udhgUhLunhRARieuJi9fPhGekxlNoJ Q7e5b/9x6T6sJVSsEI9TNKjPKah5WYsT6YgwHU9FsFV2i65rYHSGuwVsrDxkwLLg/7x0 gWpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=4RwmVjb1P+TinMgl/i9OOzkk8Hc144qqJmxw0PSemH0=; b=dME/o4b+iv3duxxQnZPGBjfAK3+QYJcp/RCwN/EMLkukjFS1ZzVZoZXS+RE/ESd0re RGN4weNAlWOjdm0XyqjzZoe/KxndEYNc20f6iLC0PUGmczO5zMoJsXI4mGYN/fd3Dkza u3lOtDM1aMU7W6XpPbIDfK9CCpYTNzicenkiOzE61JvqxCF4+ENKAGckyI1qIuWMfSE0 DGxOmxh4GsWkoLdecO23PIfzRWsiYefh8CfC+Z+ywIzOB/4JClqK/nWlxFSF6BJ51L0D kye7O8+cq+SsuhGuWIrnp7w4HOovopReCwmGDNA2mi7vNHMIGtJFmez2ZeLtViFsc4uU 6RZQ== X-Gm-Message-State: APjAAAUFm5MeFHl/9PKpgL1b3F+urnVpx/ObSv8AeOM5lNiJvnR6N9OU igPUGDi8kJV6NTHKbr1QmY0xVaaA X-Received: by 2002:a17:902:bd4b:: with SMTP id b11mr11733859plx.45.1579709285837; Wed, 22 Jan 2020 08:08:05 -0800 (PST) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id i23sm46822572pfo.11.2020.01.22.08.08.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Jan 2020 08:08:04 -0800 (PST) From: Guenter Roeck To: linux-hwmon@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Clemens Ladisch , Jean Delvare , Brad Campbell , =?UTF-8?q?Ondrej=20=C4=8Cerman?= , Bernhard Gebetsberger , Holger Kiehl , Michael Larabel , Jonathan McDowell , Ken Moffat , Sebastian Reichel , Darren Salt , Guenter Roeck Subject: [PATCH v4 0/6] hwmon: k10temp driver improvements Date: Wed, 22 Jan 2020 08:07:54 -0800 Message-Id: <20200122160800.12560-1-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series implements various improvements for the k10temp driver. Patch 1/6 introduces the use of bit operations. Patch 2/6 converts the driver to use the devm_hwmon_device_register_with_info API. This not only simplifies the code and reduces its size, it also makes the code easier to maintain and enhance. Patch 3/6 adds support for reporting Core Complex Die (CCD) temperatures on Zen2 (Ryzen and Threadripper) CPUs (note that reporting is incomplete for Threadripper CPUs - it is known that additional temperature sensors exist, but the register locations are unknown). Patch 4/6 adds support for reporting core and SoC current and voltage information on Ryzen CPUs (note: voltage and current measurements for Threadripper and EPYC CPUs are known to exist, but register locations are unknown, and values are therefore not reported at this time). Patch 5/6 removes the maximum temperature from Tdie for Ryzen CPUs. It is inaccurate, misleading, and it just doesn't make sense to report wrong information. Patch 6/6 adds debugfs files to provide raw thermal and SVI register dumps. This may help in the future to identify additional sensors and/or to fix problems. With all patches in place, output on Ryzen 3900X CPUs looks as follows (with the system under load). k10temp-pci-00c3 Adapter: PCI adapter Vcore: +1.39 V Vsoc: +1.18 V Tdie: +79.9°C Tctl: +79.9°C Tccd1: +61.8°C Tccd2: +76.5°C Icore: +46.00 A Isoc: +12.00 A The voltage and current information is limited to Ryzen CPUs. Voltage and current reporting on Threadripper and EPYC CPUs is different, and the reported information is either incomplete or wrong. Exclude it for the time being; it can always be added if/when more information becomes available. Tested with the following Ryzen CPUs: 1300X A user with this CPU in the system reported somewhat unexpected values for Vcore; it isn't entirely if at all clear why that is the case. Overall this does not warrant holding up the series. 1600 1800X 2200G 2400G 2700 2700X 2950X 3600X 3800X 3900X 3950X 3970X EPYC 7302 EPYC 7742 Many thanks to everyone who helped to test this series. --- v4: Normalize current calculations do show 1A / LSB for core current and 0.25A / LSB for SoC current. The reported current values are board specific and need to be scaled using the configuration file. Clarified that the maximum temperature of 70 degrees C (which is no longer displayed) was associated to Tctl and not to Tdie. Added debugfs support. v3: Added more Tested-by: tags Added detection for 3970X, and report Tccd1 for this CPU. v2: Added Tested-by: tags as received. Don't display voltage and current information for Threadripper and EPYC. Stop displaying the fixed (and wrong) maximum temperature of 70 degrees C for Tdie on model 17h/18h CPUs.