linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Martin Fuzzey <mfuzzey@parkeon.com>,
	linux-iio@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH 9/9] iio: mma8452: add support for self test.
Date: Fri, 08 May 2015 00:13:23 +0100	[thread overview]
Message-ID: <554BF193.7000208@kernel.org> (raw)
In-Reply-To: <554090D7.50208@parkeon.com>

On 29/04/15 09:05, Martin Fuzzey wrote:
> On 09/03/15 14:37, Jonathan Cameron wrote:
>> On 19/02/15 14:16, Martin Fuzzey wrote:
>>> Add a new attribute to activate the self test mode.
>>>
>>> When self test is activated, an electrostatic actuation force is
>>> applied to the sensor, simulating a small acceleration.
>>>
>>> Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
>> The most common option for self tests is to do them on startup
>> and spit out an error if they fail to give the expected
>> result.  The advantage is that we avoid a little used and
>> not terribly well defined (in general!) ABI element.
>> This is far from the only part supporting self tests
>> so we need to be careful with adding a new ABI.
>>
>> Would doing it on startup work here?
>> Clearly you'd have to apply the self test and define some boundaries
>> on the expected result for correct operation (vs not having it on)
>> and hope no one starts the device up whilst accelerating a lot.
>>
>> I guess on this one a warning would be the way to go rather than
>> an error as huge real accelerations are more than possible.
> 
>The problem with doing it on startup is there is no way for userspace to get the result, except by parsing the kernel logs (yuk).
Agreed.  The ability to report hardware failures in a more coherent
way is something a lot of people have been asking for for ages, but
I don't think anyone has yet come up with a better option.
> And it would more or less preclude implementing a "maintenance mode"
> test menu.
You could remove and reprobe the device, but that would be hideous!
Seems like a good usecase for lots of devices.
> 
> So, at least for my usecase, doing it *only* on startup wouldn't work
> (a case could be made for having it done on startup *and* on explicit
> request).
The both option sounds sensible.
> 
> Note that I'm not adding a new *generic* ABI here, but a device
> specific one (there are other devices that have specific attributes
> too). I agree that a generic ABI would be better but is it possible
> to define one that would suite all devices? I don't know enough about
> the other devices to answer that question.
Hmm.. Interesting question. Mostly device specific ABIs exist for the
really unusual elements (and often they end up becoming common in the
future!).
> 
> I'm also not doing a complete test giving a "GO / NO GO" result but
> rather just providing a means of switching the actuator on and
> letting userspace observe the difference via the standard ABI (which
> avoids the problems with defining thresholds etc - or at least pushes
> them to userspace).
I wonder how generic an ABI we can come up with. 
Ultimately you tend to have some 'magic setting' that leads to a known
change in the value read.  There might be more than one of these, but
that's about it.  Doesn't sound implausible to have a generic ABI for this
to me...

Lars, quite a few Analog parts have self tests.  What do you think of
such an interface?
> 
> But, if we don't (yet?), have a consensus for a self test ABI I'll
> drop this patch for the moment and keep it in my tree for now.

You are convincing me that this is a lot more interesting than it
seems at first glance :)
> 
> Regards,
> 
> Martin

  reply	other threads:[~2015-05-07 23:33 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 14:15 [PATCH V3 0/9] iio: mma8452 enhancements Martin Fuzzey
2015-02-19 14:15 ` [PATCH 1/9] iio: mma8452: Initialise before activating Martin Fuzzey
2015-02-25 12:12   ` Jonathan Cameron
2015-02-25 23:05   ` Peter Meerwald
2015-04-16 20:34   ` Hartmut Knaack
2015-02-19 14:15 ` [PATCH 2/9] iio: mma8452: Add access to registers via DebugFS Martin Fuzzey
2015-04-16 20:50   ` Hartmut Knaack
2015-02-19 14:16 ` [PATCH 3/9] iio: core: add high pass filter attributes Martin Fuzzey
2015-04-16 21:05   ` Hartmut Knaack
2015-02-19 14:16 ` [PATCH 4/9] iio: mma8452: Basic support for transient events Martin Fuzzey
2015-02-25 12:25   ` Jonathan Cameron
2015-04-29 12:52     ` Martin Fuzzey
2015-05-08 13:58       ` Jonathan Cameron
2015-05-12 14:14         ` Martin Fuzzey
2015-05-12 19:08           ` Jonathan Cameron
2015-02-25 23:09   ` Peter Meerwald
2015-04-16 22:30   ` Hartmut Knaack
2015-02-19 14:16 ` [PATCH 5/9] iio: doc: Describe scale attributes for event thresholds Martin Fuzzey
2015-03-09 13:31   ` Jonathan Cameron
2015-04-16 22:36     ` Hartmut Knaack
2015-04-18 11:24       ` Jonathan Cameron
2015-02-19 14:16 ` [PATCH 6/9] iio: mma8452: Add support for transient event debouncing Martin Fuzzey
2015-04-17 21:47   ` Hartmut Knaack
2015-02-19 14:16 ` [PATCH 7/9] iio: mma8452: Add highpass filter configuration Martin Fuzzey
2015-02-25 22:45   ` Peter Meerwald
2015-02-19 14:16 ` [PATCH 8/9] iio: mma8452: Add support for interrupt driven triggers Martin Fuzzey
2015-02-19 14:16 ` [PATCH 9/9] iio: mma8452: add support for self test Martin Fuzzey
2015-02-25 22:54   ` Peter Meerwald
2015-03-09 13:37   ` Jonathan Cameron
2015-04-29  8:05     ` Martin Fuzzey
2015-05-07 23:13       ` Jonathan Cameron [this message]
2015-02-25 23:11 ` [PATCH V3 0/9] iio: mma8452 enhancements Peter Meerwald
2015-03-09 13:49   ` 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=554BF193.7000208@kernel.org \
    --to=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=mfuzzey@parkeon.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;
as well as URLs for NNTP newsgroup(s).