[RFC] in_atomic() usage in amba-clcd.c / FB_ARMCLCD

Sebastian Andrzej Siewior bigeasy at linutronix.de
Wed Jan 27 17:44:08 UTC 2021


The mba-clcd driver uses in_interrupt() in clcdfb_sleep():
| /*
|  * Unfortunately, the enable/disable functions may be called either from
|  * process or IRQ context, and we _need_ to delay.  This is _not_ good.
|  */
| static inline void clcdfb_sleep(unsigned int ms)
| {
|         if (in_atomic()) {
|                 mdelay(ms);
|         } else {
|                 msleep(ms);
|         }
| }

I traced it back to its initial merge:
    bfe694f833643 ("[ARM] Add ARM AMBA CLCD framebuffer driver.")
    https://git.kernel.org/history/history/c/bfe694f833643

The driver has been removed and added back in the meantime. 
I've been looking for the IRQ context as described in the comment and
couldn't find it. The functions calling clcdfb_sleep() also call
conditionally backlight_update_status() which acquires a mutex.

Is this part really outdated and now msleep() could be used
unconditionally?

Sebastian


More information about the dri-devel mailing list