From: Paul Cercueil <paul@crapouillou.net>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Eugen Hristev <eugen.hristev@microchip.com>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Ludovic Desroches <ludovic.desroches@microchip.com>
Subject: Re: [PATCH 2/2] iio: at91-sama5d2: Limit requested watermark value to hwfifo size
Date: Sat, 04 Jun 2022 23:41:02 +0100 [thread overview]
Message-ID: <EO5ZCR.QO9V0UA1ZW04@crapouillou.net> (raw)
In-Reply-To: <20220604160557.1e82077e@jic23-huawei>
Hi Jonathan,
Le sam., juin 4 2022 at 16:05:57 +0100, Jonathan Cameron
<jic23@kernel.org> a écrit :
> On Sat, 22 Jan 2022 17:04:47 +0000
> Jonathan Cameron <jic23@kernel.org> wrote:
>
>> On Mon, 17 Jan 2022 10:25:12 +0000
>> Paul Cercueil <paul@crapouillou.net> 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?
Totally forgot about this patch.
Aren't you afraid that if we start handling these errors in the core,
we'll somehow break the ABI?
-Paul
> Thanks,
>
> Jonathan
>
>>
>> Thanks,
>>
>> Jonathan
>>
>> >
>> > Cc: Eugen Hristev <eugen.hristev@microchip.com>
>> > Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
>> > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
>> > Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
>> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>> > ---
>> > 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");
>>
>
next prev parent reply other threads:[~2022-06-04 22:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-17 10:25 [PATCH 1/2] iio: imu: st_lsm6dsx: " Paul Cercueil
2022-01-17 10:25 ` [PATCH 2/2] iio: at91-sama5d2: " Paul Cercueil
2022-01-22 17:04 ` Jonathan Cameron
2022-06-04 15:05 ` Jonathan Cameron
2022-06-04 22:41 ` Paul Cercueil [this message]
2022-06-12 8:49 ` Jonathan Cameron
2022-01-17 10:56 ` [PATCH 1/2] iio: imu: st_lsm6dsx: " Lorenzo Bianconi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=EO5ZCR.QO9V0UA1ZW04@crapouillou.net \
--to=paul@crapouillou.net \
--cc=alexandre.belloni@bootlin.com \
--cc=eugen.hristev@microchip.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=nicolas.ferre@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®