Messages in this thread |  | | From | Miguel Ojeda <> | Date | Mon, 8 Feb 2021 19:38:10 +0100 | Subject | Re: [PATCH] auxdisplay: Remove in_interrupt() usage. |
| |
Hi Sebastian,
On Mon, Feb 8, 2021 at 6:59 PM Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote: > > charlcd_write() is invoked as a VFS->write() callback and as such it is > always invoked from preemptible context and may sleep. > > charlcd_puts() is invoked from register/unregister callback which is > preemtible. The reboot notifier callback is also invoked from
preemtible -> preemptible
> preemptible context. > > Therefore there is no need to use `in_interrupt()' to figure out if it > is save to sleep because it always is.
save -> safe
Does it hurt to have `in_interrupt()`? Future patches could make it so that it is no longer a preemptible context. Should it be moved to e.g. a `WARN_ON()` instead?
> Using `schedule()' to schedule (an be friendly to others) is
an -> and
> discouraged and `cond_resched()' should be used instead. > > Remove `in_interrupt()' and use `cond_resched()' to schedule every 32 > iteration if needed. > > Cc: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc'ing Geert and Willy too.
Thanks for the patch!
Cheers, Miguel
|  |