All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] in_atomic() usage in amba-clcd.c / FB_ARMCLCD
@ 2021-01-27 17:44 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2021-01-27 17:44 UTC (permalink / raw)
  To: linux-fbdev, Peter Collingbourne; +Cc: Thomas Gleixner, dri-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [RFC] in_atomic() usage in amba-clcd.c / FB_ARMCLCD
@ 2021-01-27 17:44 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2021-01-27 17:44 UTC (permalink / raw)
  To: linux-fbdev, Peter Collingbourne; +Cc: Thomas Gleixner, dri-devel

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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-28  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 17:44 [RFC] in_atomic() usage in amba-clcd.c / FB_ARMCLCD Sebastian Andrzej Siewior
2021-01-27 17:44 ` Sebastian Andrzej Siewior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.