<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [SNA HSW bisected] git commit "sna: Skip sync if we have an idle coherent bo" causes corruption"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=94125#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [SNA HSW bisected] git commit "sna: Skip sync if we have an idle coherent bo" causes corruption"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=94125">bug 94125</a>
              from <span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span></b>
        <pre>Do you mind reverting that commit chunk-by-chunk to narrow down which bo are
suspect? It implies the request tracking is wrong either at the ddx or kernel
level, but most likely it is a foriegn bo which the ddx has mistakenly assumed
is idle. Along those lines

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 8e5ec51..f593abd 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -7003,8 +7003,10 @@ void kgem_bo_sync__cpu(struct kgem *kgem, struct kgem_bo
*bo)
        assert(!bo->scanout);
        assert_tiling(kgem, bo);

-       if (bo->rq == NULL && (kgem->has_llc || bo->snoop))
+       if (bo->rq == NULL && (kgem->has_llc || bo->snoop)) {
+               assert(!__kgem_busy(kgem, bo->handle));
                return;
+       }

        kgem_bo_submit(kgem, bo);

@@ -7043,8 +7045,10 @@ void kgem_bo_sync__cpu_full(struct kgem *kgem, struct
kgem_bo *bo, bool write)
        assert(!bo->scanout || !write);
        assert_tiling(kgem, bo);

-       if (bo->rq == NULL && (kgem->has_llc || bo->snoop))
+       if (bo->rq == NULL && (kgem->has_llc || bo->snoop)) {
+               assert(!__kgem_busy(kgem, bo->handle));
                return;
+       }

        if (write || bo->needs_flush)
                kgem_bo_submit(kgem, bo);
@@ -7093,8 +7097,10 @@ void kgem_bo_sync__gtt(struct kgem *kgem, struct kgem_bo
*bo)
        assert(bo->proxy == NULL);
        assert_tiling(kgem, bo);

-       if (bo->rq == NULL)
+       if (bo->rq == NULL) {
+               assert(!__kgem_busy(kgem, bo->handle));
                return;
+       }

        kgem_bo_submit(kgem, bo);

plus a full-debug log would help.

Also would be nice to check if

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 8e5ec51..0b621b6 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -7003,7 +7003,7 @@ void kgem_bo_sync__cpu(struct kgem *kgem, struct kgem_bo
*bo)
        assert(!bo->scanout);
        assert_tiling(kgem, bo);

-       if (bo->rq == NULL && (kgem->has_llc || bo->snoop))
+       if (bo->rq == NULL && (kgem->has_llc || bo->snoop) && !bo->flush)
                return;

        kgem_bo_submit(kgem, bo);
@@ -7043,7 +7043,7 @@ void kgem_bo_sync__cpu_full(struct kgem *kgem, struct
kgem_bo *bo, bool write)
        assert(!bo->scanout || !write);
        assert_tiling(kgem, bo);

-       if (bo->rq == NULL && (kgem->has_llc || bo->snoop))
+       if (bo->rq == NULL && (kgem->has_llc || bo->snoop) && !bo->flush)
                return;

        if (write || bo->needs_flush)
@@ -7093,7 +7093,7 @@ void kgem_bo_sync__gtt(struct kgem *kgem, struct kgem_bo
*bo)
        assert(bo->proxy == NULL);
        assert_tiling(kgem, bo);

-       if (bo->rq == NULL)
+       if (bo->rq == NULL && !bo->flush)
                return;

        kgem_bo_submit(kgem, bo);

affected the rendering.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>