From: Jonathan Cameron <jic23@kernel.org>
To: Ezequiel Garcia <ezequiel.garcia@imgtec.com>,
Lars-Peter Clausen <lars@metafoo.de>,
pmeerw@pmeerw.net, knaack.h@gmx.de
Cc: linux-iio@vger.kernel.org, james.hartley@imgtec.com,
abrestic@chromium.org, Phani Movva <Phani.Movva@imgtec.com>
Subject: Re: [PATCH 1/2] iio: adc: Cosmic Circuits 10001 ADC driver
Date: Wed, 05 Nov 2014 13:35:39 +0000 [thread overview]
Message-ID: <545A27AB.3060606@kernel.org> (raw)
In-Reply-To: <54596172.9090908@imgtec.com>
On 04/11/14 23:29, Ezequiel Garcia wrote:
> Hi everyone,
>
> Thanks for the review. I've fixed most of the comments except for the
> invalid sample representation issue.
>
> On 10/31/2014 02:19 PM, Lars-Peter Clausen wrote:
>> On 10/29/2014 09:45 PM, Ezequiel Garcia wrote:
>>> From: Phani Movva <Phani.Movva@imgtec.com>
>>>
>>> This commit adds support for Cosmic Circuits 10001 10-bit ADC device.
>>>
>>> Signed-off-by: Phani Movva <Phani.Movva@imgtec.com>
>>> Signed-off-by: Naidu Tellapati <Naidu.Tellapati@imgtec.com>
>>> [Ezequiel: code style cleaning]
>>> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
>>
>> Looks very good. Just a few very minor issues.
>>
>> [...]
>>> +static int cc_adc_poll_done(struct iio_dev *dev, int channel,
>>> + unsigned int delay)
>>> +{
>>> + struct cc_10001_adc_device *adc_dev = iio_priv(dev);
>>> + int val = INVALID_SAMPLED_OUTPUT;
>>
>> I'm not so sure that returning a fake sample is such a good idea. When
>> reading from sysfs we should definitely return an error if there is one.
>
> Right.
>
>> For buffer reading dropping the sample is probably not such a good idea,
>> but we should agree on and document a standard representation of invalid
>> samples.
>>
>
> Hm, sure. What do you suggest? I can't see other drivers doing anything
> like this.
>
It's ancient, but I vaguely recall one driver (can't find it right now
- may no longer exist) in which the try to reenable on the trigger
could detect that it had missed a sample (as the interrupt had
not fallen) and so would fire off the trigger again...
In that particular case we set the timestamp to 0 to indicate that we
new there was a sample but didn't know when it was captured.
Not really the same, but there are nasty to handle corner cases we ought
to include in any discussion of invalid data...
Is this a real issue - or are we talking, in event of hardware failure or
bug? If so I'd spit a warning out to the logs and probably push nothing
at all into the buffer.
A magic flag on the buffer would be nice, but in general there is nowhere
to put it without in some cases greatly increasing the buffer element size.
I suppose we could have an error flag for the buffer to say, 'something
missed' though...
Alternatively we 'could' have drivers expose their own 'INVALID' flag via
a sysfs attribute...
next prev parent reply other threads:[~2014-11-05 13:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 20:45 [PATCH 0/2] iio: Add Cosmic Circuits ADC support Ezequiel Garcia
2014-10-29 20:45 ` [PATCH 1/2] iio: adc: Cosmic Circuits 10001 ADC driver Ezequiel Garcia
2014-10-31 17:19 ` Lars-Peter Clausen
2014-10-31 19:44 ` Lars-Peter Clausen
2014-11-04 23:29 ` Ezequiel Garcia
2014-11-05 13:35 ` Jonathan Cameron [this message]
2014-10-31 20:26 ` Peter Meerwald
2014-11-04 23:47 ` Ezequiel Garcia
2014-11-01 23:11 ` Hartmut Knaack
2014-11-04 23:41 ` Ezequiel Garcia
2014-11-05 13:41 ` Jonathan Cameron
2014-11-05 13:36 ` Jonathan Cameron
2014-10-29 20:45 ` [PATCH 2/2] DT: iio: adc: Add CC_10001 binding documentation Ezequiel Garcia
2014-11-05 13:40 ` Jonathan Cameron
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=545A27AB.3060606@kernel.org \
--to=jic23@kernel.org \
--cc=Phani.Movva@imgtec.com \
--cc=abrestic@chromium.org \
--cc=ezequiel.garcia@imgtec.com \
--cc=james.hartley@imgtec.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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