* [PATCH v2] iio: light: tsl2591: return actual error from probe IRQ failure [not found] <20260517181042.668-1-sozdayvek@gmail.com> @ 2026-05-18 9:43 ` Stepan Ionichev 2026-05-18 15:40 ` Jonathan Cameron 0 siblings, 1 reply; 7+ messages in thread From: Stepan Ionichev @ 2026-05-18 9:43 UTC (permalink / raw) To: jic23 Cc: dlechner, nuno.sa, andy, hcazarim, joshua.crofts1, gregkh, linux-iio, linux-kernel, stable, sozdayvek When devm_request_threaded_irq() fails, probe logs the error and then returns -EINVAL, dropping the real error code and breaking the deferred-probe flow for -EPROBE_DEFER. Return ret directly; the IRQ subsystem already prints on failure. Fixes: 2335f0d7c790 ("iio: light: Added AMS tsl2591 driver implementation") Cc: stable@vger.kernel.org Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> --- v2: - Drop dev_err_probe(); just return ret (Andy) - Add Cc: stable@ as suggested by Joshua v1: https://lore.kernel.org/all/20260517181042.668-1-sozdayvek@gmail.com/ drivers/iio/light/tsl2591.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c index c5557867e..c5ccd833d 100644 --- a/drivers/iio/light/tsl2591.c +++ b/drivers/iio/light/tsl2591.c @@ -1137,10 +1137,8 @@ static int tsl2591_probe(struct i2c_client *client) NULL, tsl2591_event_handler, IRQF_TRIGGER_FALLING | IRQF_ONESHOT, "tsl2591_irq", indio_dev); - if (ret) { - dev_err_probe(&client->dev, ret, "IRQ request error\n"); - return -EINVAL; - } + if (ret) + return ret; indio_dev->info = &tsl2591_info; } else { indio_dev->info = &tsl2591_info_no_irq; -- 2.43.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] iio: light: tsl2591: return actual error from probe IRQ failure 2026-05-18 9:43 ` [PATCH v2] iio: light: tsl2591: return actual error from probe IRQ failure Stepan Ionichev @ 2026-05-18 15:40 ` Jonathan Cameron 2026-05-18 15:43 ` Jonathan Cameron 0 siblings, 1 reply; 7+ messages in thread From: Jonathan Cameron @ 2026-05-18 15:40 UTC (permalink / raw) To: Stepan Ionichev Cc: dlechner, nuno.sa, andy, hcazarim, joshua.crofts1, gregkh, linux-iio, linux-kernel, stable On Mon, 18 May 2026 14:43:11 +0500 Stepan Ionichev <sozdayvek@gmail.com> wrote: > When devm_request_threaded_irq() fails, probe logs the error and > then returns -EINVAL, dropping the real error code and breaking the > deferred-probe flow for -EPROBE_DEFER. > > Return ret directly; the IRQ subsystem already prints on failure. > > Fixes: 2335f0d7c790 ("iio: light: Added AMS tsl2591 driver implementation") Hmm. To me borderline on whether it's a fix. In theory a board may exist where the defer is a possibility. In practice probably not given I don't think we've ever had a report of this. Meh, it's harmless enough and maybe helps someone. > Cc: stable@vger.kernel.org > Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> New series versions should never be in reply to older series. It tends to hide them in people's inboxes and brings little nor no benefit. > --- > v2: > - Drop dev_err_probe(); just return ret (Andy) > - Add Cc: stable@ as suggested by Joshua Mostly for IIO I add those to patches that I think need it but don't object if people feel strongly enough and add them themselves. Applied to the iio-fixes branch of iio.git. > > v1: https://lore.kernel.org/all/20260517181042.668-1-sozdayvek@gmail.com/ > > drivers/iio/light/tsl2591.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c > index c5557867e..c5ccd833d 100644 > --- a/drivers/iio/light/tsl2591.c > +++ b/drivers/iio/light/tsl2591.c > @@ -1137,10 +1137,8 @@ static int tsl2591_probe(struct i2c_client *client) > NULL, tsl2591_event_handler, > IRQF_TRIGGER_FALLING | IRQF_ONESHOT, > "tsl2591_irq", indio_dev); > - if (ret) { > - dev_err_probe(&client->dev, ret, "IRQ request error\n"); > - return -EINVAL; > - } > + if (ret) > + return ret; > indio_dev->info = &tsl2591_info; > } else { > indio_dev->info = &tsl2591_info_no_irq; ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] iio: light: tsl2591: return actual error from probe IRQ failure 2026-05-18 15:40 ` Jonathan Cameron @ 2026-05-18 15:43 ` Jonathan Cameron 2026-06-03 17:23 ` Jonathan Cameron 0 siblings, 1 reply; 7+ messages in thread From: Jonathan Cameron @ 2026-05-18 15:43 UTC (permalink / raw) To: Stepan Ionichev Cc: dlechner, nuno.sa, andy, hcazarim, joshua.crofts1, gregkh, linux-iio, linux-kernel, stable On Mon, 18 May 2026 16:40:48 +0100 Jonathan Cameron <jic23@kernel.org> wrote: > On Mon, 18 May 2026 14:43:11 +0500 > Stepan Ionichev <sozdayvek@gmail.com> wrote: > > > When devm_request_threaded_irq() fails, probe logs the error and > > then returns -EINVAL, dropping the real error code and breaking the > > deferred-probe flow for -EPROBE_DEFER. > > > > Return ret directly; the IRQ subsystem already prints on failure. > > > > Fixes: 2335f0d7c790 ("iio: light: Added AMS tsl2591 driver implementation") > > Hmm. To me borderline on whether it's a fix. In theory a board may exist > where the defer is a possibility. In practice probably not given I don't > think we've ever had a report of this. > > Meh, it's harmless enough and maybe helps someone. > > > Cc: stable@vger.kernel.org > > Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> > New series versions should never be in reply to older series. > > It tends to hide them in people's inboxes and brings little nor no benefit. > > --- > > v2: > > - Drop dev_err_probe(); just return ret (Andy) > > - Add Cc: stable@ as suggested by Joshua > Mostly for IIO I add those to patches that I think need it but don't object > if people feel strongly enough and add them themselves. > > Applied to the iio-fixes branch of iio.git. > Actually dropped again. I forgot to check sashiko and it raises a reasonable question: https://sashiko.dev/#/patchset/20260518094311.2000-1-sozdayvek%40gmail.com Does completely removing dev_err_probe() here drop the deferred probe reason tracking? While this patch successfully fixes the return code, dev_err_probe() also records the deferral reason in debugfs via device_set_deferred_probe_reason() when ret is -EPROBE_DEFER. Could we keep the diagnostic tracking by returning the result of dev_err_probe() directly instead? if (ret) return dev_err_probe(&client->dev, ret, "IRQ request error\n"); Andy, what do you think? > > > > v1: https://lore.kernel.org/all/20260517181042.668-1-sozdayvek@gmail.com/ > > > > drivers/iio/light/tsl2591.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c > > index c5557867e..c5ccd833d 100644 > > --- a/drivers/iio/light/tsl2591.c > > +++ b/drivers/iio/light/tsl2591.c > > @@ -1137,10 +1137,8 @@ static int tsl2591_probe(struct i2c_client *client) > > NULL, tsl2591_event_handler, > > IRQF_TRIGGER_FALLING | IRQF_ONESHOT, > > "tsl2591_irq", indio_dev); > > - if (ret) { > > - dev_err_probe(&client->dev, ret, "IRQ request error\n"); > > - return -EINVAL; > > - } > > + if (ret) > > + return ret; > > indio_dev->info = &tsl2591_info; > > } else { > > indio_dev->info = &tsl2591_info_no_irq; > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] iio: light: tsl2591: return actual error from probe IRQ failure 2026-05-18 15:43 ` Jonathan Cameron @ 2026-06-03 17:23 ` Jonathan Cameron 2026-06-04 7:25 ` Andy Shevchenko 0 siblings, 1 reply; 7+ messages in thread From: Jonathan Cameron @ 2026-06-03 17:23 UTC (permalink / raw) To: Stepan Ionichev Cc: dlechner, nuno.sa, andy, hcazarim, joshua.crofts1, gregkh, linux-iio, linux-kernel, stable On Mon, 18 May 2026 16:43:09 +0100 Jonathan Cameron <jic23@kernel.org> wrote: > On Mon, 18 May 2026 16:40:48 +0100 > Jonathan Cameron <jic23@kernel.org> wrote: > > > On Mon, 18 May 2026 14:43:11 +0500 > > Stepan Ionichev <sozdayvek@gmail.com> wrote: > > > > > When devm_request_threaded_irq() fails, probe logs the error and > > > then returns -EINVAL, dropping the real error code and breaking the > > > deferred-probe flow for -EPROBE_DEFER. > > > > > > Return ret directly; the IRQ subsystem already prints on failure. > > > > > > Fixes: 2335f0d7c790 ("iio: light: Added AMS tsl2591 driver implementation") > > > > Hmm. To me borderline on whether it's a fix. In theory a board may exist > > where the defer is a possibility. In practice probably not given I don't > > think we've ever had a report of this. > > > > Meh, it's harmless enough and maybe helps someone. > > > > > Cc: stable@vger.kernel.org > > > Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> > > New series versions should never be in reply to older series. > > > > It tends to hide them in people's inboxes and brings little nor no benefit. > > > --- > > > v2: > > > - Drop dev_err_probe(); just return ret (Andy) > > > - Add Cc: stable@ as suggested by Joshua > > Mostly for IIO I add those to patches that I think need it but don't object > > if people feel strongly enough and add them themselves. > > > > Applied to the iio-fixes branch of iio.git. > > > Actually dropped again. I forgot to check sashiko and it raises a reasonable > question: > https://sashiko.dev/#/patchset/20260518094311.2000-1-sozdayvek%40gmail.com > > Does completely removing dev_err_probe() here drop the deferred probe reason > tracking? > While this patch successfully fixes the return code, dev_err_probe() also > records the deferral reason in debugfs via device_set_deferred_probe_reason() > when ret is -EPROBE_DEFER. > Could we keep the diagnostic tracking by returning the result of > dev_err_probe() directly instead? > if (ret) > return dev_err_probe(&client->dev, ret, "IRQ request error\n"); > > Andy, what do you think? Andy? This is a change you might have asked for, but sashiko is correctly noting that we might loose a deferred reason even if the print is otherwise useless. Jonathan > > > > > > > v1: https://lore.kernel.org/all/20260517181042.668-1-sozdayvek@gmail.com/ > > > > > > drivers/iio/light/tsl2591.c | 6 ++---- > > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c > > > index c5557867e..c5ccd833d 100644 > > > --- a/drivers/iio/light/tsl2591.c > > > +++ b/drivers/iio/light/tsl2591.c > > > @@ -1137,10 +1137,8 @@ static int tsl2591_probe(struct i2c_client *client) > > > NULL, tsl2591_event_handler, > > > IRQF_TRIGGER_FALLING | IRQF_ONESHOT, > > > "tsl2591_irq", indio_dev); > > > - if (ret) { > > > - dev_err_probe(&client->dev, ret, "IRQ request error\n"); > > > - return -EINVAL; > > > - } > > > + if (ret) > > > + return ret; > > > indio_dev->info = &tsl2591_info; > > > } else { > > > indio_dev->info = &tsl2591_info_no_irq; > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] iio: light: tsl2591: return actual error from probe IRQ failure 2026-06-03 17:23 ` Jonathan Cameron @ 2026-06-04 7:25 ` Andy Shevchenko 2026-06-04 7:26 ` Andy Shevchenko 0 siblings, 1 reply; 7+ messages in thread From: Andy Shevchenko @ 2026-06-04 7:25 UTC (permalink / raw) To: Jonathan Cameron Cc: Stepan Ionichev, dlechner, nuno.sa, andy, hcazarim, joshua.crofts1, gregkh, linux-iio, linux-kernel, stable On Wed, Jun 03, 2026 at 06:23:45PM +0100, Jonathan Cameron wrote: > On Mon, 18 May 2026 16:43:09 +0100 > Jonathan Cameron <jic23@kernel.org> wrote: > > On Mon, 18 May 2026 16:40:48 +0100 > > Jonathan Cameron <jic23@kernel.org> wrote: ... > > https://sashiko.dev/#/patchset/20260518094311.2000-1-sozdayvek%40gmail.com > > > > Does completely removing dev_err_probe() here drop the deferred probe reason > > tracking? > > While this patch successfully fixes the return code, dev_err_probe() also > > records the deferral reason in debugfs via device_set_deferred_probe_reason() > > when ret is -EPROBE_DEFER. > > Could we keep the diagnostic tracking by returning the result of > > dev_err_probe() directly instead? > > if (ret) > > return dev_err_probe(&client->dev, ret, "IRQ request error\n"); > > > > Andy, what do you think? > Andy? > > This is a change you might have asked for, but sashiko is correctly noting > that we might loose a deferred reason even if the print is otherwise useless. Incorrectly. IRQ core prints an error via dev_err_probe(). Did I miss something? -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] iio: light: tsl2591: return actual error from probe IRQ failure 2026-06-04 7:25 ` Andy Shevchenko @ 2026-06-04 7:26 ` Andy Shevchenko 2026-07-03 19:10 ` Jonathan Cameron 0 siblings, 1 reply; 7+ messages in thread From: Andy Shevchenko @ 2026-06-04 7:26 UTC (permalink / raw) To: Jonathan Cameron Cc: Stepan Ionichev, dlechner, nuno.sa, andy, hcazarim, joshua.crofts1, gregkh, linux-iio, linux-kernel, stable On Thu, Jun 04, 2026 at 10:25:09AM +0300, Andy Shevchenko wrote: > On Wed, Jun 03, 2026 at 06:23:45PM +0100, Jonathan Cameron wrote: > > On Mon, 18 May 2026 16:43:09 +0100 > > Jonathan Cameron <jic23@kernel.org> wrote: > > > On Mon, 18 May 2026 16:40:48 +0100 > > > Jonathan Cameron <jic23@kernel.org> wrote: ... > > > https://sashiko.dev/#/patchset/20260518094311.2000-1-sozdayvek%40gmail.com > > > > > > Does completely removing dev_err_probe() here drop the deferred probe reason > > > tracking? > > > While this patch successfully fixes the return code, dev_err_probe() also > > > records the deferral reason in debugfs via device_set_deferred_probe_reason() > > > when ret is -EPROBE_DEFER. > > > Could we keep the diagnostic tracking by returning the result of > > > dev_err_probe() directly instead? > > > if (ret) > > > return dev_err_probe(&client->dev, ret, "IRQ request error\n"); > > > > > > Andy, what do you think? > > Andy? > > > > This is a change you might have asked for, but sashiko is correctly noting > > that we might loose a deferred reason even if the print is otherwise useless. > > Incorrectly. IRQ core prints an error via dev_err_probe(). Did I miss something? I'm referring to implementation of devm_request_result() in kernel/irq/devres.c. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] iio: light: tsl2591: return actual error from probe IRQ failure 2026-06-04 7:26 ` Andy Shevchenko @ 2026-07-03 19:10 ` Jonathan Cameron 0 siblings, 0 replies; 7+ messages in thread From: Jonathan Cameron @ 2026-07-03 19:10 UTC (permalink / raw) To: Andy Shevchenko Cc: Stepan Ionichev, dlechner, nuno.sa, andy, hcazarim, joshua.crofts1, gregkh, linux-iio, linux-kernel, stable On Thu, 4 Jun 2026 10:26:02 +0300 Andy Shevchenko <andriy.shevchenko@intel.com> wrote: > On Thu, Jun 04, 2026 at 10:25:09AM +0300, Andy Shevchenko wrote: > > On Wed, Jun 03, 2026 at 06:23:45PM +0100, Jonathan Cameron wrote: > > > On Mon, 18 May 2026 16:43:09 +0100 > > > Jonathan Cameron <jic23@kernel.org> wrote: > > > > On Mon, 18 May 2026 16:40:48 +0100 > > > > Jonathan Cameron <jic23@kernel.org> wrote: > > ... > > > > > https://sashiko.dev/#/patchset/20260518094311.2000-1-sozdayvek%40gmail.com > > > > > > > > Does completely removing dev_err_probe() here drop the deferred probe reason > > > > tracking? > > > > While this patch successfully fixes the return code, dev_err_probe() also > > > > records the deferral reason in debugfs via device_set_deferred_probe_reason() > > > > when ret is -EPROBE_DEFER. > > > > Could we keep the diagnostic tracking by returning the result of > > > > dev_err_probe() directly instead? > > > > if (ret) > > > > return dev_err_probe(&client->dev, ret, "IRQ request error\n"); > > > > > > > > Andy, what do you think? > > > Andy? > > > > > > This is a change you might have asked for, but sashiko is correctly noting > > > that we might loose a deferred reason even if the print is otherwise useless. > > > > Incorrectly. IRQ core prints an error via dev_err_probe(). Did I miss something? > > I'm referring to implementation of devm_request_result() in kernel/irq/devres.c. > Oops. I almost lost this one. Patchwork had my back though. Applied. Jonathan ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-07-03 19:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260517181042.668-1-sozdayvek@gmail.com>
2026-05-18 9:43 ` [PATCH v2] iio: light: tsl2591: return actual error from probe IRQ failure Stepan Ionichev
2026-05-18 15:40 ` Jonathan Cameron
2026-05-18 15:43 ` Jonathan Cameron
2026-06-03 17:23 ` Jonathan Cameron
2026-06-04 7:25 ` Andy Shevchenko
2026-06-04 7:26 ` Andy Shevchenko
2026-07-03 19:10 ` Jonathan Cameron
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox