Linux IIO development
 help / color / mirror / Atom feed
* iio_trigger_poll from IRQ thread
@ 2022-01-26 14:43 Hegbeli, Ciprian
  2022-01-26 19:16 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Hegbeli, Ciprian @ 2022-01-26 14:43 UTC (permalink / raw)
  To: linux-iio@vger.kernel.org

Hi, 

I'm currently trying to call iio_trigger_poll from the bottom-half of an interrupt handler and get the following waring;

[  101.814234] WARNING: CPU: 0 PID: 1204 at kernel/irq/handle.c:152 __handle_irq_event_percpu+0x234/0x238
[  101.814255] irq 60 handler irq_default_primary_handler+0x0/0x1c enabled interrupts
[  101.814268] Modules linked in: ade9078 cmac rfcomm bnep hci_uart btbcm bluetooth ecdh_generic ecc fuse 8021q garp brcmfmac brcmutil cfg80211 v3d rfkill spi_bcm2835 gpu_sched raspberrypi_hwmon bcm2835_codec(C) snd_bcm2835(C) bcm2835_v4l2(C) bcm2835_isp(C) v4l2_mem2mem bcm2835_mmal_vchiq(C) vc_sm_cma(C) rpivid_mem vc4 uio_pdrv_genirq uio i2c_dev ip_tables x_tables
[  101.814452] CPU: 0 PID: 1204 Comm: irq/58-ade9078 Tainted: G         C        5.4.83-v7l+ #7

This warning occurs only once, the first time it goes through this scenario, on a second passing through it I get no warning.
After reading online about it, the problem is related to disabling the interrupts prior to entering the IIO Handler. 
By doing this manually I don't get any Warnings, but it has been pointed out to me that this might not be a good solution.

I'm using the bottom-half of the handler because the interrupt requires reading the status register of the IC, which can be slow.
Unfortunately there is no way to insert the iio_trigger_poll in the top-half because all the checks are done in the bottom-half.

The trigger_handler reads the samples from an internal FIFO in the IC, I'm not sure if this detail is relevant or not. 

Regards,
Ciprian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-27  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-26 14:43 iio_trigger_poll from IRQ thread Hegbeli, Ciprian
2022-01-26 19:16 ` Jonathan Cameron
2022-01-27  8:11   ` Hegbeli, Ciprian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox