All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Fuzzey <mfuzzey@parkeon.com>
To: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Subject: Re: [PATCH 9/9] iio: mma8452: add support for self test.
Date: Wed, 29 Apr 2015 10:05:43 +0200	[thread overview]
Message-ID: <554090D7.50208@parkeon.com> (raw)
In-Reply-To: <54FDA200.7090209@kernel.org>

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).
And it would more or less preclude implementing a "maintenance mode" 
test menu.

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).

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.

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).

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.

Regards,

Martin

  reply	other threads:[~2015-04-29  8:05 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 [this message]
2015-05-07 23:13       ` Jonathan Cameron
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=554090D7.50208@parkeon.com \
    --to=mfuzzey@parkeon.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.