Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754064AbbBYWkJ (ORCPT ); Wed, 25 Feb 2015 17:40:09 -0500 Received: from mail-ob0-f169.google.com ([209.85.214.169]:41187 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753735AbbBYWkG (ORCPT ); Wed, 25 Feb 2015 17:40:06 -0500 MIME-Version: 1.0 In-Reply-To: References: <1423608615-6575-1-git-send-email-tylerwhall@gmail.com> <20150224183616.GD3448@developer.amazonguestwifi.org> <54EDF3E6.6040409@free-electrons.com> <20150225183901.GD2306@developer.amazonguestwifi.org> From: Tyler Hall Date: Wed, 25 Feb 2015 17:39:45 -0500 Message-ID: Subject: Re: [PATCH] thermal: armada: read stable temp on Armada XP To: Gregory CLEMENT Cc: Ezequiel Garcia , linux-pm@vger.kernel.org, Linux Kernel Mailing List , "devicetree@vger.kernel.org" , Zhang Rui , Eduardo Valentin Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4701 Lines: 107 Gregory, I instantiated both configurations and verified I get essentially the same temperature from both, with the original register having a slightly larger spread. I didn't reproduce any outliers in this run, but I'll keep it running for a while to see if any occur. I'm running this to gather samples. # while true; do echo $( wrote: > Hi Gregory, Eduardo, > > On Wed, Feb 25, 2015 at 05:10:14PM +0100, Gregory CLEMENT wrote: >> By using it by default do you mean removing marvell,armadaxp-thermal >> and adding armadaxp-filtered-thermal instead ? > > Yes, replacing it in device tree. For me, > /sys/class/thermal/thermal_zone0/temp returns the same temperature but > with less variability between samples. My intent was to switch the > source of the data and not affect user space other than providing a > more stable reading. > >> Tyler, >> In the meantime could you double check your values? The temperature on my board >> seemed broken on my board. If needed I can check on an other board. By the way >> on which board/product did you try it? > > I'm on a custom board with the 4-core MV78460. In addition to my > patch, this is new device tree entry. > > thermal@184c4 { > compatible = "marvell,armadaxp-filtered-thermal"; > reg = <0x184c4 0x4 > 0x184d0 0x4>; > status = "okay"; > }; > > I dumped some raw samples of the temperature fields in each of these > registers. This CSV contains the raw values converted to decimal. > http://pastebin.com/Umc3cy5L > The first column is the current register at 0x182b0 27:19 and the > second is the register at 0x184c4 9:1. > > Here's a quick plot of a larger sample size while the temperature was rising. > https://imgur.com/E9HlSBx > The blue value is the current 0x182b0 register which seems to bounce > around the green value from 0x184c4. > > I'll try a test of instantiating both at the same time and comparing > the final output of the driver. > > On Wed, Feb 25, 2015 at 1:39 PM, Eduardo Valentin wrote: >>> Does that new thermal sensors only improve the stability or does it >>> also modify the value? >>> >>> In the second case it will more or less break the user space expectation. >> >> Yeah, I agree here. We need to understand if this is: >> (1) a fix of which register to use. In that case, the old dtbs are >> essentially wrong, and the driver would need to adapt, I would say. >> (2) a way to report better temperature extrapolations. then, this is >> essentially a new temp sensor, and we should have two separated >> compatible. in other words, just keep the patch the way it is. > > This *might* be a different physical sensor, or it could be from the > same source with some averaging/filtering applied in hardware. The > conversion formula is the same, however, and I get similar raw values > from both. > >> Yes. Typically I ask to see the complete series, even if I am not taking >> the DTS changes. That is, you send a complete series, with changes in >> the kernel code and in the DTS, copying the required audience (from >> kernel side and from DT side). Once the changes are accepted, the >> patches will be picked by the correct tree maintainer. It is common that >> DTS changes go via the platform tree, to avoid conflicts though. > > Thanks for the clarification. I'll send both in the next version as I > suspect there will be a v2 of this change. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/