Luca Barbieri
2010-Jan-22 22:06 UTC
[Nouveau] [PATCH] drm/nouveau: call ttm_bo_wait with the bo lock held to prevent hang
nouveau_gem_ioctl_cpu_prep calls ttm_bo_wait without the bo lock held. ttm_bo_wait unlocks that lock, and so must be called with it held. Currently this bug causes libdrm nouveau_bo_busy() to hang the machine. Signed-off-by: Luca Barbieri <luca at luca-barbieri.com> --- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index eab55f8..c00a91f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -925,7 +925,9 @@ nouveau_gem_ioctl_cpu_prep(struct drm_device *dev, void *data, } if (req->flags & NOUVEAU_GEM_CPU_PREP_NOBLOCK) { + spin_lock(&nvbo->bo.lock); ret = ttm_bo_wait(&nvbo->bo, false, false, no_wait); + spin_unlock(&nvbo->bo.lock); } else { ret = ttm_bo_synccpu_write_grab(&nvbo->bo, no_wait); if (ret == 0) -- 1.6.3.3
Luca Barbieri
2010-Jan-28 16:28 UTC
[Nouveau] [PATCH] drm/nouveau: call ttm_bo_wait with the bo lock held to prevent hang
Please apply or state objections to this patch. Thanks.
Maarten Maathuis
2010-Jan-28 21:33 UTC
[Nouveau] [PATCH] drm/nouveau: call ttm_bo_wait with the bo lock held to prevent hang
Looks sane to me, it would be nice if someone else also agreed, before committing. On Thu, Jan 28, 2010 at 5:28 PM, Luca Barbieri <luca at luca-barbieri.com> wrote:> Please apply or state objections to this patch. > > Thanks. > _______________________________________________ > Nouveau mailing list > Nouveau at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/nouveau >
Maarten Maathuis
2010-Jan-30 22:05 UTC
[Nouveau] [PATCH] drm/nouveau: call ttm_bo_wait with the bo lock held to prevent hang
Acked-by: Maarten Maathuis <madman2003 at gmail.com> On Thu, Jan 28, 2010 at 10:33 PM, Maarten Maathuis <madman2003 at gmail.com> wrote:> Looks sane to me, it would be nice if someone else also agreed, before > committing. > > On Thu, Jan 28, 2010 at 5:28 PM, Luca Barbieri <luca at luca-barbieri.com> wrote: >> Please apply or state objections to this patch. >> >> Thanks. >> _______________________________________________ >> Nouveau mailing list >> Nouveau at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/nouveau >> >