From: Martin Kepplinger <martink@posteo.de>
To: Leonard Crestez <leonard.crestez@nxp.com>,
Harinath Nampally <harinath922@gmail.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: mma8452: Fix ignoring MMA8452_INT_DRDY
Date: Wed, 20 Jun 2018 11:15:53 +0200 [thread overview]
Message-ID: <55337e35-a4f7-e543-6384-e1f523d3f463@posteo.de> (raw)
In-Reply-To: <d3cdb3fef8434663c95b7b2f799c5ee4446a5231.1528397238.git.leonard.crestez@nxp.com>
[-- Attachment #1: Type: text/plain, Size: 1796 bytes --]
On 2018-06-07 20:52, Leonard Crestez wrote:
> Interrupts are ignored if no event bit is set in the status status
> register and this breaks the buffer interface. No data is shown when
> running "iio_generic_buffer -n mma8451 -a" and interrupt counts go
> crazy.
>
> Fix by not returning IRQ_NONE if DRDY is set.
>
> Fixes: 605f72de137a ("iio: accel: mma8452: improvements to handle
> multiple events")
>
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
At least this does no harm to events. So if this solves your problem:
Acked-by: Martin Kepplinger <martink@posteo.de>
thanks,
martin
>
> ---
> drivers/iio/accel/mma8452.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Perhaps this whole early-exit check could be dropped? It is not clear
> how it helps.
>
> If for some models we want to ignore unsupported events then maybe this
> should be checked for each individual bit. Instead of
>
> if (src & MMA8452_INT_FF_MT) {
>
> Check for:
>
> if ((src & MMA8452_INT_FF_MT) && (data->chip_info->enabled_events & MMA8452_INT_FF_MT))
>
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index 7a2da7f9d4dc..5485b35fe553 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -1032,11 +1032,11 @@ static irqreturn_t mma8452_interrupt(int irq, void *p)
>
> src = i2c_smbus_read_byte_data(data->client, MMA8452_INT_SRC);
> if (src < 0)
> return IRQ_NONE;
>
> - if (!(src & data->chip_info->enabled_events))
> + if (!(src & (data->chip_info->enabled_events | MMA8452_INT_DRDY)))
> return IRQ_NONE;
>
> if (src & MMA8452_INT_DRDY) {
> iio_trigger_poll_chained(indio_dev->trig);
> ret = IRQ_HANDLED;
>
[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 1795 bytes --]
next prev parent reply other threads:[~2018-06-20 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-07 18:52 Leonard Crestez
2018-06-20 9:15 ` Martin Kepplinger [this message]
2018-06-22 1:34 ` harinath Nampally
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=55337e35-a4f7-e543-6384-e1f523d3f463@posteo.de \
--to=martink@posteo.de \
--cc=Jonathan.Cameron@huawei.com \
--cc=harinath922@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=leonard.crestez@nxp.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®