diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2021-04-13 23:06:34 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2021-04-13 23:15:09 +0200 |
commit | 213cc929cbfd7962164420b300f9a6c60aaff189 (patch) | |
tree | 163d5e50169ce0399add99cba49a760214de05db /drivers/auxdisplay/charlcd.c | |
parent | Merge tag 'amd-drm-next-5.13-2021-04-12' of https://gitlab.freedesktop.org/ag... (diff) | |
parent | Linux 5.12-rc7 (diff) | |
download | linux-213cc929cbfd7962164420b300f9a6c60aaff189.tar.xz linux-213cc929cbfd7962164420b300f9a6c60aaff189.zip |
Merge drm/drm-fixes into drm-next
msm-next pull request has a baseline with stuff from -fixes, roll
forward first.
Some simple conflicts in amdgpu, ttm and one in i915 where git gets
confused and tries to add the same function twice.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/auxdisplay/charlcd.c')
-rw-r--r-- | drivers/auxdisplay/charlcd.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index f43430e9dcee..24fd6f369ebe 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c @@ -470,12 +470,14 @@ static ssize_t charlcd_write(struct file *file, const char __user *buf, char c; for (; count-- > 0; (*ppos)++, tmp++) { - if (!in_interrupt() && (((count + 1) & 0x1f) == 0)) + if (((count + 1) & 0x1f) == 0) { /* - * let's be a little nice with other processes - * that need some CPU + * charlcd_write() is invoked as a VFS->write() callback + * and as such it is always invoked from preemptible + * context and may sleep. */ - schedule(); + cond_resched(); + } if (get_user(c, tmp)) return -EFAULT; @@ -537,12 +539,8 @@ static void charlcd_puts(struct charlcd *lcd, const char *s) int count = strlen(s); for (; count-- > 0; tmp++) { - if (!in_interrupt() && (((count + 1) & 0x1f) == 0)) - /* - * let's be a little nice with other processes - * that need some CPU - */ - schedule(); + if (((count + 1) & 0x1f) == 0) + cond_resched(); charlcd_write_char(lcd, *tmp); } |