Bug 87086 - [BSW]S3 causes "WARNING: CPU: 1 PID: 4478 at drivers/gpu/drm/i915/i915_drv.c:1185 vlv_force_gfx_clock+0x41/0x1eb [i915]()"
Summary: [BSW]S3 causes "WARNING: CPU: 1 PID: 4478 at drivers/gpu/drm/i915/i915_drv.c:...
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: DRI git
Hardware: Other All
: high major
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-08 02:26 UTC by Guo Jinxian
Modified: 2017-10-06 14:33 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg (109.82 KB, text/plain)
2014-12-08 02:26 UTC, Guo Jinxian
no flags Details
[PATCH] drm/i915: Skip all the gfx clock force on CHV (2.77 KB, patch)
2015-02-10 12:50 UTC, Ville Syrjala
no flags Details | Splinter Review
dmesg after patch (123.33 KB, text/plain)
2015-02-13 03:13 UTC, Ding Heng
no flags Details
new dmesg with kernel20150213 and patch (123.45 KB, text/plain)
2015-02-27 03:10 UTC, Ding Heng
no flags Details
dmesg after patch (498.73 KB, application/octet-stream)
2015-03-06 07:02 UTC, Ding Heng
no flags Details
dmesg_with_drm-intel-testing-2015-03-13 (188.37 KB, text/plain)
2015-03-16 08:36 UTC, Jeff Zheng
no flags Details

Description Guo Jinxian 2014-12-08 02:26:56 UTC
Created attachment 110550 [details]
dmesg

==System Environment==
--------------------------
Regression: Not sure.
Here has another bug 84903 about S3

Non-working platforms: BSW

==kernel==
--------------------------
origin/drm-intel-nightly: 2014_12_07(fails)

==Bug detailed description==
-----------------------------
S3 causes "WARNING: CPU: 1 PID: 4478 at drivers/gpu/drm/i915/i915_drv.c:1185 vlv_force_gfx_clock+0x41/0x1eb [i915]()"

Commit 2d3d111a8f34606469e589d3491c9a64f62310b8 fixed bug 84903, and involved this call trace.
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Fri Nov 21 21:00:36 2014 +0200

drm/i915: Don't clobber crtc->new_config when nothing changes


Dmesg:
------------[ cut here ]------------
[  532.651288] WARNING: CPU: 1 PID: 4478 at drivers/gpu/drm/i915/i915_drv.c:1185 vlv_force_gfx_clock+0x41/0x1eb [i915]()
[  532.651291] WARN_ON(!!(val & VLV_GFX_CLK_FORCE_ON_BIT) == force_on)
[  532.651321] Modules linked in: dm_mod iTCO_wdt iTCO_vendor_support snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_controller pcspkr snd_hda_codec serio_raw snd_hwdep snd_pcm snd_timer i2c_i801 lpc_ich snd mfd_core soundcore battery ac acpi_cpufreq option usb_wwan usbserial i915 button video drm_kms_helper drm cfbfillrect cfbimgblt cfbcopyarea
[  532.651328] CPU: 1 PID: 4478 Comm: kworker/u8:54 Tainted: G        W      3.18.0-rc5_kcloud_2d3d11_20141202+ #40
[  532.651338] Workqueue: events_unbound async_run_entry_fn
[  532.651343]  0000000000000000 0000000000000009 ffffffff817788a0 ffff8801757afc98
[  532.651347]  ffffffff81036742 ffff8801757afc90 ffffffffa007ea40 ffff8801757ac000
[  532.651351]  ffff880175b00000 0000000000000000 ffff88017a5c8800 00000000ffffff92
[  532.651353] Call Trace:
[  532.651363]  [<ffffffff817788a0>] ? dump_stack+0x41/0x51
[  532.651370]  [<ffffffff81036742>] ? warn_slowpath_common+0x78/0x90
[  532.651397]  [<ffffffffa007ea40>] ? vlv_force_gfx_clock+0x41/0x1eb [i915]
[  532.651402]  [<ffffffff8103679f>] ? warn_slowpath_fmt+0x45/0x4a
[  532.651431]  [<ffffffffa007ea40>] ? vlv_force_gfx_clock+0x41/0x1eb [i915]
[  532.651458]  [<ffffffffa007f9ea>] ? vlv_resume_prepare+0x511/0x546 [i915]
[  532.651485]  [<ffffffffa007fad8>] ? i915_resume_legacy+0x23/0x23 [i915]
[  532.651512]  [<ffffffffa007fa59>] ? i915_drm_resume_early+0x3a/0x96 [i915]
[  532.651518]  [<ffffffff813dd359>] ? dpm_run_callback+0x3a/0xc5
[  532.651522]  [<ffffffff813dd6b5>] ? device_resume_early+0x130/0x171
[  532.651526]  [<ffffffff813dd70a>] ? async_resume_early+0x14/0x38
[  532.651532]  [<ffffffff8104cfd7>] ? async_run_entry_fn+0x2d/0xbf
[  532.651537]  [<ffffffff810473f9>] ? process_one_work+0x1b3/0x316
[  532.651541]  [<ffffffff81047da1>] ? worker_thread+0x27d/0x369
[  532.651545]  [<ffffffff81047b24>] ? rescuer_thread+0x219/0x219
[  532.651550]  [<ffffffff8104b375>] ? kthread+0xce/0xd6
[  532.651554]  [<ffffffff8104b2a7>] ? kthread_create_on_node+0x162/0x162
[  532.651560]  [<ffffffff8177de2c>] ? ret_from_fork+0x7c/0xb0
[  532.651564]  [<ffffffff8104b2a7>] ? kthread_create_on_node+0x162/0x162
[  532.651567] ---[ end trace c5048bcdf86a84e4 ]---


==Reproduce steps==
---------------------------- 
1. echo mem > /sys/power/state
Comment 1 Ville Syrjala 2015-02-10 12:50:45 UTC
Created attachment 113316 [details] [review]
[PATCH] drm/i915: Skip all the gfx clock force on CHV

Please test this patch.
Comment 2 Ding Heng 2015-02-13 03:12:41 UTC
(In reply to Ville Syrjala from comment #1)
> Created attachment 113316 [details] [review] [review]
[PATCH] drm/i915: Skip all the
> gfx clock force on CHV

Please test this patch.

Patch this patch on latest nightly branch commit:dbd79c545cbbf63785cbda8d13260b3e827f0f6d

S3 will not cause dmesg warn anymore, but seems S3 failed itself, when type "echo mem > /sys/power/state", it will resume immediately.
Comment 3 Ding Heng 2015-02-13 03:13:55 UTC
Created attachment 113440 [details]
dmesg after patch
Comment 4 Ville Syrjala 2015-02-13 08:31:51 UTC
(In reply to Ding Heng from comment #3)
> Created attachment 113440 [details]
> dmesg after patch

That dmesg starts some time after resuming, so I can't really see anything from it. Please redo the test, and also to get rid of that hotplug noise in dmesg do the following (preferably before loading i915):
intel_iosf_sb_write gpio_nc 0x5420 0x03010300
intel_iosf_sb_write gpio_nc 0x5440 0x03010300
Comment 5 Ding Heng 2015-02-27 03:10:00 UTC
Created attachment 113850 [details]
new dmesg with kernel20150213 and patch

This is the new dmesg with the same patch and kernel.
Comment 6 Deepak S 2015-02-27 03:53:00 UTC
Can you try this patch?
http://lists.freedesktop.org/archives/intel-gfx/2015-February/060790.html

I will try and confirm if we need vlv_force_gfx_clock or not for chv
Comment 7 Ding Heng 2015-03-03 06:06:26 UTC
(In reply to Deepak S from comment #6)
> Can you try this patch?
> http://lists.freedesktop.org/archives/intel-gfx/2015-February/060790.html
> 
> I will try and confirm if we need vlv_force_gfx_clock or not for chv

Since latest kernel commit will cause BSW Fail to boot up, I was trying to install your patch to commit 0b2a1076c5cb4f383d6a8c940ffab1e27f241097(nightly branch 2015-02-25, latest available kernel for BSW), but your patch failed to install, here is the rej file:

[root@glody-pc drm-intel]# cat drivers/gpu/drm/i915/i915_drv.c.rej
--- drivers/gpu/drm/i915/i915_drv.c
+++ drivers/gpu/drm/i915/i915_drv.c
@@ -1193,11 +1193,13 @@
        int err;

        val = I915_READ(VLV_GTLC_SURVIVABILITY_REG);
-       WARN_ON(!!(val & VLV_GFX_CLK_FORCE_ON_BIT) == force_on);

 #define COND (I915_READ(VLV_GTLC_SURVIVABILITY_REG) & VLV_GFX_CLK_STATUS_BIT)
        /* Wait for a previous force-off to settle */
-       if (force_on) {
+       if (force_on && !IS_CHERRYVIEW(dev_priv->dev)) {
+               /* WARN_ON only for the Valleyview */
+               WARN_ON(!!(val & VLV_GFX_CLK_FORCE_ON_BIT) == force_on);
+
                err = wait_for(!COND, 20);
                if (err) {
                        DRM_ERROR("timeout waiting for GFX clock force-off (%08x)\n",
Comment 8 Ding Heng 2015-03-06 07:02:49 UTC
Created attachment 114068 [details]
dmesg after patch

Latest nightly branch had fixed the boot issue. I installed your patch in comment 6 on latest nightly branch. Still some warning in dmesg.

root@x-bsw01:~# dmesg -r | egrep "<[1-4]>" |grep drm
<4>[  338.174625] WARNING: CPU: 2 PID: 24 at drivers/gpu/drm/i915/i915_gem.c:4626 i915_gem_suspend+0xbb/0xd3 [i915]()
<4>[  338.174734] Modules linked in: dm_mod snd_hda_codec_hdmi iTCO_wdt iTCO_vendor_support snd_hda_codec_realtek snd_hda_codec_generic serio_raw pcspkr snd_hda_intel snd_hda_controller i2c_i801 snd_hda_codec snd_hwdep snd_pcm snd_timer lpc_ich mfd_core snd soundcore battery joydev ac acpi_cpufreq i915 button video dr _kms_helper drm
<4>[  338.175191]  [<ffffffffa0079784>] ? i915_drm_suspend+0x59/0x1a1 [i915]
Comment 9 Joe Konno 2015-03-10 22:40:49 UTC
Neither of the patches mentioned here-- either attached or linked-- appear to have made it into drm-intel-nightly. Was it decided to use a different approach?
Comment 10 Jeff Zheng 2015-03-16 08:36:00 UTC
Created attachment 114343 [details]
dmesg_with_drm-intel-testing-2015-03-13

This issue also exists on drm-intel-testing-2015-03-13 with V59 BIOS.
Comment 11 Jeff Zheng 2015-03-31 07:45:41 UTC
exists on drm-intel-testing-2015-03-27
Comment 12 Jesse Barnes 2015-03-31 18:21:37 UTC
commit 85250ddff7a603dfe0ec0503a9e6395f79424f61
Author: Deepak S <deepak.s@linux.intel.com>
Date:   Sat Mar 28 15:23:34 2015 +0530

    drm/i915/chv: Remove Wait for a previous gfx force-off

the other suspend warning from #8 looks like a separate issue.  Please file another bug for that unless it's a duplicate.
Comment 13 Jeff Zheng 2015-04-01 01:47:54 UTC
Tried latest nightly commit d72ff1ab1499711c941831400629c14493313b3a and this issue got fixed.
Comment 14 Elizabeth 2017-10-06 14:33:17 UTC
Closing old verified.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.