Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp37098ybj; Fri, 8 May 2020 06:04:01 -0700 (PDT) X-Google-Smtp-Source: APiQypLdd8L2QdSwVEQ3sTRj5SL14Bd0hIjn0Ba1oMUoC+sm1rM5bRCf0cTqbVlk8vMFtt5pAd36 X-Received: by 2002:a17:906:4553:: with SMTP id s19mr1754434ejq.295.1588943041518; Fri, 08 May 2020 06:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588943041; cv=none; d=google.com; s=arc-20160816; b=hMLomt/LQgsK1eLuFObMCfmENUeimOCUBR7D9hKLBexD0bdv6P5GMfuwZq20/pibhq iPP0szHOD1m4SlylSWaT/IPzp0T7tiyauo3rTUf9yM8aNCu5kuXVUR7wzHT6xk6YkOfh KzJtmY4Hy40zeVCC6H+EkHnfRCTVhrvKa+dz4zswC8OKmw6/YKbS9KsxJa7FsCdUM/WR bc3LdoPQacPAYa26ordaIX6iY4j+odxM7/AOHWD68IpqBOBUFgSQteUXs7UXK0whCpoS CX3ugbWFRWG89rGmdHpkWQlucdY1dR+D5wVaOyFjusYvbl6JjSBmYmaguwWbYlegNGnI 29iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=F/TVaEkRR/lAGU9g8AaxBKLnm2v+ZKoph36kOWWBS5w=; b=H8qDRQvX2G2A9B+JYuqhpF2LJB9vpS+IZN0whrnrwgzIC6raDYwn3I/bhCPmHlbPVF ZzKbRgFGAlhGn69+qrxeXlDrXKUg4P8sWWEulFzesewwtwhtwOjAxUwWjpq/TxtP+q5n V+TalmdX8uFUJWghY4bJFCsXLZuPmRRAkJqFEuwwLOeKnsdgMqUP242N83F22CPo5gwv MuHRjxSVBJ1Xhl+MQKm0yc13nWdztesY6Dq6QPm2JebWcDSr/eOVTW/ljCuJHWcoNvLu OhvFd3jnIBnxAVPt7cyRuvxm90EwJ/qP79/pVp4WMDwr7v9tGapzO0VEbcyPh5IHkYzf EPHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@xen0n.name header.s=mail header.b=RKZgcroP; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si974020edk.160.2020.05.08.06.03.30; Fri, 08 May 2020 06:04:01 -0700 (PDT) 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=fail (test mode) header.i=@xen0n.name header.s=mail header.b=RKZgcroP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729912AbgEHNBu (ORCPT + 99 others); Fri, 8 May 2020 09:01:50 -0400 Received: from [115.28.160.31] ([115.28.160.31]:37932 "EHLO mailbox.box.xen0n.name" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1729210AbgEHNBp (ORCPT ); Fri, 8 May 2020 09:01:45 -0400 X-Greylist: delayed 584 seconds by postgrey-1.27 at vger.kernel.org; Fri, 08 May 2020 09:01:44 EDT Received: from hanazono.local (unknown [116.236.177.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 332BC600B4; Fri, 8 May 2020 20:51:56 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=xen0n.name; s=mail; t=1588942316; bh=HDjHMr6Wm9wSc694o01E98JEM0XZjMXpbv98vll1dXs=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=RKZgcroPWCAm49IrZ9c+3R18tnP6iedDoJVXpGk4K0jbg9X9S1K1OtlrZtloC6CyB QUeuh0EYGIio+qc3f/g0WNT43E8PVrWA6wJV5wAZhSKNnQB4C4yIAyBdV4ejeM+rmu T+eSOIID5kTd5kAAmykDuKmLyqDhkNkc1ZXdz4sc= Subject: Re: [PATCH 2/3] MIPS: Loongson: Add hwmon support for generic CPU To: Tiezhu Yang , Thomas Bogendoerfer , Huacai Chen , Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li References: <1588938904-924-1-git-send-email-yangtiezhu@loongson.cn> <1588938904-924-3-git-send-email-yangtiezhu@loongson.cn> From: WANG Xuerui Message-ID: Date: Fri, 8 May 2020 20:51:55 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.0a1 MIME-Version: 1.0 In-Reply-To: <1588938904-924-3-git-send-email-yangtiezhu@loongson.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/5/8 19:55, Tiezhu Yang wrote: > Add PRID_IMP_LOONGSON_64G case to enable hwmon support for Loongson > generic CPU such as 3A4000 and newer CPU. > > Signed-off-by: Tiezhu Yang > --- > drivers/platform/mips/cpu_hwmon.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c > index add5f52..7b4bde1 100644 > --- a/drivers/platform/mips/cpu_hwmon.c > +++ b/drivers/platform/mips/cpu_hwmon.c > @@ -43,6 +43,7 @@ int loongson3_cpu_temp(int cpu) > break; > case PRID_REV_LOONGSON3A_R3_0: > case PRID_REV_LOONGSON3A_R3_1: > + case PRID_IMP_LOONGSON_64G: > default: > reg = (reg & 0xffff)*731/0x4000 - 273; > break; Hi, This is obviously wrong, as the value being matched is a PRID_REV. You can tell from the neighboring match arms. Also, the LOONGSON_64G cores are 3A4000 and newer, that have CSR support. The csr_temp_enable flag is probed in loongson_hwmon_init, then the switch is simply never entered for these.