diff mbox

Intel G41 doesn't see any screens connected after suspend/resume

Message ID 20140320134307.GG4463@nuc-i3427.alporthouse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson March 20, 2014, 1:43 p.m. UTC
On Thu, Mar 20, 2014 at 09:38:17AM -0400, Nikolay Martynov wrote:
> (gdb) list *i915_gem_object_set_cache_level+0x8a
> 0x24e3a is in i915_gem_object_set_cache_level
> (drivers/gpu/drm/i915/i915_gem.c:3147).
> 3142         * crossing memory domains and dying.
> 3143         */
> 3144        if (HAS_LLC(dev))
> 3145            return true;
> 3146
> 3147        if (!drm_mm_node_allocated(gtt_space))
> 3148            return true;
> 3149
> 3150        if (list_empty(&gtt_space->node_list))
> 3151            return true;
> 
> Please let me know if there's anything else I can do.

Can you please try:

Comments

Nikolay Martynov March 20, 2014, 11:17 p.m. UTC | #1
2014-03-20 9:43 GMT-04:00 Chris Wilson <chris@chris-wilson.co.uk>:
> On Thu, Mar 20, 2014 at 09:38:17AM -0400, Nikolay Martynov wrote:
>> (gdb) list *i915_gem_object_set_cache_level+0x8a
>> 0x24e3a is in i915_gem_object_set_cache_level
>> (drivers/gpu/drm/i915/i915_gem.c:3147).
>> 3142         * crossing memory domains and dying.
>> 3143         */
>> 3144        if (HAS_LLC(dev))
>> 3145            return true;
>> 3146
>> 3147        if (!drm_mm_node_allocated(gtt_space))
>> 3148            return true;
>> 3149
>> 3150        if (list_empty(&gtt_space->node_list))
>> 3151            return true;
>>
>> Please let me know if there's anything else I can do.
>
> Can you please try:
>
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 13fc490d1f62..4f71125493fd 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3676,7 +3676,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
>                                     enum i915_cache_level cache_level)
>  {
>         struct drm_device *dev = obj->base.dev;
> -       struct i915_vma *vma;
> +       struct i915_vma *vma, *next;
>         int ret;
>
>         if (obj->cache_level == cache_level)
> @@ -3687,7 +3687,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
>                 return -EBUSY;
>         }
>
> -       list_for_each_entry(vma, &obj->vma_list, vma_link) {
> +       list_for_each_entry_safe(vma, next, &obj->vma_list, vma_link) {
>                 if (!i915_gem_valid_gtt_space(dev, &vma->node, cache_level)) {
>                         ret = i915_vma_unbind(vma);
>                         if (ret)
>
> --

  Yes, that seem to help. It didn't freeze anymore in 15 mins I used it. Thanks!
Chris Wilson March 21, 2014, 12:08 p.m. UTC | #2
On Thu, Mar 20, 2014 at 07:17:00PM -0400, Nikolay Martynov wrote:
>   Yes, that seem to help. It didn't freeze anymore in 15 mins I used it. Thanks!

Thanks indeed,

commit 3f5e0f06a3355a77ace053b4ffc0ac1c413cf2d0
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Mar 21 07:40:56 2014 +0000

    drm/i915: Fix unsafe loop iteration over vma whilst unbinding them
    
    On non-LLC platforms, when changing the cache level of an object, we may
    need to unbind it so that prefetching across page boundaries does not
    cross into a different memory domain. This requires us to unbind
    conflicting vma, but we did so iterating over the objects vma in an
    unsafe manner (as the list was being modified as we iterated).
    
    The regression was introduced in
    commit 3089c6f239d7d2c4cb2dd5c353e8984cf79af1d7
    Author: Ben Widawsky <ben@bwidawsk.net>
    Date:   Wed Jul 31 17:00:03 2013 -0700
    
        drm/i915: make caching operate on all address spaces
    apparently as far back as v3.12-rc1, but it has only just begun to
    trigger real world bug reports.
    
    Reported-and-tested-by: Nikolay Martynov <mar.kolya@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76384
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Ben Widawsky <ben@bwidawsk.net>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Now you can get back to your original bug :(
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 13fc490d1f62..4f71125493fd 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3676,7 +3676,7 @@  int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
                                    enum i915_cache_level cache_level)
 {
        struct drm_device *dev = obj->base.dev;
-       struct i915_vma *vma;
+       struct i915_vma *vma, *next;
        int ret;
 
        if (obj->cache_level == cache_level)
@@ -3687,7 +3687,7 @@  int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
                return -EBUSY;
        }
 
-       list_for_each_entry(vma, &obj->vma_list, vma_link) {
+       list_for_each_entry_safe(vma, next, &obj->vma_list, vma_link) {
                if (!i915_gem_valid_gtt_space(dev, &vma->node, cache_level)) {
                        ret = i915_vma_unbind(vma);
                        if (ret)