linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Peter Meerwald <pmeerw@pmeerw.net>, linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/5] iio:magnetometer:mag3110: Report busy in _read_raw() / write_raw() when buffer is enabled
Date: Sat, 11 Jan 2014 12:13:30 +0000	[thread overview]
Message-ID: <52D1356A.8010108@kernel.org> (raw)
In-Reply-To: <52D13408.4040103@kernel.org>



On 11/01/14 12:07, Jonathan Cameron wrote:
> On 10/01/14 21:59, Peter Meerwald wrote:
>> individual reads are not permitted concurrently with buffered reads
>>
> This isn't technically a requirement.  The reasoning behind doing it
> is normally that a userspace read could mess up the timing of a fixed
> frequency triggered signal.  I guess that's true here but is probably
> not a strong enough reason to make an ABI change.
>
> Perhaps an ammended description to describe the reasoning for not
> allowing it in this driver?
>
> While obscure this is an ABI change as reads that would previously
> have succeeded will fail (I doubt anyone will notice, but you never
> know...)
>
> The arguement for protecting against changes in the sampling frequency
> is perhaps a little stronger as that may cause nasty issues in the buffered
> read...

Ah, I'd forgotten we only merged this very recently.  I think this counts as a fix,
so will queue it up for after the merge window.  As the original ABI was never in
a release kernel we can change it without worrying ;)

There's a new temporary branch for iio.git containing this
fixes-for-3.14new


>> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
>> ---
>>   drivers/iio/magnetometer/mag3110.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c
>> index 4b65b6d..b88cb44 100644
>> --- a/drivers/iio/magnetometer/mag3110.c
>> +++ b/drivers/iio/magnetometer/mag3110.c
>> @@ -154,6 +154,9 @@ static int mag3110_read_raw(struct iio_dev *indio_dev,
>>
>>       switch (mask) {
>>       case IIO_CHAN_INFO_RAW:
>> +        if (iio_buffer_enabled(indio_dev))
>> +            return -EBUSY;
>> +
>>           switch (chan->type) {
>>           case IIO_MAGN: /* in 0.1 uT / LSB */
>>               ret = mag3110_read(data, buffer);
>> @@ -199,6 +202,9 @@ static int mag3110_write_raw(struct iio_dev *indio_dev,
>>       struct mag3110_data *data = iio_priv(indio_dev);
>>       int rate;
>>
>> +    if (iio_buffer_enabled(indio_dev))
>> +        return -EBUSY;
>> +
>>       switch (mask) {
>>       case IIO_CHAN_INFO_SAMP_FREQ:
>>           rate = mag3110_get_samp_freq_index(data, val, val2);
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2014-01-11 12:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10 21:59 [PATCH 1/5] iio:magnetometer:mag3110: Report busy in _read_raw() / write_raw() when buffer is enabled Peter Meerwald
2014-01-10 21:59 ` [PATCH 2/5] iio:magnetometer:mag3110: Fix output of decimal digits in show_int_plus_micros() Peter Meerwald
2014-01-11 12:14   ` Jonathan Cameron
2014-01-10 21:59 ` [PATCH 3/5] iio:magnetometer:mag3110: Scale factor missing for temperature Peter Meerwald
2014-01-11 16:08   ` Jonathan Cameron
2014-01-10 21:59 ` [PATCH 4/5] iio:magnetometer:mag3110: Fix initialization of ctrl_reg1 Peter Meerwald
2014-01-11 16:09   ` Jonathan Cameron
2014-01-10 21:59 ` [PATCH 5/5] iio:magnetometer:mag3110: Enable user offset calibration Peter Meerwald
2014-01-11 16:10   ` Jonathan Cameron
2014-01-11 12:07 ` [PATCH 1/5] iio:magnetometer:mag3110: Report busy in _read_raw() / write_raw() when buffer is enabled Jonathan Cameron
2014-01-11 12:13   ` Jonathan Cameron [this message]

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=52D1356A.8010108@kernel.org \
    --to=jic23@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).