Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2209743rwp; Fri, 14 Jul 2023 02:33:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlGp+YEK+w9WwzTvsTKgaFoz4+JZTPhAMG3yak+kRW49/+1gUXj5kXw/34p7it69BsHMDF+b X-Received: by 2002:a17:902:c94e:b0:1b4:5699:aac1 with SMTP id i14-20020a170902c94e00b001b45699aac1mr2838774pla.12.1689327235881; Fri, 14 Jul 2023 02:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689327235; cv=none; d=google.com; s=arc-20160816; b=rCPI5X14A8lFfzLmESiSr9CPXr4557VFZQ/MU9Z4WuqKcKTZ6Hz9R14rRej9R2KKHc jTAxUlD4r+WLi6LZ0UsKpJHT0jvN/QvBAkudaFKxGk2U47Qd+CPtJ4iw3MCelvNxtDQa OlB/eFjA29j8rygX+mIa/+MsTwTqzDwaiJaG2EO9IDlIprc/OMmLtrSS8rdwRrS5fY3u AievTKa5wVZWNdKXI4B4z979gcvbojOp5Cr+4Wrm7tLZ1WdKB96MfnI2v4hwqM3qw5rV qGvaqPrrnJMi1QrnDrdUk64CeUUN3LhBnw9aOPSSaQaNXjtb3MVmYCpUxFpdVCNQkvnK K66A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=MfXex84x4+pKbYyWoWoo82/26U31C78oFgTQV1NX8Ts=; fh=RldpMqrfjT854J8qkIRHiKpxmPhtBuRfhw55wfqjPxM=; b=CCjetlOO3dHjLR82zwbhSDuXKNziq2zRK2vhGLw0cC7lwS9VUS7dQvESQQrEBWvRLl FlYXPI9UUTWOtLPZtdwBw5GvGZ3XxnmUOTFuShBsNbyGKkLW2N95fUvrhGvVA+W1RQc6 UNIsXToBy94Fds8EWk/jRMPHXX9TYo8gWzoZ22AUR9TnOKAwccET82qBMRKgNYsAl6GW zWJV2BDa1Zx71a8RA5XcoQfk3pwwJLVAlxzPOpBifuqjbrYAt9iqDDC20fZFpYlJqBOa CLIxnCvV1GsCnJkWS77tZ5YxFMt6yI1PuN8JjcEK93vb1ifLiDgATXasyHzMw+rlUxpz bUPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nIIB7B3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x18-20020a170902b41200b001b8ac52a1b2si6517093plr.551.2023.07.14.02.33.42; Fri, 14 Jul 2023 02:33:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nIIB7B3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235203AbjGNJYF (ORCPT + 99 others); Fri, 14 Jul 2023 05:24:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234487AbjGNJYE (ORCPT ); Fri, 14 Jul 2023 05:24:04 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C1E41FC9; Fri, 14 Jul 2023 02:24:03 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 8F51A6600357; Fri, 14 Jul 2023 10:24:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689326642; bh=QFtwjZ7+j0imGIusFEtf/Z7au6dmUlgQo0NxyxN8Bss=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=nIIB7B3dDe76meN/ttrtJJOY4QHQj+y+FRJ6a8YyZzsg35mekdmT3MjJ0xuyl2eSG tHPRaRwgy8dRmQBI/fFLHLhzCSF/2iE0fhxnf0y7YYCKqyrz6wS9wEG3Sp/tx2jERJ 7u+IoUmb6p4iBUlGLKbPnT4Bw6cbxhCHtXAOV242zwfGyre1ceuec0aQHilvfqdeTU qW49EmEv84gOBm5fBX8SSMtjI9VoWjv87pe+n2ThI2RcppT5SdZ4mqf569cB1RaWDh W/XaMmckYOzENiMjaSIQHoBERaV/buSF5XMsB7leeRdGQIbygFa40mmqWk01b17D1V 9JM3yR2FWvnmw== Message-ID: <1ab4a9fb-caa4-f2c9-fbf4-d001e768dbe1@collabora.com> Date: Fri, 14 Jul 2023 11:23:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2] thermal/drivers/mediatek/lvts_thermal: Make readings valid in filtered mode Content-Language: en-US To: =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Daniel Lezcano Cc: kernel@collabora.com, Chen-Yu Tsai , =?UTF-8?Q?Bernhard_Rosenkr=c3=a4nzer?= , Alexandre Mergnat , Amit Kucheria , Balsam CHIHI , Matthias Brugger , "Rafael J. Wysocki" , Yangtao Li , Zhang Rui , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org References: <20230713154743.611870-1-nfraprado@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230713154743.611870-1-nfraprado@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 13/07/23 17:42, NĂ­colas F. R. A. Prado ha scritto: > Currently, when a controller is configured to use filtered mode, thermal > readings are valid only about 30% of the time. > > Upon testing, it was noticed that lowering any of the interval settings > resulted in an improved rate of valid data. The same was observed when > decreasing the number of samples for each sensor (which also results in > quicker measurements). > > Retrying the read with a timeout longer than the time it takes to > resample (about 344us with these settings and 4 sensors) also improves > the rate. > > Lower all timing settings to the minimum, configure the filtering to > single sample, and poll the measurement register for at least one period > to improve the data validity on filtered mode. With these changes in > place, out of 100000 reads, a single one failed, ie 99.999% of the data > was valid. > > Reviewed-by: Chen-Yu Tsai > Tested-by: Chen-Yu Tsai > Signed-off-by: NĂ­colas F. R. A. Prado > Good to go! Reviewed-by: AngeloGioacchino Del Regno