linux/drivers/staging/fbtft
Hui Su f576944a59 staging: fbtft: make dirty_lock IRQ-safe
fbtft_mkdirty() can be reached from the fbcon rendering path while
processing printk() in hardirq context. Meanwhile, dirty_lock is also
taken by fbtft_deferred_io() in workqueue context with local interrupts
enabled.

Lockdep reports a possible IRQ lock inversion involving dirty_lock and
console_owner. A hardirq can interrupt a CPU holding dirty_lock and
enter the console rendering path, which can attempt to acquire
dirty_lock again.

The following lockdep report was observed on an RK3566 system with
CONFIG_PROVE_LOCKING enabled:

  WARNING: possible irq lock inversion dependency detected
  swapper/2/0 just changed the state of lock:
  (console_owner){-...}-{0:0}
  but this lock took another, HARDIRQ-unsafe lock in the past:
  (&par->dirty_lock){+.+.}-{2:2}

  CPU0                    CPU1
  ----                    ----
  lock(&par->dirty_lock);
                         local_irq_disable();
                         lock(console_owner);
                         lock(&par->dirty_lock);
  <Interrupt>
    lock(console_owner);

  *** DEADLOCK ***

Use spin_lock_irqsave() for fbtft_mkdirty() and spin_lock_irq() for
fbtft_deferred_io(). They only access the dirty line range, so the
IRQ-off regions remain short.

Fixes: c296d5f995 ("staging: fbtft: core support")
Signed-off-by: Hui Su <sh_def@163.com>
Link: https://lore.kernel.org/lkml/20260804173712.176017-1-sh_def@163.com/
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://patch.msgid.link/20260807150953.2811933-3-sh_def@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-09-01 12:14:29 +02:00
..
fb_agm1264k-fl.c staging: fbtft: fix unchecked write return value in fb_agm1264k-fl 2026-02-23 15:38:15 +01:00
fb_bd663474.c staging: fbtft: Rectify GPIO handling 2021-05-10 11:19:39 +02:00
fb_hx8340bn.c staging: fbtft: Remove duplications of fbtft_set_addr_win() 2026-02-23 15:42:45 +01:00
fb_hx8347d.c staging: fbtft: Add support for orientation on Himax HX8347d 2021-05-10 11:19:39 +02:00
fb_hx8353d.c staging: fbtft: Remove duplications of fbtft_set_addr_win() 2026-02-23 15:42:45 +01:00
fb_hx8357d.c staging: fbtft: Remove duplications of fbtft_set_addr_win() 2026-02-23 15:42:45 +01:00
fb_hx8357d.h staging: fbtft: add SPDX identifiers 2018-01-15 16:03:46 +01:00
fb_ili9163.c staging: fbtft: fix spelling mistake "dinamically" -> "dynamically" 2026-02-23 15:08:50 +01:00
fb_ili9320.c staging: fbtft: Remove ftrace-like logging 2024-07-30 09:20:44 +02:00
fb_ili9325.c staging: fbtft: Rectify GPIO handling 2021-05-10 11:19:39 +02:00
fb_ili9340.c staging: fbtft: Remove duplications of fbtft_set_addr_win() 2026-02-23 15:42:45 +01:00
fb_ili9341.c staging: fbtft: Remove duplications of fbtft_set_addr_win() 2026-02-23 15:42:45 +01:00
fb_ili9481.c staging: fbtft: Remove duplications of fbtft_set_addr_win() 2026-02-23 15:42:45 +01:00
fb_ili9486.c staging: fbtft: Remove duplications of fbtft_set_addr_win() 2026-02-23 15:42:45 +01:00
fb_pcd8544.c Staging: fbtft: Fix some typo. pdc8544 --> pcd8544 2019-07-30 09:52:04 +02:00
fb_ra8875.c staging: fbtft: Remove ftrace-like logging 2024-07-30 09:20:44 +02:00
fb_s6d02a1.c staging: fbtft: Remove duplications of fbtft_set_addr_win() 2026-02-23 15:42:45 +01:00
fb_s6d1121.c staging: fbtft: Rectify GPIO handling 2021-05-10 11:19:39 +02:00
fb_seps525.c fbtft: seps525: Don't use "proxy" headers 2024-05-04 18:39:24 +02:00
fb_sh1106.c staging: fbtft: Remove ftrace-like logging 2024-07-30 09:20:44 +02:00
fb_ssd1289.c staging: fbtft: Remove ftrace-like logging 2024-07-30 09:20:44 +02:00
fb_ssd1305.c Staging: fbtft: Switch to the gpio descriptor interface 2019-01-18 11:01:02 +01:00
fb_ssd1306.c staging: fbtft: Remove ftrace-like logging 2024-07-30 09:20:44 +02:00
fb_ssd1325.c staging: fbtft: Remove ftrace-like logging 2024-07-30 09:20:44 +02:00
fb_ssd1331.c staging: fbtft: Remove ftrace-like logging 2024-07-30 09:20:44 +02:00
fb_ssd1351.c staging: fbtft: Use %pe format specifier for error pointers 2026-04-27 05:01:56 -06:00
fb_st7735r.c staging: fbtft: Remove duplications of fbtft_set_addr_win() 2026-02-23 15:42:45 +01:00
fb_st7789v.c staging: fbtft: fb_st7789v: reset display before initialization 2022-02-15 17:14:22 +01:00
fb_tinylcd.c staging: fbtft: fb_tinylcd: replace udelay() with fsleep() 2026-02-23 15:43:56 +01:00
fb_tls8204.c Staging: fbtft: Switch to the gpio descriptor interface 2019-01-18 11:01:02 +01:00
fb_uc1611.c staging: fbtft: Remove ftrace-like logging 2024-07-30 09:20:44 +02:00
fb_uc1701.c Staging: fbtft: Switch to the gpio descriptor interface 2019-01-18 11:01:02 +01:00
fb_upd161704.c staging: fbtft: fix typo in comment in fb_upd161704.c 2026-07-07 11:22:36 +02:00
fbtft-bus.c staging: fbtft: Remove ftrace-like logging 2024-07-30 09:20:44 +02:00
fbtft-core.c staging: fbtft: make dirty_lock IRQ-safe 2026-09-01 12:14:29 +02:00
fbtft-io.c staging: fbtft: remove unused function fbtft_write_gpio16_wr_latched 2026-05-04 16:49:10 +02:00
fbtft-sysfs.c staging: fbtft: Use sysfs_emit_at() to print to sysfs file 2026-07-07 11:22:31 +02:00
fbtft.h staging: fbtft: remove unused function fbtft_write_gpio16_wr_latched 2026-05-04 16:49:10 +02:00
internal.h staging: fbtft: remove redundant license text 2018-01-15 16:03:46 +01:00
Kconfig staging: fbtft: Update RA8875 Kconfig help description 2026-03-09 17:46:57 +01:00
Makefile staging: fbtft: Remove fb_watterott driver 2021-11-15 10:02:02 +01:00
README fbtft: Update REAMDE to slow down the stream of undesired cleanups 2026-03-09 17:05:48 +01:00
TODO staging: fbtft: Update TODO 2021-05-10 11:19:39 +02:00

  FBTFT
=========

Linux Framebuffer drivers for small TFT LCD display modules.
The module 'fbtft' makes writing drivers for some of these displays very easy.

Development is done on a Raspberry Pi running the Raspbian "wheezy" distribution.

For new hardware support consider using DRM subsystem (see TODO).

NOTE:

The driver is in maintenance mode, only performance issue or bug fixes
are accepted, which effectively means the patches must be tested on
the real hardware (the patch must be accompanied with the information
what hardware is that). The treewide changes may also be accepted as
an exception.