From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Bobby Jones <rjones@gateworks.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>,
Martin Kepplinger <martin.kepplinger@puri.sm>,
Jonathan Cameron <jic23@kernel.org>,
linux-iio@vger.kernel.org
Subject: Re: LSM9DS1 testing with st_lsm6dsx driver
Date: Sat, 21 Sep 2019 10:06:51 +0200 [thread overview]
Message-ID: <20190921080651.GA15821@localhost.localdomain> (raw)
In-Reply-To: <CALAE=UBH8ESTkXzrzK2_Tvt-vzVeOiewJFi_g4g2NsoUqwge1w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4897 bytes --]
> > > > LSM9DS1 does not support hw FIFO for the moment. Are you trying to enable
> > > > buffered reading?
> > >
> > > I am not manually interacting with the device at all when this
> > > exception occurs. This happens during the driver probe.
> > >
> > > > Could you please try if the following patch helps? (just compiled)
> > >
> > > I no longer receive the exception with this patch and it makes sense, thanks.
> >
> > Hi Bobby,
> >
> > thx a lot for testing. Could you please try to drop the previous patch and
> > apply the following one? Does it fix the issue as well?
>
> No problem, happy to help. I just tested, and unfortunately the issue
> is still present with this patch.
re-looking at the code this patch will actually does not anything since in the
current implementation st_lsm6dsx_handler_irq will return IRQ_NONE and the
thread handler will not be run. Anyway since st_lsm6dsx_handler_irq will be
removed soon I will respin this patch ontop of Sean series.
> I gave the datasheet and the hardware reference manual of the
> connected CPU a closer look and suspected a problem with my pin
> config. However even after various combinations of pull ups/downs and
> IRQ_TYPE_LEVEL_LOW/IRQ_TYPE_LEVEL_HIGH the same exception occurs, so I
> don't think that there's an issue with pin config stopping the
> interrupt line from being deasserted.
are you able to monitor the line activity through an oscilloscope?
The issue is the irq line is never asserted and the kernel complains about
lot of interrupts not managed
Looking at the datasheet, LSM9DS1 does not support IRQ_TYPE_LEVEL_LOW.
ST_LSM6DSX_REG_HLACTIVE_ADDR and ST_LSM6DSX_REG_PP_OD_ADDR registers are
actually not defined for LSM9DS1 and I will move them in hw_settings map.
@Jonathan: do you prefer this patch to be ontop of Sean's series?
Regards,
Lorenzo
>
> >
> > iio: imu: st_lsm6dsx: check read_fifo pointer in st_lsm6dsx_handler_thread
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> > index b0f3da1976e4..f4fd4842bd79 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> > @@ -666,6 +666,9 @@ static irqreturn_t st_lsm6dsx_handler_thread(int irq, void *private)
> > struct st_lsm6dsx_hw *hw = private;
> > int count;
> >
> > + if (!hw->settings->fifo_ops.read_fifo)
> > + return IRQ_NONE;
> > +
> > mutex_lock(&hw->fifo_lock);
> > count = hw->settings->fifo_ops.read_fifo(hw);
> > mutex_unlock(&hw->fifo_lock);
> > --
> > 2.21.0
> >
> > >
> > > For context I'm working with a board that has every data ready and
> > > interrupt signal connected to the LSM9DS1. Could you clarify what the
> > > proper usage of the "st,drdy-int-pin" would be in this case and
> > > whether or not I need more than one interrupt called out in my device
> > > tree node?
> > > I'm not really understanding how they're currently being utilized for
> > > this device in the driver.
> >
> > For the moment irq line in lsm9ds1 (acc/gyro) is not used at all,
> > so you can omit the "st,drdy-int-pin" property
> >
> > >
> > > Also, I know support for this device was added recently and the combo
> > > device hardware FIFO is complex, but is support for this something
> > > that's currently being worked on?
> >
> > It is actually in my ToDo list but I have no this device at the moment, so
> > patches are welcome :)
> >
> > Regards,
> > Lorenzo
> >
> > >
> > > Thanks,
> > > Bobby Jones
> > >
> > > > Regards,
> > > > Lorenzo
> > > >
> > > > iio: imu: st_lsm6dsx: do not configure the fifo if not supported
> > > >
> > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > ---
> > > > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > > > index b65a6ca775e0..90a0e5ce44e5 100644
> > > > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > > > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > > > @@ -1572,7 +1572,7 @@ int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id,
> > > > return err;
> > > > }
> > > >
> > > > - if (hw->irq > 0) {
> > > > + if (hw->irq > 0 && hw->settings->fifo_ops.update_fifo) {
> > > > err = st_lsm6dsx_fifo_setup(hw);
> > > > if (err < 0)
> > > > return err;
> > > > --
> > > > 2.21.0
> > > >
> > > >
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2019-09-21 8:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-20 0:53 LSM9DS1 testing with st_lsm6dsx driver Bobby Jones
2019-09-20 6:42 ` Lorenzo Bianconi
2019-09-20 18:39 ` Bobby Jones
2019-09-20 21:55 ` Lorenzo Bianconi
2019-09-20 23:21 ` Bobby Jones
2019-09-21 8:06 ` Lorenzo Bianconi [this message]
2019-09-23 23:23 ` Bobby Jones
2019-09-24 6:18 ` Lorenzo Bianconi
2019-09-24 17:30 ` Bobby Jones
2019-09-24 17:40 ` Lorenzo Bianconi
2019-09-24 18:21 ` Bobby Jones
2019-09-24 18:55 ` Lorenzo Bianconi
2019-10-05 11:22 ` Jonathan Cameron
2019-10-05 12:31 ` Lorenzo Bianconi
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=20190921080651.GA15821@localhost.localdomain \
--to=lorenzo@kernel.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=lorenzo.bianconi83@gmail.com \
--cc=martin.kepplinger@puri.sm \
--cc=rjones@gateworks.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