Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4607175pxu; Mon, 21 Dec 2020 17:47:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdvRNFdZj5t6Y+8yiNrraWsagwZ6kqgJYgoc5d1Z7pG2zS3gsBngkedzoZM/ZKp9QxV3Cy X-Received: by 2002:aa7:d511:: with SMTP id y17mr18305014edq.249.1608601644106; Mon, 21 Dec 2020 17:47:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608601644; cv=none; d=google.com; s=arc-20160816; b=OQsVSchp2yCmbleYHOlaDzevAOPsmo/kSILjBtymz+akev2HuJd2OK3vWd17xTJIWX KtdnRIY3VWWxMGFAsXuoWvep7O42Y1wDyDrFAKCFIVtXpoGV9sh0oBYY+4IT3eveyIYC lf+IjGD17ccVf2Q6rMNXPan8iKLlFvO7tOgq65tRrZXZN9N+pB8N1+6RkzVSL6xnc9Sv wWKW/MHy5VXv55OUdaOq/E3h+7RyII7P4CXnFpxznXuNwnEL/DSWSe1W92m3wYJsH066 NervADGLkRgBLnXY8dgDAr6E3r3idvKxiQVKvmK70cUmTBfkGF4NOjUh+D/uMBoxbv7I fcnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=pWOHnkyedFGnfyVoxalADGXLfdGf7ijaBF8UEcICmqs=; b=CNqDl1mqITXq5erS6w9rgCYT/6m9OtJHW+Uzr9U/FdeXQ5Ir3F78/p9Sv7zZNZHY2n JU7Qr7ggqtoOyjW7ENZGkTCauzS8fAMHj0y3oJBn54brMa4snJgdxjKi+XslMh5gCsaI zoGe2NFJx9g7Q2ocSNognXW1pJ6GEft9tyDDYL/WsuuXve0GTHGYRE7tIv6bW8P2w7oI Kdu/S0EqdteNT1HxB4DTEX9YYr/2w57vv/IUeIIy4AHcUIQrI+lnhxe5fncAi7Zi3lYu KR0DsHrmcPE4J8zImXfQ1Gvc8zvHmWCuSqyI/S+SieTzBWkpAR0tkVYPcxii5kiyssxV btPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=sOAO3Y04; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si10674488eju.355.2020.12.21.17.47.00; Mon, 21 Dec 2020 17:47:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=sOAO3Y04; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726187AbgLVBqK (ORCPT + 99 others); Mon, 21 Dec 2020 20:46:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726094AbgLVBqK (ORCPT ); Mon, 21 Dec 2020 20:46:10 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1FECC0613D3; Mon, 21 Dec 2020 17:45:29 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id o13so28282470lfr.3; Mon, 21 Dec 2020 17:45:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=pWOHnkyedFGnfyVoxalADGXLfdGf7ijaBF8UEcICmqs=; b=sOAO3Y04WoeC/sysqNZlY9oviUjLGxr//USG6CG8DA8aJ3cnupJGVKiN3ruS/0Rv8R Kt6Bx0cpL/wdecZ7fms2mjbde3zWAgvzKKVzAq8otVc7JkNHFTcvj3vepsc/CV0MY3Q+ iIDjLg01vwM0d+JCDJt2wKPmREwRo1qldoXM5qDu3j0wKlQCv6PRoFEYbv6lFMsZyb7d SXmGJgHJVYB5KGoWHx/1A31MMd4XpXwVYTUAxdX9MGHmYYTMG6fRfWRHcPLeirMU19zm JOmGTGwJwqlEmlmP40cwlzsC+nr6ZhhXVKpAX/Sc9I9PXF/aXqRn52jzPkXmkgzVcFtr flzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=pWOHnkyedFGnfyVoxalADGXLfdGf7ijaBF8UEcICmqs=; b=Bv3C8X4LycV5escMjCXROHaYk8C8PeKPnMrwmbAb53VMCt2EWIxXEE1vSnblN87GSm 8y2WVJ/2sigF0QyR+DHRMCzgUd0t4RLlwc8RUsNhyLYkmuLWSGWpTAseAmxqJm1ktwyT e83y2nWkDGwP3Rp2nGim0Up7ZMMihBHmTocTG4+1m1MUQdDETHKVacnV40YU18tRTr8M NrWjU50ZuVWuJMuYoKoWOnb7rCMaXSEJsA0UyzZibhBp9edqDReEL1IbI7CHLJx0Mhnd ZmkjxV5nKBQqvzVDS/Rsc3JKUZu7FVB36ynqllSthSv8lrifHK6WMmM1sY20A4VxUStE dj+A== X-Gm-Message-State: AOAM532TqjiEoO7Mjvmscgj5NP3Luqsw1GYSHOF/jn8kbPBA2Wut4TRg gJtjYGCO39xh3xVw45QbJ8H9cuVKu50KBbt+qw== X-Received: by 2002:a2e:a547:: with SMTP id e7mr8425929ljn.108.1608601528357; Mon, 21 Dec 2020 17:45:28 -0800 (PST) MIME-Version: 1.0 From: Gabriel C Date: Tue, 22 Dec 2020 02:45:02 +0100 Message-ID: Subject: k10temp: ZEN3 readings are broken To: Guenter Roeck Cc: linux-hwmon@vger.kernel.org, LKML , Wei Huang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Guenter, while trying to add ZEN3 support for zenpower out of tree modules, I find out the in-kernel k10temp driver is broken with ZEN3 ( and partially ZEN2 even ). commit 55163a1c00fcb526e2aa9f7f952fb38d3543da5e added: case 0x0 ... 0x1: /* Zen3 */ however, this is wrong, we look for a model which is 0x21 for ZEN3, these seem to be steppings? Also, PLANE0/1 are wrong too, Icore has zero readouts even when fixing the model. Looking at these ( there is something missing for 0x71 ZEN2 Ryzens also ) that should be: PLANE0 (ZEN_SVI_BASE + 0x10) PLANE1 (ZEN_SVI_BASE + 0xc) Which is the same as for ZEN2 >= 0x71. Since this is not really documented and I have some confirmations of these numbers from *somewhere* :-) I created a demo patch only. I would like AMD people to really have a look at the driver and confirm the changes, since getting information from *somewhere*, dosen't mean they are 100% correct. However, the driver is working with these changes. In any way the model needs changing to 0x21 even if we let the other readings broken. There is my demo patch: https://crazy.dev.frugalware.org/fix-ZEN2-ZEN3-test1.patch Also, there is some discuss and testing for both drivers: https://github.com/ocerman/zenpower/issues/39 Best Regards, Gabriel C