Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1654013 > unrolled thread
| Started by | Jia-Ju Bai <baijiaju1990@163.com> |
|---|---|
| First post | 2017-05-31 10:50 +0200 |
| Last post | 2017-05-31 12:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] gma500: Fix a sleep-in-atomic bug in psbfb_2d_submit Jia-Ju Bai <baijiaju1990@163.com> - 2017-05-31 10:50 +0200
Re: [PATCH] gma500: Fix a sleep-in-atomic bug in psbfb_2d_submit Patrik Jakobsson <patrik.r.jakobsson@gmail.com> - 2017-05-31 12:00 +0200
| From | Jia-Ju Bai <baijiaju1990@163.com> |
|---|---|
| Date | 2017-05-31 10:50 +0200 |
| Subject | [PATCH] gma500: Fix a sleep-in-atomic bug in psbfb_2d_submit |
| Message-ID | <tN7uh-2qT-1@gated-at.bofh.it> |
The driver may sleep under a spin lock, and the function call path is:
psbfb_2d_submit (acquire the lock by spin_lock_irqsave)
psb_2d_wait_available
psb_spank
msleep --> may sleep
To fix it, the "msleep" is replaced with "mdelay" in psb_spank.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
drivers/gpu/drm/gma500/accel_2d.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/gma500/accel_2d.c b/drivers/gpu/drm/gma500/accel_2d.c
index c51d925..7c24c8a 100644
--- a/drivers/gpu/drm/gma500/accel_2d.c
+++ b/drivers/gpu/drm/gma500/accel_2d.c
@@ -55,7 +55,7 @@ void psb_spank(struct drm_psb_private *dev_priv)
_PSB_CS_RESET_TWOD_RESET, PSB_CR_SOFT_RESET);
PSB_RSGX32(PSB_CR_SOFT_RESET);
- msleep(1);
+ mdelay(1);
PSB_WSGX32(0, PSB_CR_SOFT_RESET);
wmb();
@@ -64,7 +64,7 @@ void psb_spank(struct drm_psb_private *dev_priv)
wmb();
(void) PSB_RSGX32(PSB_CR_BIF_CTRL);
- msleep(1);
+ mdelay(1);
PSB_WSGX32(PSB_RSGX32(PSB_CR_BIF_CTRL) & ~_PSB_CB_CTRL_CLEAR_FAULT,
PSB_CR_BIF_CTRL);
(void) PSB_RSGX32(PSB_CR_BIF_CTRL);
--
1.7.9.5
[toc] | [next] | [standalone]
| From | Patrik Jakobsson <patrik.r.jakobsson@gmail.com> |
|---|---|
| Date | 2017-05-31 12:00 +0200 |
| Message-ID | <tN8A2-34j-7@gated-at.bofh.it> |
| In reply to | #1654013 |
On Wed, May 31, 2017 at 10:48 AM, Jia-Ju Bai <baijiaju1990@163.com> wrote: > The driver may sleep under a spin lock, and the function call path is: > psbfb_2d_submit (acquire the lock by spin_lock_irqsave) > psb_2d_wait_available > psb_spank > msleep --> may sleep > > To fix it, the "msleep" is replaced with "mdelay" in psb_spank. > > Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Thanks for the patch. checkpatch complains about DOS line endings so you might want to take a look at your editor settings. Usually we tag the subject with drm/gma500 but don't think there's a hard rule about that. I'll fix it up and take it through drm-misc-next. Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> > --- > drivers/gpu/drm/gma500/accel_2d.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/gma500/accel_2d.c b/drivers/gpu/drm/gma500/accel_2d.c > index c51d925..7c24c8a 100644 > --- a/drivers/gpu/drm/gma500/accel_2d.c > +++ b/drivers/gpu/drm/gma500/accel_2d.c > @@ -55,7 +55,7 @@ void psb_spank(struct drm_psb_private *dev_priv) > _PSB_CS_RESET_TWOD_RESET, PSB_CR_SOFT_RESET); > PSB_RSGX32(PSB_CR_SOFT_RESET); > > - msleep(1); > + mdelay(1); > > PSB_WSGX32(0, PSB_CR_SOFT_RESET); > wmb(); > @@ -64,7 +64,7 @@ void psb_spank(struct drm_psb_private *dev_priv) > wmb(); > (void) PSB_RSGX32(PSB_CR_BIF_CTRL); > > - msleep(1); > + mdelay(1); > PSB_WSGX32(PSB_RSGX32(PSB_CR_BIF_CTRL) & ~_PSB_CB_CTRL_CLEAR_FAULT, > PSB_CR_BIF_CTRL); > (void) PSB_RSGX32(PSB_CR_BIF_CTRL); > -- > 1.7.9.5 > >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web