Skip to contentSkip to conversation

iio: trigger: Print an error if there is no available irq

PATCH Applied Mathieu Othacehe 2 participants 2 messages Feb 20, 2019 IIO

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iio: trigger: Print an error if there is no available irq

If there are more trigger consumers than CONFIG_IIO_CONSUMERS_PER_TRIGGER, iio_trigger_attach_poll_func will silently fail. Add an error message to inform the user that CONFIG_IIO_CONSUMERS_PER_TRIGGER limit might be exceeded.

---
 drivers/iio/industrialio-trigger.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/iio/industrialio-trigger.c +4 -1
index ce66699c7fcc..e5b538379ed1 100644
@@ -254,8 +254,11 @@ static int iio_trigger_attach_poll_func(struct iio_trigger *trig,
 
 	/* Get irq number */
 	pf->irq = iio_trigger_get_irq(trig);
-	if (pf->irq < 0)
+	if (pf->irq < 0) {
+		pr_err("Could not find an available irq for trigger %s, CONFIG_IIO_CONSUMERS_PER_TRIGGER=%d limit might be exceeded\n",
+			trig->name, CONFIG_IIO_CONSUMERS_PER_TRIGGER);
 		goto out_put_module;
+	}
 
 	/* Request irq */
 	ret = request_threaded_irq(pf->irq, pf->h, pf->thread,
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 6 lines · On Wed, 20 Feb 2019 17:49:10 +0100 Mathieu Othacehe <[email protected]>…

If there are more trigger consumers than CONFIG_IIO_CONSUMERS_PER_TRIGGER, iio_trigger_attach_poll_func will silently fail. Add an error message to inform the user that CONFIG_IIO_CONSUMERS_PER_TRIGGER limit might be exceeded.

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 21 lines
---
 drivers/iio/industrialio-trigger.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/iio/industrialio-trigger.c +4 -1
index ce66699c7fcc..e5b538379ed1 100644
@@ -254,8 +254,11 @@ static int iio_trigger_attach_poll_func(struct iio_trigger *trig,
 
 	/* Get irq number */
 	pf->irq = iio_trigger_get_irq(trig);
-	if (pf->irq < 0)
+	if (pf->irq < 0) {
+		pr_err("Could not find an available irq for trigger %s, CONFIG_IIO_CONSUMERS_PER_TRIGGER=%d limit might be exceeded\n",
+			trig->name, CONFIG_IIO_CONSUMERS_PER_TRIGGER);
 		goto out_put_module;
+	}
 
 	/* Request irq */
 	ret = request_threaded_irq(pf->irq, pf->h, pf->thread,