Received: by 10.213.65.68 with SMTP id h4csp1546214imn; Thu, 29 Mar 2018 06:45:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/6rKMgwClfbeOAbll5tyhZ/PYucSjlAa1slctwmVpGkylWfyUyTe6mztwaHHjlNaYiQZ8+ X-Received: by 10.98.226.23 with SMTP id a23mr6396335pfi.157.1522331102325; Thu, 29 Mar 2018 06:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522331102; cv=none; d=google.com; s=arc-20160816; b=yM0vdRNEmJ/xBGgyY5B59GpkmQMRxpV0PdRhKWLSeF6Gp8K0bnID50H/p82t4PC1oM ++Ivq/bKLY+nWsNz44nkI4FGmNp9iAtwVEfoHSIWJH0kQV6aDwc+lHnX5l9FPNVHz0dw WNYpHDWiV0/ljl+nqX+EeePPIRz6tL9GZKwGlLd5wULni+l2lBQjn8AvRvUMnehMygbq jDckKULQHuWlIKxX6iCr64v4KQsXNkhLc+WCisxSsQDkrp+re7oTzMK90GE0e/7qAqgj U5Bvu2cFMdfS8N8KpdvY//CNcq/FQkDW7yesMXkAt98zSucm2Go3rLLgqSEx4ja0gx8P RL4g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=rA/lv5TLj6+Nbnfab6O/rG9rsVvMqlb79PUn21jHXnY=; b=JKpqaha1I21S4POeXHcyGarBlwToMhaSjNk/gKRy9XyPp3rfVg88g3TfF5z7DOAMWx Tusd8zqUSfECAsBEXZU6iR4e0GLd2a35vR6z2PChzL83FemQSDsuIymCjbAyLvI2A2Ax beP3ZReTJw+F5aKbLwsCOewcR8VHJU4Xdlt6wcwhACGoVYrkHt4aaIrw+t+uqkFtWLJb jojgedxsmcuQAmeCnVKN4ufHiazQGLYsWbxkvq4jFxMQpL4T5vyA/j6E2Defa8KbVtLJ aWOkoVLW0EfNln1Kq8VpRBCV9cU/EtuG5/x55Qg/55jQBziXB+ZJ3vawm/WZl1/Kx5Ei IeSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AW3Ldhm8; 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 y8si3984561pgq.230.2018.03.29.06.44.47; Thu, 29 Mar 2018 06:45:02 -0700 (PDT) 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=AW3Ldhm8; 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 S1752759AbeC2NmM (ORCPT + 99 others); Thu, 29 Mar 2018 09:42:12 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:32945 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752427AbeC2NmK (ORCPT ); Thu, 29 Mar 2018 09:42:10 -0400 Received: by mail-pf0-f193.google.com with SMTP id f15so3254314pfn.0; Thu, 29 Mar 2018 06:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rA/lv5TLj6+Nbnfab6O/rG9rsVvMqlb79PUn21jHXnY=; b=AW3Ldhm8GgPx234qO+SdyhWuhWZYHukek/NxX3Xm2/EstWYBBDYqISSTdCnDe3mVok tbNgH01tjTLVAZDCG98mY3IKFnMiipAzexRMnPQ1XHM7SQhJDsj12xfDIevUD09IDp+D FKKwcEVVHoEFHxlpH1IDXGBs1ff8VDyEQk0wrhOcZCCR53hxt9Vl57sKAAqhXg9UizSv WuVz/Ef3lVsjSRjt+OjXcV/7ULUMVLyYbsBir1GYix+0bVLA3LaxHtd+oJYa8NC2L+3n 76DcdQyxn4UvZnnkGIB5+Qhk8G5Ckjnv05wBEo5RJknaFqpIGlC/5CEUt46c87x9f7CJ bysQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rA/lv5TLj6+Nbnfab6O/rG9rsVvMqlb79PUn21jHXnY=; b=J+IzeIqolx7YzXR3Kbw5habbdwsqD6CEvMCjO+yLthH6IRa6KHqKFMHK5JHn8JNUXP ZaaF9sSDBSZu6X5+Fn0mAFWfetLMwoiqx5SYdLDWqfIiuXQiR1oZElfg348MqXO3ekNg IGztRWGOdy06qp3BSxpoXP9M4SU+aIdXG1uT7iWfgua1kEdnfc/FJeeWF2nLF0Wruq9s ATEeTBe/NudEbG/H7jNPGGjs3SB8t5lHYGG9QwwMvAClO2RiyoqyVrtV0wIkEQzEJ1lM r+whacY++7KMjhYx7KQpnAhBinsKOem5MztRJpPV43Jl8Aty08vq6M2iz4ENeIc2t7AE 8NRw== X-Gm-Message-State: AElRT7HMVZqpmocNU98A6DR8dibi5qXeJD9H6iaMjQlaxcJMHvJsFwpe wIM95A3ji42nE9ir37pmAwFA1Q== X-Received: by 10.99.119.78 with SMTP id s75mr5674408pgc.238.1522330929931; Thu, 29 Mar 2018 06:42:09 -0700 (PDT) Received: from server.roeck-us.net (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id a14sm12406903pff.75.2018.03.29.06.42.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 06:42:08 -0700 (PDT) Subject: Re: [PATCH v1] hwmon, via-cputem: support new centaur CPUs To: David Wang , jdelvare@suse.com, tglx@linutronix.de, mingo@redhat.com, rjw@rjwysocki.net, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Cc: brucechang@via-alliance.com, cooperyan@zhaoxin.com, qiyuanwang@zhaoxin.com, benjaminpan@viatech.com, lukelin@viacpu.com, timguo@zhaoxin.com References: <1522305403-21009-1-git-send-email-davidwang@zhaoxin.com> From: Guenter Roeck Message-ID: <7fd20afd-ef30-5a25-7fd2-b5f7f60b5a1f@roeck-us.net> Date: Thu, 29 Mar 2018 06:42:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1522305403-21009-1-git-send-email-davidwang@zhaoxin.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/28/2018 11:36 PM, David Wang wrote: > Newer centaur CPUs(Family == 7) also support this cpu temperature sensor. > > Signed-off-by: David Wang > --- FWIW, this would be v2, not v1, and a changelog would be appreciated. > drivers/hwmon/via-cputemp.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c > index 07a0cb0..2f5bd50 100644 > --- a/drivers/hwmon/via-cputemp.c > +++ b/drivers/hwmon/via-cputemp.c > @@ -136,6 +136,11 @@ static int via_cputemp_probe(struct platform_device *pdev) > data->id = pdev->id; > data->name = "via_cputemp"; > > + if (c->x86 == 7) { > + data->msr_temp = 0x1423; > + goto test_access; > + } Please rework to not require a goto. Something like if (c->x86 == 7) { data->msr_temp = 0x1423; } else switch (c->x86_model) { ... } should do. Thanks, Guenter > + > switch (c->x86_model) { > case 0xA: > /* C7 A */ > @@ -152,6 +157,7 @@ static int via_cputemp_probe(struct platform_device *pdev) > return -ENODEV; > } > > +test_access: > /* test if we can access the TEMPERATURE MSR */ > err = rdmsr_safe_on_cpu(data->id, data->msr_temp, &eax, &edx); > if (err) { > @@ -283,6 +289,7 @@ static int via_cputemp_down_prep(unsigned int cpu) > { X86_VENDOR_CENTAUR, 6, 0xa, }, /* C7 A */ > { X86_VENDOR_CENTAUR, 6, 0xd, }, /* C7 D */ > { X86_VENDOR_CENTAUR, 6, 0xf, }, /* Nano */ > + { X86_VENDOR_CENTAUR, 7, X86_MODEL_ANY, }, > {} > }; > MODULE_DEVICE_TABLE(x86cpu, cputemp_ids); >