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 26D91CCA47E for ; Sat, 4 Jun 2022 14:58:35 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject: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=nLrbbHs05vQS9YZWXiUkYuETkbwN+TOEo7pjEIkBxR0=; b=bznv/Yhx/IAwm/ 8UN3Tbhr+nwk1vJPB4vwCxzL+JnlPWniCKbl6y7aivxm7zFdw9p3T2eGkabclC6YJ+jYxL0K0io6K cWLpiHef60d7RWzDYXNimLfL8nus4QM+NySmTb3LZu9QcYkPvUAUF5lxhLISVuvlWVtlWYhS2Bxdv Ss4/A/pNIiQNHW5FBNFj22T9D3/GOr3msC3g360jonIknlY4Bb0U/Ko/iBkyEnX0pBq2UCjuRyRoe g6Og8PVqFJJNMWSqBNerLztRPotcdwDjim6g5k9sbBUxaV5gL1mIGyG9pfQDO8E8whXyVnZlo5kF3 wYSAx9pNQJ+oPnyMqnJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxVD2-00BblI-AN; Sat, 04 Jun 2022 14:57:00 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxVCz-00Bbkx-KU for linux-arm-kernel@lists.infradead.org; Sat, 04 Jun 2022 14:56:58 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D686A60C79; Sat, 4 Jun 2022 14:56:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47D4AC385B8; Sat, 4 Jun 2022 14:56:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654354616; bh=PqOK2jmzrzVvd+pTI4tgoob/fXORaJiue7+8OoRS5pk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XhayD6p1Ooemd6YWWsDEc5bEvfCn7D87xjowDh5kSIZX/vWxPU3lavYe76DfH1aQZ ukHRIZMEe0uCCfhtp70XHwsCHYzfy22iRwWrODw68qBFKMC7KbUM8vi643UkE+W0Dj VBTi5KTQ5zcWWjvHJWnR2b3YJ3HGPgn9vAuP5J3wup9MEKIJr0QtgHQM4JqTuAJKb0 E/nnN4kN6f+e7VJ+LX4nO1KoNb+6XD22EdmXq1WAbjp3bAWMrD2+fwWiwtobry0fsk hIXSKFrfv5IIdW0dCz/DUW8hji6eteErHP3pF5BZqLmQmOEgBEbMwOHMEMz0MUO3zy up+Na8mHA2Vhg== Date: Sat, 4 Jun 2022 16:05:57 +0100 From: Jonathan Cameron To: Paul Cercueil Subject: Re: [PATCH 2/2] iio: at91-sama5d2: Limit requested watermark value to hwfifo size Message-ID: <20220604160557.1e82077e@jic23-huawei> In-Reply-To: <20220122170447.68f35cfa@jic23-huawei> References: <20220117102512.31725-1-paul@crapouillou.net> <20220117102512.31725-2-paul@crapouillou.net> <20220122170447.68f35cfa@jic23-huawei> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220604_075657_761426_B7202959 X-CRM114-Status: GOOD ( 29.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: , Cc: Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Desroches , Eugen Hristev , linux-arm-kernel@lists.infradead.org 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 Sat, 22 Jan 2022 17:04:47 +0000 Jonathan Cameron wrote: > On Mon, 17 Jan 2022 10:25:12 +0000 > Paul Cercueil wrote: > > > Instead of returning an error if the watermark value is too high, which > > the core will silently ignore anyway, limit the value to the hardware > > FIFO size; a lower-than-requested value is still better than using the > > default, which is usually 1. > > There is another potential error condition in this function which will > also be ignored by the core. > > As such whilst I agree this is a sensible thing to do in this > particular case I think we should also be handling the error in the core. > > I think it would be better to clean that up at the same time > as these improvements - particularly as I'd guess you have a convenient > test setup to check the error unwind is correct? Hi Paul, I was trawling through patchwork and realised this one is stalled. Thoughts on the above? Thanks, Jonathan > > Thanks, > > Jonathan > > > > > Cc: Eugen Hristev > > Cc: Nicolas Ferre > > Cc: Alexandre Belloni > > Cc: Ludovic Desroches > > Signed-off-by: Paul Cercueil > > --- > > drivers/iio/adc/at91-sama5d2_adc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c > > index 854b1f81d807..5cc84f4a17bb 100644 > > --- a/drivers/iio/adc/at91-sama5d2_adc.c > > +++ b/drivers/iio/adc/at91-sama5d2_adc.c > > @@ -1752,7 +1752,7 @@ static int at91_adc_set_watermark(struct iio_dev *indio_dev, unsigned int val) > > int ret; > > > > if (val > AT91_HWFIFO_MAX_SIZE) > > - return -EINVAL; > > + val = AT91_HWFIFO_MAX_SIZE; > > > > if (!st->selected_trig->hw_trig) { > > dev_dbg(&indio_dev->dev, "we need hw trigger for DMA\n"); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel