diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-09-20 14:25:47 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-12-03 19:40:25 +0000 |
commit | 01d37c8318d0e624e3df63b53e4c3efa0aecb187 (patch) | |
tree | 4668bd93b1513cb7fc281c2edf04a7d425a7dec7 /drivers/iio | |
parent | 34fce6cadf3b913fce7104b802110dedbccc5dcc (diff) |
iio: Fix: Do not poll the driver again if try_reenable() callback returns non 0.
The original reason for this behaviour is long gone and no current
drivers are making use of this function correctly. Note however, that
you would be very unlucky to actually hit the problem as it would
require a bus comms failure in the callback.
This dates back a long way. The original board on which I did a lot
of early IIO development only supported edge interrupts, but some of the
sensors were level interrupt based. As such, the lis3l02dq driver did
a dance with checking a GPIO to identify if it should retrigger.
That was an unsustainable hack so we later just stopped supporting interrupts
for that particular combination.
There are a number of drivers where a fault on a bus read in the
try_reenable() callback will result in them returning non 0 and
incorrectly then causing iio_trigger_poll() to be called.
Anyhow, this handling is unused and causing issues so let us rip it out.
Link: https://lore.kernel.org/linux-iio/20200813075358.13310-1-lars@metafoo.de/
After this the try_reenable() naming makes no sense, so as a follow up
patch I'll rename it to simply reenable(). I haven't done that here
as it will add noise to the fix for backporting.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Christian Eggers <ceggers@arri.de>
Link: https://lore.kernel.org/r/20200920132548.196452-2-jic23@kernel.org
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/industrialio-trigger.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index 583bb51f65a7..f902be90980b 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -204,9 +204,7 @@ void iio_trigger_notify_done(struct iio_trigger *trig) { if (atomic_dec_and_test(&trig->use_count) && trig->ops && trig->ops->try_reenable) - if (trig->ops->try_reenable(trig)) - /* Missed an interrupt so launch new poll now */ - iio_trigger_poll(trig); + trig->ops->try_reenable(trig); } EXPORT_SYMBOL(iio_trigger_notify_done); |