Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1215283rdb; Mon, 2 Oct 2023 02:51:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVjwfc6KygHUjgy9vnR+GIEtbwmL2w3G1N6xYDL9luh8gZ/+g85Xzdyp8VfLLA8Q3+lEOJ X-Received: by 2002:a05:6870:9a14:b0:1dd:7f3a:b703 with SMTP id fo20-20020a0568709a1400b001dd7f3ab703mr14336232oab.0.1696240307790; Mon, 02 Oct 2023 02:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696240307; cv=none; d=google.com; s=arc-20160816; b=Y4M+ARo2wVyE8rxX/1+nn2sAMLc1kW06X3i7XYlumHfHHmds+EDTuPOu87q3w873if od5HI+h4WuEKahbH+8XtRV6avP0s7kDYB3+65C3FA1SZG0IApCa8bDcpoG+BWJM2ZlPA XK9o17oK39MdkDI/+UIbwVlgp2HXULrYxFOnV87zo2lmOzY5VOKfwKsUB/K75MIGxHb6 csIsYt1VJnS6cqx0w7DK4EV8LOb1fCok7OKX3YWA2Yw1lqv/d8Y6g3y1/h4MGWVouJjZ E1mTNtja6G9xQi+rWqZwRsedIGdpRoNvOWYWXilbIAek7lV/+5zQlps12lT4GrHqB3Xi Yyeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=EtVBUT4PpeS3rO0UIfZdwBx5g9T55eV/y4TNm8QYUfw=; fh=xhjRr9SQ9+Sm3TRC/4A58cw7PpGeWvNCzk4B7zunSmM=; b=EFFROvBcikmY+PbYCAazeqKi0/HHpPCFrTKY2oXdsjbhc0t7qkfUh+SR4IFseDcpsz nEXnnnM0r29I0ozV5ct9xPrAVW1tiicBph3Opn8kFijUBQxJVNhUhE/6faFyqWiIAvj4 /atz+PbXQZCZJ2EuG6xeNDeXhQE/zbCHmGtK3mu/+uvYYFIFCW0lph8ehG/3OEQ7YKx1 JUeAxGaaHCE2J+bnRS2pKN6NaFES1JjeMrP1bsEdoQWu/WURJ1m0FRzNZiLDqe0pTEvJ 97/IxTebSNYKKbKqcTKUjtpia8vbx/++FTiWc94nfzBX+Xxp4ImOUOD/ou5xnzzo4uQN 864A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id f16-20020a63e310000000b005740e906e46si22618662pgh.358.2023.10.02.02.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 02:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D725180EBCB3; Mon, 2 Oct 2023 02:40:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236151AbjJBJju (ORCPT + 99 others); Mon, 2 Oct 2023 05:39:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236156AbjJBJjs (ORCPT ); Mon, 2 Oct 2023 05:39:48 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFAD0F2; Mon, 2 Oct 2023 02:39:44 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RzbVB2Vv3z6K60M; Mon, 2 Oct 2023 17:38:10 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 2 Oct 2023 10:39:41 +0100 Date: Mon, 2 Oct 2023 10:39:40 +0100 From: Jonathan Cameron To: Billy Tsai CC: Jonathan Cameron , "lars@metafoo.de" , "joel@jms.id.au" , "andrew@aj.id.au" , "linux-iio@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-aspeed@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , "Potin.Lai@quantatw.com" , "patrickw3@meta.com" Subject: Re: [PATCH v1] iio: adc: aspeed: Support deglitch feature. Message-ID: <20231002103940.00001dbd@Huawei.com> In-Reply-To: References: <20230925081845.4147424-1-billy_tsai@aspeedtech.com> <20230930174501.039095da@jic23-huawei> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500001.china.huawei.com (7.191.163.213) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 02:40:01 -0700 (PDT) On Mon, 2 Oct 2023 02:30:43 +0000 Billy Tsai wrote: > On Mon, 25 Sep 2023 16:18:45 +0800 > Billy Tsai wrote: > > > > Create event sysfs for applying the deglitch condition. When > > > in_voltageY_thresh_rising_en/in_voltageY_thresh_falling_en is set to true, > > > the driver will use the in_voltageY_thresh_rising_value and > > > in_voltageY_thresh_falling_value as threshold values. If the ADC value > > > falls outside this threshold, the driver will wait for the ADC sampling > > > period and perform an additional read once to achieve the deglitching > > > purpose. > > > > > > Signed-off-by: Billy Tsai > > > Hi Billy > > > This is pushing the meaning of the events interface too far. > > You can't use it to hide a value you don't like from userspace. > > > If you can explain what the condition is that you are seeing > > and what you need to prevent happening if it is seen that would help > > us figure out if there is another way to do this. > > > Jonathan > > Hi Jonathan, > > Currently, we are experiencing some voltage glitches while reading from our > controller, but we do not wish to report these false alarms to the user space. > Instead, we want to retry the operation as soon as possible. This is why the > driver requires this patch to handle retries internally, rather than relying on user > space which could introduce unpredictable timing for retrying the reading process. > This software approach aims to minimize the possibility of false alarms as much as possible. Thanks for the extra detail. Perhaps share more of that in the cover letter for v2. > > If you have any suggestions or recommendations regarding this situation, please feel free to > share them with me. Why do you need userspace control for the thresholds? Perhaps this is something that belongs in DT for a particular board design? Jonathan > > Thanks > > > > --- > > > drivers/iio/adc/aspeed_adc.c | 193 ++++++++++++++++++++++++++++++++++- > > > 1 file changed, 189 insertions(+), 4 deletions(-) > >