Bug 105771 - [CI] igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a - dmesg-warn - *ERROR* timeout during PHY0 power on
Summary: [CI] igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a - dmesg-warn - *ERROR* ti...
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: XOrg git
Hardware: Other All
: medium normal
Assignee: Imre Deak
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard: ReadyForDev
Keywords:
: 103774 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-03-27 19:26 UTC by Martin Peres
Modified: 2018-05-03 16:41 UTC (History)
2 users (show)

See Also:
i915 platform: GLK
i915 features: display/Other


Attachments

Description Martin Peres 2018-03-27 19:26:17 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_3980/fi-glk-j4005/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html

[ 412.834893] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 412.839289] sd 0:0:0:0: [sda] Stopping disk
[ 413.045403] cache: parent cpu1 should not be sleeping
[ 413.123717] sd 0:0:0:0: [sda] Starting disk
[ 413.128140] [drm:_bxt_ddi_phy_init [i915]] *ERROR* timeout during PHY0 power on
Comment 1 Imre Deak 2018-03-29 11:53:54 UTC
After the timeout things seem to work correctly, the same PHY enabling will succeed afterwards. Since the timeout isn't actually specified by BSpec, we should just try increasing it:

diff --git a/drivers/gpu/drm/i915/intel_dpio_phy.c b/drivers/gpu/drm/i915/intel_dpio_phy.c
index c8e9e44e5981..00b3ab656b06 100644
--- a/drivers/gpu/drm/i915/intel_dpio_phy.c
+++ b/drivers/gpu/drm/i915/intel_dpio_phy.c
@@ -380,13 +380,14 @@ static void _bxt_ddi_phy_init(struct drm_i915_private *dev_priv,
 	 * all 1s.  Eventually they become accessible as they power up, then
 	 * the reserved bit will give the default 0.  Poll on the reserved bit
 	 * becoming 0 to find when the PHY is accessible.
-	 * HW team confirmed that the time to reach phypowergood status is
-	 * anywhere between 50 us and 100us.
+	 * The flag should get set in 100us according to the HW team, but
+	 * use 1ms due to occasional timeouts observed with that.
 	 */
-	if (wait_for_us(((I915_READ(BXT_PORT_CL1CM_DW0(phy)) &
-		(PHY_RESERVED | PHY_POWER_GOOD)) == PHY_POWER_GOOD), 100)) {
+	if (intel_wait_for_register_fw(dev_priv, BXT_PORT_CL1CM_DW0(phy),
+				       PHY_RESERVED | PHY_POWER_GOOD,
+				       PHY_POWER_GOOD,
+				       1))
 		DRM_ERROR("timeout during PHY%d power on\n", phy);
-	}
 
 	/* Program PLL Rcomp code offset */
 	val = I915_READ(BXT_PORT_CL1CM_DW9(phy));
Comment 3 Jani Saarinen 2018-04-09 12:54:59 UTC
reference: https://patchwork.freedesktop.org/series/41366/
Comment 4 Imre Deak 2018-04-10 10:19:55 UTC
Fix merged to drm-tip.
Comment 5 Marta Löfstedt 2018-04-11 06:08:03 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_4040/shard-glk5/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html

[  172.683710] [drm:_bxt_ddi_phy_init [i915]] *ERROR* timeout during PHY0 power on

The patch was integrated to CI_DRM_4039, so it doean't seem that the fix is enough.
Comment 6 Marta Löfstedt 2018-04-11 12:19:17 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_4043/shard-glk5/igt@gem_exec_suspend@basic-s3.html

[  148.463532] [drm:_bxt_ddi_phy_init [i915]] *ERROR* timeout during PHY0 power on
Comment 7 Imre Deak 2018-04-11 21:43:36 UTC
Hm, the logs don't seem to match the change in the fix:

(In reply to Marta Löfstedt from comment #5)
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_4040/shard-glk5/
> igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
> 
> [  172.683710] [drm:_bxt_ddi_phy_init [i915]] *ERROR* timeout during PHY0
> power on
> 
> The patch was integrated to CI_DRM_4039, so it doesn't seem that the fix is
> enough.

<7>[  172.683181] [drm:intel_power_well_enable [i915]] enabling dpio-common-b
<3>[  172.683710] [drm:_bxt_ddi_phy_init [i915]] *ERROR* timeout during PHY0 power on

The wait here was maximum ~600usec, as opposed to the minimum of 1msec we should have after the fix.

(In reply to Marta Löfstedt from comment #6)
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_4043/shard-glk5/
> igt@gem_exec_suspend@basic-s3.html
> 
> [  148.463532] [drm:_bxt_ddi_phy_init [i915]] *ERROR* timeout during PHY0
> power on

<7>[  148.463053] [drm:intel_power_well_enable [i915]] enabling dpio-common-b
<3>[  148.463532] [drm:_bxt_ddi_phy_init [i915]] *ERROR* timeout during PHY0 power on

The wait here was maximum ~500usec instead of the minimum of 1msec. 

The only explanation for this I have is that either that the system clock is off somehow, or that these CI runs were without the fix applied.
Comment 10 Marta Löfstedt 2018-04-13 10:23:02 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_4050/shard-glk3/igt@gem_softpin@noreloc-s3.html

[  158.579450] [drm:bxt_ddi_pll_enable [i915]] *ERROR* PLL 1 not locked
Comment 12 Jani Saarinen 2018-04-23 13:15:17 UTC
*** Bug 103774 has been marked as a duplicate of this bug. ***
Comment 13 Imre Deak 2018-04-25 13:40:49 UTC
Both

[drm:_bxt_ddi_phy_init [i915]] *ERROR* timeout during PHY0 power on
and
[drm:bxt_ddi_pll_enable [i915]] *ERROR* PLL 1 not locked

should be fixed by

commit 3085982c6b45d7d22f76e3aa018affbc143a7370
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date:   Mon Apr 23 14:37:53 2018 +0300

    drm/i915: Use ktime on wait_for
Comment 14 Jani Saarinen 2018-04-26 07:12:26 UTC
Was this fixed in CI?
Comment 15 Martin Peres 2018-04-30 07:20:49 UTC
(In reply to Jani Saarinen from comment #14)
> Was this fixed in CI?

This will take a couple of weeks to be sure.
Comment 16 Martin Peres 2018-05-03 16:41:18 UTC
This looks fixed.


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.