Skip to contentSkip to conversation

drm/i915: Release power ref after updating wm

PATCH In review Gabriel Feceoru 4 participants 4 messages Mar 16, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Release power ref after updating wm

On HSW/BDW there are random dmesg-warn errors while running kms tests, like:

[90587.867077] Call Trace:
[90587.867085]  [<ffffffff81403dae>] dump_stack+0x67/0x99
[90587.867094]  [<ffffffff810790f1>] warn_slowpath_common+0x81/0xc0
[90587.867099]  [<ffffffff81079177>] warn_slowpath_fmt+0x47/0x50
[90587.867150]  [<ffffffffa036e280>] hsw_write32+0x280/0x290 [i915]
[90587.867186]  [<ffffffffa0315cc8>] _ilk_disable_lp_wm+0x98/0xd0 [i915]
[90587.867222]  [<ffffffffa031b1f2>] ilk_program_watermarks+0x4a2/0x940 [i915]
[90587.867260]  [<ffffffffa031b6e0>] ilk_optimize_watermarks+0x50/0x70 [i915]
[90587.867311]  [<ffffffffa03894e2>] intel_atomic_commit+0x742/0x2170 [i915]
[90587.867319]  [<ffffffff810c06b0>] ? wait_woken+0xa0/0xa0
[90587.867326]  [<ffffffff81535062>] drm_atomic_commit+0x32/0x50
[90587.867333]  [<ffffffff8150fd89>] drm_atomic_helper_connector_dpms+0xe9/0x1a0
[90587.867340]  [<ffffffff81529acd>] drm_mode_obj_set_property_ioctl+0x21d/0x230
[90587.867346]  [<ffffffff81529b0b>] drm_mode_connector_property_set_ioctl+0x2b/0x30
[90587.867352]  [<ffffffff8151a7a6>] drm_ioctl+0x236/0x4f0
[90587.867358]  [<ffffffff81529ae0>] ? drm_mode_obj_set_property_ioctl+0x230/0x230
[90587.867366]  [<ffffffff811e90de>] do_vfs_ioctl+0x8e/0x680
[90587.867372]  [<ffffffff811f4f5a>] ? __fget_light+0x6a/0x90
[90587.867378]  [<ffffffff811e970c>] SyS_ioctl+0x3c/0x70
[90587.867386]  [<ffffffff817cbf9b>] entry_SYSCALL_64_fastpath+0x16/0x73

Since writing the watermarks requires MMIO access, this should be done before releasing the power reference.

This clears the flip-flops in kms tests on HSW/BDW.

---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +3 -3
index ce55f0b..b141e52 100644
@@ -13631,9 +13631,6 @@ static int intel_atomic_commit(struct drm_device *dev,
 			modeset_put_power_domains(dev_priv, put_domains[i]);
 	}
 
-	if (intel_state->modeset)
-		intel_display_power_put(dev_priv, POWER_DOMAIN_MODESET);
-
 	/*
 	 * Now that the vblank has passed, we can go ahead and program the
 	 * optimal watermarks on platforms that need two-step watermark
@@ -13648,6 +13645,9 @@ static int intel_atomic_commit(struct drm_device *dev,
 			dev_priv->display.optimize_watermarks(intel_cstate);
 	}
 
+	if (intel_state->modeset)
+		intel_display_power_put(dev_priv, POWER_DOMAIN_MODESET);
+
 	mutex_lock(&dev->struct_mutex);
 	drm_atomic_helper_cleanup_planes(dev, state);
 	mutex_unlock(&dev->struct_mutex);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Matt has a similar fix already on the list, Matt/Ville what's the plan with that? Could we have a stop-gap solution?

--Imre

Quoted 72 lines · Gabriel Feceoru

On HSW/BDW there are random dmesg-warn errors while running kms tests, like:

[90587.867077] Call Trace:
[90587.867085]  [<ffffffff81403dae>] dump_stack+0x67/0x99
[90587.867094]  [<ffffffff810790f1>] warn_slowpath_common+0x81/0xc0
[90587.867099]  [<ffffffff81079177>] warn_slowpath_fmt+0x47/0x50
[90587.867150]  [<ffffffffa036e280>] hsw_write32+0x280/0x290 [i915]
[90587.867186]  [<ffffffffa0315cc8>] _ilk_disable_lp_wm+0x98/0xd0
[i915]
[90587.867222]  [<ffffffffa031b1f2>]
ilk_program_watermarks+0x4a2/0x940 [i915]
[90587.867260]  [<ffffffffa031b6e0>]
ilk_optimize_watermarks+0x50/0x70 [i915]
[90587.867311]  [<ffffffffa03894e2>] intel_atomic_commit+0x742/0x2170
[i915]
[90587.867319]  [<ffffffff810c06b0>] ? wait_woken+0xa0/0xa0
[90587.867326]  [<ffffffff81535062>] drm_atomic_commit+0x32/0x50
[90587.867333]  [<ffffffff8150fd89>]
drm_atomic_helper_connector_dpms+0xe9/0x1a0
[90587.867340]  [<ffffffff81529acd>]
drm_mode_obj_set_property_ioctl+0x21d/0x230
[90587.867346]  [<ffffffff81529b0b>]
drm_mode_connector_property_set_ioctl+0x2b/0x30
[90587.867352]  [<ffffffff8151a7a6>] drm_ioctl+0x236/0x4f0
[90587.867358]  [<ffffffff81529ae0>] ?
drm_mode_obj_set_property_ioctl+0x230/0x230
[90587.867366]  [<ffffffff811e90de>] do_vfs_ioctl+0x8e/0x680
[90587.867372]  [<ffffffff811f4f5a>] ? __fget_light+0x6a/0x90
[90587.867378]  [<ffffffff811e970c>] SyS_ioctl+0x3c/0x70
[90587.867386]  [<ffffffff817cbf9b>]

entry_SYSCALL_64_fastpath+0x16/0x73

Since writing the watermarks requires MMIO access, this should be done before
releasing the power reference.

This clears the flip-flops in kms tests on HSW/BDW.

---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---

 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index ce55f0b..b141e52 100644
@@ -13631,9 +13631,6 @@ static int intel_atomic_commit(struct
 drm_device *dev,
  			modeset_put_power_domains(dev_priv,
 put_domains[i]);
  	}

drivers/gpu/drm/i915/intel_display.c +0 -2
-	if (intel_state->modeset)
-		intel_display_power_put(dev_priv,

POWER_DOMAIN_MODESET);
-
  /*
   * Now that the vblank has passed, we can go ahead and program the
   * optimal watermarks on platforms that need two-step watermark

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13648,6 +13645,9 @@ static int intel_atomic_commit(struct
 drm_device *dev,

  dev_priv-

Quoted 1 line

display.optimize_watermarks(intel_cstate);

  }

drivers/gpu/drm/i915/intel_display.c +2 -0
+	if (intel_state->modeset)
+		intel_display_power_put(dev_priv,
Quoted 5 lines

POWER_DOMAIN_MODESET);
+
  mutex_lock(&dev->struct_mutex); drm_atomic_helper_cleanup_planes(dev, state); mutex_unlock(&dev->struct_mutex);

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
Quoted 4 lines · Imre Deak

Matt has a similar fix already on the list, Matt/Ville what's the plan with that? Could we have a stop-gap solution?

--Imre

Yeah, I wrote two separate patches that would both be fixes for that issue. One of them moved the PM reference drop like the patch below; the other wrapped the actual watermark programming in a PM get_if_enabled() call to make sure the reference was held throughout the watermark programming, or skipped the watermark programming entirely if we were already fully powered down.

Neither patch got a reviewed-by and I got wrapped up in something else and forgot to poke anyone. I don't have a strong preference either way on which fix is best (they should both be fine for now I think). I think longer-term we'll eventually need the second approach above once we allow the watermark programming to happen asynchronously via a workqueue task.

Matt

Quoted 79 lines · Gabriel Feceoru
Quoted 77 lines

On HSW/BDW there are random dmesg-warn errors while running kms tests, like:

[90587.867077] Call Trace:
[90587.867085]  [<ffffffff81403dae>] dump_stack+0x67/0x99
[90587.867094]  [<ffffffff810790f1>] warn_slowpath_common+0x81/0xc0
[90587.867099]  [<ffffffff81079177>] warn_slowpath_fmt+0x47/0x50
[90587.867150]  [<ffffffffa036e280>] hsw_write32+0x280/0x290 [i915]
[90587.867186]  [<ffffffffa0315cc8>] _ilk_disable_lp_wm+0x98/0xd0
[i915]
[90587.867222]  [<ffffffffa031b1f2>]
ilk_program_watermarks+0x4a2/0x940 [i915]
[90587.867260]  [<ffffffffa031b6e0>]
ilk_optimize_watermarks+0x50/0x70 [i915]
[90587.867311]  [<ffffffffa03894e2>] intel_atomic_commit+0x742/0x2170
[i915]
[90587.867319]  [<ffffffff810c06b0>] ? wait_woken+0xa0/0xa0
[90587.867326]  [<ffffffff81535062>] drm_atomic_commit+0x32/0x50
[90587.867333]  [<ffffffff8150fd89>]
drm_atomic_helper_connector_dpms+0xe9/0x1a0
[90587.867340]  [<ffffffff81529acd>]
drm_mode_obj_set_property_ioctl+0x21d/0x230
[90587.867346]  [<ffffffff81529b0b>]
drm_mode_connector_property_set_ioctl+0x2b/0x30
[90587.867352]  [<ffffffff8151a7a6>] drm_ioctl+0x236/0x4f0
[90587.867358]  [<ffffffff81529ae0>] ?
drm_mode_obj_set_property_ioctl+0x230/0x230
[90587.867366]  [<ffffffff811e90de>] do_vfs_ioctl+0x8e/0x680
[90587.867372]  [<ffffffff811f4f5a>] ? __fget_light+0x6a/0x90
[90587.867378]  [<ffffffff811e970c>] SyS_ioctl+0x3c/0x70
[90587.867386]  [<ffffffff817cbf9b>]

entry_SYSCALL_64_fastpath+0x16/0x73

Since writing the watermarks requires MMIO access, this should be done before
releasing the power reference.

This clears the flip-flops in kms tests on HSW/BDW.

---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---

 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index ce55f0b..b141e52 100644
@@ -13631,9 +13631,6 @@ static int intel_atomic_commit(struct
 drm_device *dev,
  			modeset_put_power_domains(dev_priv,
 put_domains[i]);
  	}

drivers/gpu/drm/i915/intel_display.c +0 -2
-	if (intel_state->modeset)
-		intel_display_power_put(dev_priv,

POWER_DOMAIN_MODESET);
-
  /*
   * Now that the vblank has passed, we can go ahead and program the
   * optimal watermarks on platforms that need two-step watermark

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13648,6 +13645,9 @@ static int intel_atomic_commit(struct
 drm_device *dev,

  dev_priv-

Quoted 1 line

display.optimize_watermarks(intel_cstate);

  }

drivers/gpu/drm/i915/intel_display.c +2 -0
+	if (intel_state->modeset)
+		intel_display_power_put(dev_priv,

POWER_DOMAIN_MODESET);
+
  mutex_lock(&dev->struct_mutex); drm_atomic_helper_cleanup_planes(dev, state); mutex_unlock(&dev->struct_mutex);

Signature · 9 lines
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Release power ref after updating wm

In reply to Gabriel Feceoru
== Series Details ==

== Series Details ==

Series: drm/i915: Release power ref after updating wm
URL : https://patchwork.freedesktop.org/series/4525/
State : failure

== Summary ==

Series 4525v1 drm/i915: Release power ref after updating wm
http://patchwork.freedesktop.org/api/1.0/series/4525/revisions/1/mbox/

Test gem_ringfill:

        Subgroup basic-default-bomb:
                dmesg-warn -> PASS       (skl-nuci5)
Test kms_addfb_basic:
        Subgroup addfb25-x-tiled:
                dmesg-warn -> PASS       (skl-nuci5)
Test kms_force_connector_basic:
        Subgroup force-edid:
                pass       -> SKIP       (ivb-t430s)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                dmesg-warn -> PASS       (skl-nuci5)
bdw-ultra        total:194  pass:173  dwarn:0   dfail:0   fail:0   skip:21 
hsw-brixbox      total:194  pass:172  dwarn:0   dfail:0   fail:0   skip:22 
ivb-t430s        total:194  pass:168  dwarn:0   dfail:0   fail:0   skip:26 
skl-i5k-2        total:194  pass:171  dwarn:0   dfail:0   fail:0   skip:23 
skl-i7k-2        total:194  pass:171  dwarn:0   dfail:0   fail:0   skip:23 
skl-nuci5        total:194  pass:183  dwarn:0   dfail:0   fail:0   skip:11 
snb-x220t        total:194  pass:160  dwarn:0   dfail:0   fail:1   skip:33 

Results at /archive/results/CI_IGT_test/Patchwork_1619/

be0d1481fb1a2fd1cb199b81c9c01154a78d43dd drm-intel-nightly: 2016y-03m-16d-16h-31m-16s UTC integration manifest 2438c2d6a843d2030ecc992497fc87cb140a9f4f drm/i915: Release power ref after updating wm

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx