From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F26B9E784AF for ; Mon, 2 Oct 2023 09:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SrEyMA2ialQtz9ioQlr5MdcU8Yel8XSJGVJKsCEP1Kg=; b=4ENi59g1M6BBUx 1WH7zKmz0RIGUajU6Yi8ytKiI2cX1ORxHyVUtprTreYpPXZzAK1/oJ54fvZV1A4eg9npPh6kE3M49 dLGLE9thfKxVm71nEnMhuKWVzmOmG5f+Hoy770B0O8PL6iBmzJQLh1urmKFEHPlloHR9EGW7NXXn9 X/7Od+IEgCoi6ajjtV6y0/meh4yd+npqcoNI3SCMPt0hMisWdcUEr449bSxZI7vYN4U4wEVNykIXc MeTt7GYG+LNvKUtQTguI13mz+jI5bQn6bRoL2FkxpC83p7d+nZTaZJ2KBhnIWTlTN9nI4JaOC2MQI dsevb9LgY/byFXNEgvJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qnFPE-00CFIc-0H; Mon, 02 Oct 2023 09:40:00 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qnFP7-00CFF9-29 for linux-arm-kernel@lists.infradead.org; Mon, 02 Oct 2023 09:39:58 +0000 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231002_023953_846991_935158ED X-CRM114-Status: GOOD ( 26.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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(-) > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel