* [PATCH 0/7] staging: Remove redundant error messages on IRQ request failure
@ 2026-07-20 13:43 Pan Chuang
2026-07-20 13:43 ` [PATCH 2/7] staging: fbtft: Remove redundant dev_err_probe() Pan Chuang
0 siblings, 1 reply; 4+ messages in thread
From: Pan Chuang @ 2026-07-20 13:43 UTC (permalink / raw)
To: Greg Kroah-Hartman, Andy Shevchenko, Vaibhav Hiremath,
Johan Hovold, Alex Elder, Nuno Sá, Michael Hennerich,
Jonathan Cameron, David Lechner, Hans de Goede,
Mauro Carvalho Chehab, Sakari Ailus, Parthiban Veerasooran,
Christian Gromm, Marc Dietrich, Ovidiu Panait, Dan Carpenter,
Gustavo Piaz da Silva, Pan Chuang, Chelsy Ratnawat,
Gabriel Rondon, Artem Lytkin, Zeeshan Ahmad, Rajveer Chaudhari,
Ethan Tidmore, Batu Ada Tutkun, open list:STAGING SUBSYSTEM,
open list, open list:FBTFT Framebuffer drivers,
open list:FBTFT Framebuffer drivers,
moderated list:GREYBUS SUBSYSTEM,
open list:ANALOG DEVICES INC IIO DRIVERS,
open list:STAGING - INDUSTRIAL IO,
open list:STAGING - ATOMISP DRIVER,
moderated list:STAGING - NVIDIA COMPLIANT EMBEDDED CONTROLLER...,
open list:STAGING - NVIDIA COMPLIANT EMBEDDED CONTROLLER...
devm_request_threaded_irq() and devm_request_any_context_irq()
automatically log detailed error messages on failure via
the devm_request_result() helper, which prints device
name, IRQ number, handler functions, and error code.
Since devm_request_irq() is a static inline wrapper around
devm_request_threaded_irq(), it also benefits from this
automatic logging.
Remove the now-redundant dev_err() and dev_err_probe() calls
in staging drivers that follow these devm_request_*_irq()
functions, as the core now provides more detailed diagnostic
information on failure.
Pan Chuang (7):
staging: axis-fifo: Remove redundant dev_err()
staging: fbtft: Remove redundant dev_err_probe()
staging: greybus: arche-platform: Remove redundant dev_err()
staging: iio: adt7316: Remove redundant dev_err()
media: atomisp: Remove redundant dev_err()
staging: most: dim2: Remove redundant dev_err()
staging: nvec: Remove redundant dev_err_probe()
drivers/staging/axis-fifo/axis-fifo.c | 5 +----
drivers/staging/fbtft/fb_st7789v.c | 2 +-
drivers/staging/greybus/arche-platform.c | 4 +---
drivers/staging/iio/addac/adt7316.c | 5 +----
drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 4 +---
drivers/staging/most/dim2/dim2.c | 8 ++------
drivers/staging/nvec/nvec.c | 2 +-
7 files changed, 8 insertions(+), 22 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/7] staging: fbtft: Remove redundant dev_err_probe()
2026-07-20 13:43 [PATCH 0/7] staging: Remove redundant error messages on IRQ request failure Pan Chuang
@ 2026-07-20 13:43 ` Pan Chuang
2026-07-20 14:04 ` sashiko-bot
2026-07-20 18:18 ` Andy Shevchenko
0 siblings, 2 replies; 4+ messages in thread
From: Pan Chuang @ 2026-07-20 13:43 UTC (permalink / raw)
To: Andy Shevchenko, Greg Kroah-Hartman, Pan Chuang,
open list:FBTFT Framebuffer drivers,
open list:FBTFT Framebuffer drivers, open list:STAGING SUBSYSTEM,
open list
Since commit
55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"),
devm_request_irq() automatically logs detailed error messages on
failure. Remove the now-redundant driver-specific dev_err_probe() calls.
Signed-off-by: Pan Chuang <panchuang@vivo.com>
---
drivers/staging/fbtft/fb_st7789v.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/fbtft/fb_st7789v.c b/drivers/staging/fbtft/fb_st7789v.c
index 861a154144e6..ec46ad3f6a91 100644
--- a/drivers/staging/fbtft/fb_st7789v.c
+++ b/drivers/staging/fbtft/fb_st7789v.c
@@ -119,7 +119,7 @@ static int init_tearing_effect_line(struct fbtft_par *par)
rc = devm_request_irq(dev, irq_te, panel_te_handler,
IRQF_TRIGGER_RISING, "TE_GPIO", par);
if (rc)
- return dev_err_probe(dev, rc, "TE IRQ request failed.\n");
+ return rc;
disable_irq_nosync(irq_te);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/7] staging: fbtft: Remove redundant dev_err_probe()
2026-07-20 13:43 ` [PATCH 2/7] staging: fbtft: Remove redundant dev_err_probe() Pan Chuang
@ 2026-07-20 14:04 ` sashiko-bot
2026-07-20 18:18 ` Andy Shevchenko
1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-07-20 14:04 UTC (permalink / raw)
To: Pan Chuang; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
Pre-existing issues:
- [High] The driver relies on static global variables (`irq_te` and `panel_te`) to manage device-specific IRQ and synchronization state, which breaks multi-device configurations and can cause Use-After-Free bugs.
- [Medium] In the display update path `write_vmem()`, the tearing effect (TE) interrupt is enabled before the completion structure is reinitialized, creating a race window that can lead to missed TE events and unnecessary timeouts.
- [Medium] The driver prematurely frees the `te` GPIO descriptor via `gpiod_put(te)` immediately after converting it to an IRQ, allowing the pin to be reconfigured or powered down.
--
--- Patch [2]: [PATCH 2/7] staging: fbtft: Remove redundant dev_err_probe() ---
commit ac4d01370b4ee0a3ff08280bd824b5b8e0c0efe6
Author: Pan Chuang <panchuang@vivo.com>
staging: fbtft: Remove redundant dev_err_probe()
Since commit
55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"),
devm_request_irq() automatically logs detailed error messages on
failure. Remove the now-redundant driver-specific dev_err_probe() calls.
> diff --git a/drivers/staging/fbtft/fb_st7789v.c b/drivers/staging/fbtft/fb_st7789v.c
> index 861a154144e66..ec46ad3f6a918 100644
> --- a/drivers/staging/fbtft/fb_st7789v.c
> +++ b/drivers/staging/fbtft/fb_st7789v.c
> @@ -119,7 +119,7 @@ static int init_tearing_effect_line(struct fbtft_par *par)
> rc = devm_request_irq(dev, irq_te, panel_te_handler,
> IRQF_TRIGGER_RISING, "TE_GPIO", par);
[Severity: High]
This isn't a bug introduced by this patch, but does using the global
variables irq_te and panel_te break multi-device configurations?
If multiple displays are probed, the global irq_te will be overwritten.
Subsequent display updates from any panel will then manipulate the irq of
the most recently probed panel.
If one panel is unbound, devres frees its irq, but irq_te retains the freed
irq number, potentially leading to an invalid enable_irq() call on a
released irq.
> if (rc)
> - return dev_err_probe(dev, rc, "TE IRQ request failed.\n");
> + return rc;
>
> disable_irq_nosync(irq_te);
>
[Severity: Medium]
This is a pre-existing issue, but does the driver prematurely free the te
gpio descriptor in init_tearing_effect_line() just before this?
drivers/staging/fbtft/fb_st7789v.c:init_tearing_effect_line() {
...
irq = gpiod_to_irq(te);
/* GPIO is locked as an IRQ, we may drop the reference */
gpiod_put(te);
if (irq < 0)
return irq;
...
}
Calling gpiod_put() completely frees the descriptor and marks it as
unrequested in the gpiolib core. Doesn't this allow other drivers or
userspace tools to request the gpio and reconfigure its direction, which
would silently break the te interrupt line?
[Severity: Medium]
This isn't a bug introduced by this patch, but is there a race condition in
write_vmem() when enabling the tearing effect interrupt?
drivers/staging/fbtft/fb_st7789v.c:write_vmem() {
...
if (irq_te) {
enable_irq(irq_te);
reinit_completion(&panel_te);
...
}
By enabling the irq before resetting the completion, could an interrupt
arrive in this tiny window?
If it does, the handler completes the event, but the main thread
immediately resets the completion state and waits, missing the event.
Could this regression lead to unnecessary timeouts and framerate drops?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260720134324.239391-1-panchuang@vivo.com?part=2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/7] staging: fbtft: Remove redundant dev_err_probe()
2026-07-20 13:43 ` [PATCH 2/7] staging: fbtft: Remove redundant dev_err_probe() Pan Chuang
2026-07-20 14:04 ` sashiko-bot
@ 2026-07-20 18:18 ` Andy Shevchenko
1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-07-20 18:18 UTC (permalink / raw)
To: Pan Chuang
Cc: Andy Shevchenko, Greg Kroah-Hartman,
open list:FBTFT Framebuffer drivers,
open list:FBTFT Framebuffer drivers, open list:STAGING SUBSYSTEM,
open list
On Mon, Jul 20, 2026 at 4:44 PM Pan Chuang <panchuang@vivo.com> wrote:
>
> Since commit
> 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"),
> devm_request_irq() automatically logs detailed error messages on
> failure. Remove the now-redundant driver-specific dev_err_probe() calls.
Reviewed-by: Andy Shevchenko <andy@kernel.org>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-20 19:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20 13:43 [PATCH 0/7] staging: Remove redundant error messages on IRQ request failure Pan Chuang
2026-07-20 13:43 ` [PATCH 2/7] staging: fbtft: Remove redundant dev_err_probe() Pan Chuang
2026-07-20 14:04 ` sashiko-bot
2026-07-20 18:18 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox