public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Don't clflush before release phys object
@ 2016-12-08 16:03 Chris Wilson
  2016-12-08 17:15 ` ✗ Fi.CI.BAT: warning for " Patchwork
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2016-12-08 16:03 UTC (permalink / raw)
  To: intel-gfx; +Cc: drm-intel-fixes

When we teardown the backing storage for the phys object, we copy from
the coherent contiguous block back to the shmemfs object, clflushing as
we go. Trying to clflush the invalid sg beforehand just oops and would
be redundant (due to it already being coherent, and clflushed
afterwards).

Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: <drm-intel-fixes@lists.freedesktop.org>
---
 drivers/gpu/drm/i915/i915_gem.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b3660339fa6b..5853449af66a 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -246,14 +246,16 @@ i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj)
 
 static void
 __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj,
-				struct sg_table *pages)
+				struct sg_table *pages,
+				bool needs_clflush)
 {
 	GEM_BUG_ON(obj->mm.madv == __I915_MADV_PURGED);
 
 	if (obj->mm.madv == I915_MADV_DONTNEED)
 		obj->mm.dirty = false;
 
-	if ((obj->base.read_domains & I915_GEM_DOMAIN_CPU) == 0 &&
+	if (needs_clflush &&
+	    (obj->base.read_domains & I915_GEM_DOMAIN_CPU) == 0 &&
 	    !cpu_cache_is_coherent(obj->base.dev, obj->cache_level))
 		drm_clflush_sg(pages);
 
@@ -265,7 +267,7 @@ static void
 i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj,
 			       struct sg_table *pages)
 {
-	__i915_gem_object_release_shmem(obj, pages);
+	__i915_gem_object_release_shmem(obj, pages, false);
 
 	if (obj->mm.dirty) {
 		struct address_space *mapping = obj->base.filp->f_mapping;
@@ -2235,7 +2237,7 @@ i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj,
 	struct sgt_iter sgt_iter;
 	struct page *page;
 
-	__i915_gem_object_release_shmem(obj, pages);
+	__i915_gem_object_release_shmem(obj, pages, true);
 
 	i915_gem_gtt_finish_pages(obj, pages);
 
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✗ Fi.CI.BAT: warning for drm/i915: Don't clflush before release phys object
  2016-12-08 16:03 [PATCH] drm/i915: Don't clflush before release phys object Chris Wilson
@ 2016-12-08 17:15 ` Patchwork
  2016-12-08 17:22   ` Saarinen, Jani
  0 siblings, 1 reply; 4+ messages in thread
From: Patchwork @ 2016-12-08 17:15 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Don't clflush before release phys object
URL   : https://patchwork.freedesktop.org/series/16569/
State : warning

== Summary ==

Series 16569v1 drm/i915: Don't clflush before release phys object
https://patchwork.freedesktop.org/api/1.0/series/16569/revisions/1/mbox/

Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> DMESG-WARN (fi-skl-6700hq)

fi-bdw-5557u     total:247  pass:233  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:247  pass:208  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-t5700     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-j1900     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-ilk-650       total:247  pass:195  dwarn:0   dfail:0   fail:0   skip:52 
fi-ivb-3520m     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u     total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:247  pass:226  dwarn:1   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:247  pass:224  dwarn:3   dfail:0   fail:0   skip:20 
fi-skl-6770hq    total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:247  pass:215  dwarn:0   dfail:0   fail:0   skip:32 

1117c18cdbf8312b696b79ae1846e1ebe99b8501 drm-tip: 2016y-12m-08d-16h-04m-38s UTC integration manifest
72c4b20 drm/i915: Don't clflush before release phys object

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3241/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ✗ Fi.CI.BAT: warning for drm/i915: Don't clflush before release phys object
  2016-12-08 17:15 ` ✗ Fi.CI.BAT: warning for " Patchwork
@ 2016-12-08 17:22   ` Saarinen, Jani
  2016-12-08 17:40     ` Imre Deak
  0 siblings, 1 reply; 4+ messages in thread
From: Saarinen, Jani @ 2016-12-08 17:22 UTC (permalink / raw)
  To: intel-gfx@lists.freedesktop.org, Chris Wilson, Deak, Imre

> == Series Details ==
> 
> Series: drm/i915: Don't clflush before release phys object
> URL   : https://patchwork.freedesktop.org/series/16569/
> State : warning
> 
> == Summary ==
> 
> Series 16569v1 drm/i915: Don't clflush before release phys object
> https://patchwork.freedesktop.org/api/1.0/series/16569/revisions/1/mbox/
> 
> Test gem_exec_suspend:
>         Subgroup basic-s3:
>                 pass       -> DMESG-WARN (fi-skl-6700hq)
Imre: LSPCON again. 
[  209.271053] sd 2:0:0:0: [sda] Starting disk
[  209.629904] [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
[  209.629967] [drm:lspcon_wait_mode [i915]] *ERROR* Error reading LSPCON mode
[  209.646906] [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
[  209.646968] [drm:lspcon_change_mode.constprop.4 [i915]] *ERROR* Error reading LSPCON mode
[  209.647058] [drm:lspcon_resume [i915]] *ERROR* LSPCON resume failed

> 
> fi-bdw-5557u     total:247  pass:233  dwarn:0   dfail:0   fail:0   skip:14
> fi-bsw-n3050     total:247  pass:208  dwarn:0   dfail:0   fail:0   skip:39
> fi-bxt-t5700     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27
> fi-byt-j1900     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27
> fi-byt-n2820     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31
> fi-hsw-4770      total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19
> fi-hsw-4770r     total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19
> fi-ilk-650       total:247  pass:195  dwarn:0   dfail:0   fail:0   skip:52
> fi-ivb-3520m     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21
> fi-ivb-3770      total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21
> fi-kbl-7500u     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21
> fi-skl-6260u     total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13
> fi-skl-6700hq    total:247  pass:226  dwarn:1   dfail:0   fail:0   skip:20
> fi-skl-6700k     total:247  pass:224  dwarn:3   dfail:0   fail:0   skip:20
> fi-skl-6770hq    total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13
> fi-snb-2520m     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31
> fi-snb-2600      total:247  pass:215  dwarn:0   dfail:0   fail:0   skip:32
> 
> 1117c18cdbf8312b696b79ae1846e1ebe99b8501 drm-tip: 2016y-12m-08d-16h-
> 04m-38s UTC integration manifest
> 72c4b20 drm/i915: Don't clflush before release phys object
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3241/

Jani Saarinen
Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo



_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ✗ Fi.CI.BAT: warning for drm/i915: Don't clflush before release phys object
  2016-12-08 17:22   ` Saarinen, Jani
@ 2016-12-08 17:40     ` Imre Deak
  0 siblings, 0 replies; 4+ messages in thread
From: Imre Deak @ 2016-12-08 17:40 UTC (permalink / raw)
  To: Saarinen, Jani, intel-gfx@lists.freedesktop.org, Chris Wilson

On Thu, 2016-12-08 at 19:22 +0200, Saarinen, Jani wrote:
> > == Series Details ==
> > 
> > Series: drm/i915: Don't clflush before release phys object
> > URL   : https://patchwork.freedesktop.org/series/16569/
> > State : warning
> > 
> > == Summary ==
> > 
> > Series 16569v1 drm/i915: Don't clflush before release phys object
> > https://patchwork.freedesktop.org/api/1.0/series/16569/revisions/1/mbox/
> > 
> > Test gem_exec_suspend:
> >         Subgroup basic-s3:
> >                 pass       -> DMESG-WARN (fi-skl-6700hq)
> 
> Imre: LSPCON again. 
> [  209.271053] sd 2:0:0:0: [sda] Starting disk
> [  209.629904] [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
> [  209.629967] [drm:lspcon_wait_mode [i915]] *ERROR* Error reading LSPCON mode
> [  209.646906] [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
> [  209.646968] [drm:lspcon_change_mode.constprop.4 [i915]] *ERROR* Error reading LSPCON mode
> [  209.647058] [drm:lspcon_resume [i915]] *ERROR* LSPCON resume failed

It's similar to previous cases with the difference that it recovers
after the next s/r. I'm working on a fix that does the detection/mode
change based on HPD, hopefully that will get rid of this.

> > fi-bdw-5557u     total:247  pass:233  dwarn:0   dfail:0   fail:0   skip:14
> > fi-bsw-n3050     total:247  pass:208  dwarn:0   dfail:0   fail:0   skip:39
> > fi-bxt-t5700     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27
> > fi-byt-j1900     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27
> > fi-byt-n2820     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31
> > fi-hsw-4770      total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19
> > fi-hsw-4770r     total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19
> > fi-ilk-650       total:247  pass:195  dwarn:0   dfail:0   fail:0   skip:52
> > fi-ivb-3520m     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21
> > fi-ivb-3770      total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21
> > fi-kbl-7500u     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21
> > fi-skl-6260u     total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13
> > fi-skl-6700hq    total:247  pass:226  dwarn:1   dfail:0   fail:0   skip:20
> > fi-skl-6700k     total:247  pass:224  dwarn:3   dfail:0   fail:0   skip:20
> > fi-skl-6770hq    total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13
> > fi-snb-2520m     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31
> > fi-snb-2600      total:247  pass:215  dwarn:0   dfail:0   fail:0   skip:32
> > 
> > 1117c18cdbf8312b696b79ae1846e1ebe99b8501 drm-tip: 2016y-12m-08d-16h-
> > 04m-38s UTC integration manifest
> > 72c4b20 drm/i915: Don't clflush before release phys object
> > 
> > == Logs ==
> > 
> > For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3241/
> 
> Jani Saarinen
> Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
> 
> 
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-08 17:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-08 16:03 [PATCH] drm/i915: Don't clflush before release phys object Chris Wilson
2016-12-08 17:15 ` ✗ Fi.CI.BAT: warning for " Patchwork
2016-12-08 17:22   ` Saarinen, Jani
2016-12-08 17:40     ` Imre Deak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox