]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau: Fix fallout from reservation object rework
authorThierry Reding <treding@nvidia.com>
Mon, 16 Sep 2019 14:19:23 +0000 (16:19 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 17 Sep 2019 04:50:15 +0000 (14:50 +1000)
commit0978f85dd0495e6a40bf30b19112c6ecd7c17be8
treee00316844cb29b935146964e4e14e8c9ca3412b8
parentb7795a218949f96964b713535b0b251559221c59
drm/nouveau: Fix fallout from reservation object rework

Commit a65fdc4451ac ("drm/nouveau: Initialize GEM object before TTM
object") introduced a subtle change in how the buffer allocation size is
handled. Prior to that change, the size would get aligned to at least a
page, whereas after that change a non-page-aligned size would get passed
through unmodified. This ultimately causes a BUG_ON() to trigger in
drm_gem_private_object_init() and crashes the system.

Fix this by restoring the code that align the allocation size.

Fixes: a65fdc4451ac ("drm/nouveau: Initialize GEM object before TTM object")
Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_bo.h
drivers/gpu/drm/nouveau/nouveau_gem.c
drivers/gpu/drm/nouveau/nouveau_prime.c