On 4/3/25 10:03, Thomas Zimmermann wrote:
> Hi
> 
> Am 03.04.25 um 02:37 schrieb Lucas De Marchi:
>> On Sun, Mar 23, 2025 at 12:25:58AM +0300, Dmitry Osipenko wrote:
>>> Hi,
>>>
>>> This a continuation of a year-old series that adds generic DRM-shmem
>>> shrinker [1]. The old series became too big with too many patches, more
>>> reasonable to split it up into multiple smaller patchsets. Here is
>>> the firtst part that makes preparatory DRM changes.
>>>
>>> [1] https://lore.kernel.org/dri-devel/20240105184624.508603-1-
>>> dmitry.osipe...@collabora.com/
>>
>> After these patches got merged I started seeing this on ast driver
>> and a similar one qemu-cirrus:
> 
> Same here with simpledrm. I wanted to bisect today.

I've reproduced using bochs drv, it's the last patch "drm/shmem-helper:
Use refcount_t for vmap_use_count" causing the issue. Thanks for the report!

This change fixes it, let me send a proper patch:

diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c
b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 2d924d547a51..554f1d4c1a76 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -416,10 +416,10 @@ void drm_gem_shmem_vunmap_locked(struct
drm_gem_shmem_object *shmem,
                if (refcount_dec_and_test(&shmem->vmap_use_count)) {
                        vunmap(shmem->vaddr);
                        drm_gem_shmem_unpin_locked(shmem);
+
+                       shmem->vaddr = NULL;
                }
        }
-
-       shmem->vaddr = NULL;
 }
 EXPORT_SYMBOL_GPL(drm_gem_shmem_vunmap_locked);

-- 
Best regards,
Dmitry

Reply via email to