All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure
@ 2018-10-03  5:12 Guang Bai
  2018-10-03  5:33 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Guang Bai @ 2018-10-03  5:12 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula, Chris Chiu

On some platforms, slowly unplugging (wiggling) the HDMI cable makes
the kernel to believe the HDMI display still connected. This is because
the HDMI DDC lines are disconnected sometimes later after the hot-plug
interrupt triggered. Use the hot plug live states to honor HDMI hot plug
status in addtion to access the DDC channels.

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Guang Bai <guang.bai@intel.com>
---
 drivers/gpu/drm/i915/intel_hotplug.c | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
index 648a13c..db6288f 100644
--- a/drivers/gpu/drm/i915/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/intel_hotplug.c
@@ -246,17 +246,42 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
 	intel_runtime_pm_put(dev_priv);
 }
 
+#define MAX_SHORT_PULSE_MS	100
+#define PORT_CHECK_LOOP_COUNT	3
+
 bool intel_encoder_hotplug(struct intel_encoder *encoder,
 			   struct intel_connector *connector)
 {
 	struct drm_device *dev = connector->base.dev;
-	enum drm_connector_status old_status;
+	enum drm_connector_status old_status, new_status;
+	enum hpd_pin pin = encoder->hpd_pin;
+	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+	u32 count = 0;
 
 	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
 	old_status = connector->base.status;
 
-	connector->base.status =
-		drm_helper_probe_detect(&connector->base, NULL, false);
+	/*
+	 * Set HDMI connection status based on hot-plug live states and
+	 * display probe results.
+	 */
+	if ((encoder->type == INTEL_OUTPUT_HDMI ||
+	     encoder->type == INTEL_OUTPUT_DDI) &&
+	    dev_priv->hotplug.stats[pin].state == HPD_ENABLED) {
+		do {
+			new_status = connector_status_disconnected;
+			msleep(MAX_SHORT_PULSE_MS);
+
+			if (intel_digital_port_connected(encoder))
+				new_status = drm_helper_probe_detect(&connector->base,
+								     NULL, false);
+			if (new_status == connector_status_connected)
+				break;
+		} while (++count <= PORT_CHECK_LOOP_COUNT);
+		connector->base.status = new_status;
+	} else
+		connector->base.status =
+			drm_helper_probe_detect(&connector->base, NULL, false);
 
 	if (old_status == connector->base.status)
 		return false;
-- 
2.7.4

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

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

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fix the HDMI hot plug disconnection failure
  2018-10-03  5:12 [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure Guang Bai
@ 2018-10-03  5:33 ` Patchwork
  2018-10-03  5:57 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2018-10-03  5:33 UTC (permalink / raw)
  To: Guang Bai; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Fix the HDMI hot plug disconnection failure
URL   : https://patchwork.freedesktop.org/series/50477/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
de3c5d5af683 drm/i915: Fix the HDMI hot plug disconnection failure
-:60: CHECK:BRACES: Unbalanced braces around else statement
#60: FILE: drivers/gpu/drm/i915/intel_hotplug.c:282:
+	} else

total: 0 errors, 0 warnings, 1 checks, 45 lines checked

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Fix the HDMI hot plug disconnection failure
  2018-10-03  5:12 [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure Guang Bai
  2018-10-03  5:33 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-10-03  5:57 ` Patchwork
  2018-10-03  9:22 ` [PATCH] " Chris Chiu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2018-10-03  5:57 UTC (permalink / raw)
  To: Guang Bai; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Fix the HDMI hot plug disconnection failure
URL   : https://patchwork.freedesktop.org/series/50477/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4916 -> Patchwork_10333 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/50477/revisions/1/mbox/

== Known issues ==

  Here are the changes found in Patchwork_10333 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s3:
      fi-bdw-samus:       PASS -> INCOMPLETE (fdo#107773)

    igt@kms_pipe_crc_basic@hang-read-crc-pipe-b:
      fi-byt-clapper:     PASS -> FAIL (fdo#107362, fdo#103191)

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#106725, fdo#106248) -> PASS

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-glk-j4005:       FAIL (fdo#100368) -> PASS

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     FAIL (fdo#103167) -> PASS

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
      fi-byt-clapper:     FAIL (fdo#107362) -> PASS

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
  fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773


== Participating hosts (45 -> 39) ==

  Missing    (6): fi-byt-squawks fi-bsw-cyan fi-icl-u2 fi-bwr-2160 fi-snb-2520m fi-pnv-d510 


== Build changes ==

    * Linux: CI_DRM_4916 -> Patchwork_10333

  CI_DRM_4916: c3900869be8592412dc71001c22c7452a7044eab @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4662: ebf6a1dd1795e2f014ff3c47fe2eb4d5255845bd @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10333: de3c5d5af683585af5574cfd32fe25ed597faf8e @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

de3c5d5af683 drm/i915: Fix the HDMI hot plug disconnection failure

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10333/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure
  2018-10-03  5:12 [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure Guang Bai
  2018-10-03  5:33 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
  2018-10-03  5:57 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-10-03  9:22 ` Chris Chiu
  2018-10-03 17:57   ` [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2) Guang Bai
  2018-10-03  9:34 ` ✗ Fi.CI.IGT: failure for drm/i915: Fix the HDMI hot plug disconnection failure Patchwork
  2018-10-03 18:41 ` ✗ Fi.CI.BAT: failure for drm/i915: Fix the HDMI hot plug disconnection failure (rev2) Patchwork
  4 siblings, 1 reply; 18+ messages in thread
From: Chris Chiu @ 2018-10-03  9:22 UTC (permalink / raw)
  To: guang.bai; +Cc: Jani Nikula, intel-gfx

It works on my problematic laptops. Verified on X530UN and X560UD.
On Wed, Oct 3, 2018 at 1:23 PM Guang Bai <guang.bai@intel.com> wrote:
>
> On some platforms, slowly unplugging (wiggling) the HDMI cable makes
> the kernel to believe the HDMI display still connected. This is because
> the HDMI DDC lines are disconnected sometimes later after the hot-plug
> interrupt triggered. Use the hot plug live states to honor HDMI hot plug
> status in addtion to access the DDC channels.
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Chris Chiu <chiu@endlessm.com>
> Signed-off-by: Guang Bai <guang.bai@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hotplug.c | 31 ++++++++++++++++++++++++++++---
>  1 file changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
> index 648a13c..db6288f 100644
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -246,17 +246,42 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
>         intel_runtime_pm_put(dev_priv);
>  }
>
> +#define MAX_SHORT_PULSE_MS     100
> +#define PORT_CHECK_LOOP_COUNT  3
> +
>  bool intel_encoder_hotplug(struct intel_encoder *encoder,
>                            struct intel_connector *connector)
>  {
>         struct drm_device *dev = connector->base.dev;
> -       enum drm_connector_status old_status;
> +       enum drm_connector_status old_status, new_status;
> +       enum hpd_pin pin = encoder->hpd_pin;
> +       struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> +       u32 count = 0;
>
>         WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
>         old_status = connector->base.status;
>
> -       connector->base.status =
> -               drm_helper_probe_detect(&connector->base, NULL, false);
> +       /*
> +        * Set HDMI connection status based on hot-plug live states and
> +        * display probe results.
> +        */
> +       if ((encoder->type == INTEL_OUTPUT_HDMI ||
> +            encoder->type == INTEL_OUTPUT_DDI) &&
> +           dev_priv->hotplug.stats[pin].state == HPD_ENABLED) {
> +               do {
> +                       new_status = connector_status_disconnected;
> +                       msleep(MAX_SHORT_PULSE_MS);
> +
> +                       if (intel_digital_port_connected(encoder))
> +                               new_status = drm_helper_probe_detect(&connector->base,
> +                                                                    NULL, false);
> +                       if (new_status == connector_status_connected)
> +                               break;
> +               } while (++count <= PORT_CHECK_LOOP_COUNT);
> +               connector->base.status = new_status;
> +       } else
> +               connector->base.status =
> +                       drm_helper_probe_detect(&connector->base, NULL, false);
>
>         if (old_status == connector->base.status)
>                 return false;
> --
> 2.7.4
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.IGT: failure for drm/i915: Fix the HDMI hot plug disconnection failure
  2018-10-03  5:12 [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure Guang Bai
                   ` (2 preceding siblings ...)
  2018-10-03  9:22 ` [PATCH] " Chris Chiu
@ 2018-10-03  9:34 ` Patchwork
  2018-10-03  9:52   ` Martin Peres
  2018-10-03 18:41 ` ✗ Fi.CI.BAT: failure for drm/i915: Fix the HDMI hot plug disconnection failure (rev2) Patchwork
  4 siblings, 1 reply; 18+ messages in thread
From: Patchwork @ 2018-10-03  9:34 UTC (permalink / raw)
  To: Guang Bai; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Fix the HDMI hot plug disconnection failure
URL   : https://patchwork.freedesktop.org/series/50477/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4916_full -> Patchwork_10333_full =

== Summary - FAILURE ==

  Serious unknown changes coming with Patchwork_10333_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_10333_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_10333_full:

  === IGT changes ===

    ==== Possible regressions ====

    igt@kms_color@pipe-c-ctm-max:
      shard-apl:          PASS -> FAIL

    
    ==== Warnings ====

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          SKIP -> PASS
      shard-snb:          SKIP -> PASS

    
== Known issues ==

  Here are the changes found in Patchwork_10333_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_schedule@pi-ringfull-bsd:
      shard-glk:          NOTRUN -> FAIL (fdo#103158)

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-skl:          NOTRUN -> TIMEOUT (fdo#108039, fdo#108130)

    igt@kms_busy@extended-modeset-hang-newfb-render-c:
      shard-glk:          NOTRUN -> DMESG-WARN (fdo#107956) +1

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
      shard-snb:          NOTRUN -> DMESG-WARN (fdo#107956)

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
      shard-skl:          NOTRUN -> DMESG-WARN (fdo#107956) +1

    igt@kms_cursor_crc@cursor-128x42-onscreen:
      shard-skl:          NOTRUN -> FAIL (fdo#103232)

    igt@kms_cursor_crc@cursor-128x42-random:
      shard-glk:          PASS -> FAIL (fdo#103232) +1

    igt@kms_cursor_crc@cursor-256x256-suspend:
      shard-glk:          NOTRUN -> FAIL (fdo#103232)

    igt@kms_cursor_crc@cursor-256x85-onscreen:
      shard-apl:          PASS -> FAIL (fdo#103232) +1

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
      shard-glk:          PASS -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
      shard-skl:          NOTRUN -> FAIL (fdo#103167) +1
      shard-glk:          NOTRUN -> FAIL (fdo#103167)

    igt@kms_plane@plane-position-covered-pipe-b-planes:
      shard-glk:          PASS -> FAIL (fdo#103166)

    {igt@kms_plane_alpha_blend@pipe-a-alpha-7efc}:
      shard-skl:          NOTRUN -> FAIL (fdo#108145) +1

    {igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max}:
      shard-glk:          NOTRUN -> FAIL (fdo#108145) +2

    {igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max}:
      shard-apl:          NOTRUN -> FAIL (fdo#108145)

    igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
      shard-apl:          PASS -> FAIL (fdo#103166)

    igt@kms_setmode@basic:
      shard-glk:          NOTRUN -> FAIL (fdo#99912)
      shard-hsw:          PASS -> FAIL (fdo#99912)
      shard-snb:          NOTRUN -> FAIL (fdo#99912)

    igt@kms_sysfs_edid_timing:
      shard-skl:          NOTRUN -> FAIL (fdo#100047)

    igt@pm_rpm@modeset-non-lpsp:
      shard-skl:          NOTRUN -> INCOMPLETE (fdo#107807)

    igt@pm_rpm@modeset-non-lpsp-stress-no-wait:
      shard-skl:          SKIP -> INCOMPLETE (fdo#107807)

    igt@syncobj_basic@illegal-fd-to-handle:
      shard-glk:          PASS -> DMESG-WARN (fdo#105763, fdo#106538) +1

    
    ==== Possible fixes ====

    igt@gem_exec_await@wide-contexts:
      shard-apl:          FAIL (fdo#106680) -> PASS

    igt@kms_cursor_crc@cursor-64x21-random:
      shard-glk:          FAIL (fdo#103232) -> PASS

    igt@kms_flip@flip-vs-expired-vblank:
      shard-skl:          FAIL (fdo#105363) -> PASS

    igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
      shard-glk:          FAIL (fdo#103166) -> PASS

    igt@kms_setmode@basic:
      shard-kbl:          FAIL (fdo#99912) -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
  fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
  fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
  fdo#106680 https://bugs.freedesktop.org/show_bug.cgi?id=106680
  fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
  fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
  fdo#108039 https://bugs.freedesktop.org/show_bug.cgi?id=108039
  fdo#108130 https://bugs.freedesktop.org/show_bug.cgi?id=108130
  fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (6 -> 6) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4916 -> Patchwork_10333

  CI_DRM_4916: c3900869be8592412dc71001c22c7452a7044eab @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4662: ebf6a1dd1795e2f014ff3c47fe2eb4d5255845bd @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10333: de3c5d5af683585af5574cfd32fe25ed597faf8e @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10333/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: ✗ Fi.CI.IGT: failure for drm/i915: Fix the HDMI hot plug disconnection failure
  2018-10-03  9:34 ` ✗ Fi.CI.IGT: failure for drm/i915: Fix the HDMI hot plug disconnection failure Patchwork
@ 2018-10-03  9:52   ` Martin Peres
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Peres @ 2018-10-03  9:52 UTC (permalink / raw)
  To: intel-gfx, Patchwork, Guang Bai

On 03/10/2018 12:34, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915: Fix the HDMI hot plug disconnection failure
> URL   : https://patchwork.freedesktop.org/series/50477/
> State : failure
> 
> == Summary ==
> 
> = CI Bug Log - changes from CI_DRM_4916_full -> Patchwork_10333_full =
> 
> == Summary - FAILURE ==
> 
>   Serious unknown changes coming with Patchwork_10333_full absolutely need to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in Patchwork_10333_full, please notify your bug team to allow them
>   to document this new failure mode, which will reduce false positives in CI.
> 
>   
> 
> == Possible new issues ==
> 
>   Here are the unknown changes that may have been introduced in Patchwork_10333_full:
> 
>   === IGT changes ===
> 
>     ==== Possible regressions ====
> 
>     igt@kms_color@pipe-c-ctm-max:
>       shard-apl:          PASS -> FAIL

Known issue: https://bugs.freedesktop.org/show_bug.cgi?id=108147

Martin

> 
>     
>     ==== Warnings ====
> 
>     igt@pm_rc6_residency@rc6-accuracy:
>       shard-kbl:          SKIP -> PASS
>       shard-snb:          SKIP -> PASS
> 
>     
> == Known issues ==
> 
>   Here are the changes found in Patchwork_10333_full that come from known issues:
> 
>   === IGT changes ===
> 
>     ==== Issues hit ====
> 
>     igt@gem_exec_schedule@pi-ringfull-bsd:
>       shard-glk:          NOTRUN -> FAIL (fdo#103158)
> 
>     igt@gem_ppgtt@blt-vs-render-ctx0:
>       shard-skl:          NOTRUN -> TIMEOUT (fdo#108039, fdo#108130)
> 
>     igt@kms_busy@extended-modeset-hang-newfb-render-c:
>       shard-glk:          NOTRUN -> DMESG-WARN (fdo#107956) +1
> 
>     igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
>       shard-snb:          NOTRUN -> DMESG-WARN (fdo#107956)
> 
>     igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
>       shard-skl:          NOTRUN -> DMESG-WARN (fdo#107956) +1
> 
>     igt@kms_cursor_crc@cursor-128x42-onscreen:
>       shard-skl:          NOTRUN -> FAIL (fdo#103232)
> 
>     igt@kms_cursor_crc@cursor-128x42-random:
>       shard-glk:          PASS -> FAIL (fdo#103232) +1
> 
>     igt@kms_cursor_crc@cursor-256x256-suspend:
>       shard-glk:          NOTRUN -> FAIL (fdo#103232)
> 
>     igt@kms_cursor_crc@cursor-256x85-onscreen:
>       shard-apl:          PASS -> FAIL (fdo#103232) +1
> 
>     igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
>       shard-glk:          PASS -> FAIL (fdo#103167)
> 
>     igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
>       shard-skl:          NOTRUN -> FAIL (fdo#103167) +1
>       shard-glk:          NOTRUN -> FAIL (fdo#103167)
> 
>     igt@kms_plane@plane-position-covered-pipe-b-planes:
>       shard-glk:          PASS -> FAIL (fdo#103166)
> 
>     {igt@kms_plane_alpha_blend@pipe-a-alpha-7efc}:
>       shard-skl:          NOTRUN -> FAIL (fdo#108145) +1
> 
>     {igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max}:
>       shard-glk:          NOTRUN -> FAIL (fdo#108145) +2
> 
>     {igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max}:
>       shard-apl:          NOTRUN -> FAIL (fdo#108145)
> 
>     igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
>       shard-apl:          PASS -> FAIL (fdo#103166)
> 
>     igt@kms_setmode@basic:
>       shard-glk:          NOTRUN -> FAIL (fdo#99912)
>       shard-hsw:          PASS -> FAIL (fdo#99912)
>       shard-snb:          NOTRUN -> FAIL (fdo#99912)
> 
>     igt@kms_sysfs_edid_timing:
>       shard-skl:          NOTRUN -> FAIL (fdo#100047)
> 
>     igt@pm_rpm@modeset-non-lpsp:
>       shard-skl:          NOTRUN -> INCOMPLETE (fdo#107807)
> 
>     igt@pm_rpm@modeset-non-lpsp-stress-no-wait:
>       shard-skl:          SKIP -> INCOMPLETE (fdo#107807)
> 
>     igt@syncobj_basic@illegal-fd-to-handle:
>       shard-glk:          PASS -> DMESG-WARN (fdo#105763, fdo#106538) +1
> 
>     
>     ==== Possible fixes ====
> 
>     igt@gem_exec_await@wide-contexts:
>       shard-apl:          FAIL (fdo#106680) -> PASS
> 
>     igt@kms_cursor_crc@cursor-64x21-random:
>       shard-glk:          FAIL (fdo#103232) -> PASS
> 
>     igt@kms_flip@flip-vs-expired-vblank:
>       shard-skl:          FAIL (fdo#105363) -> PASS
> 
>     igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
>       shard-glk:          FAIL (fdo#103166) -> PASS
> 
>     igt@kms_setmode@basic:
>       shard-kbl:          FAIL (fdo#99912) -> PASS
> 
>     
>   {name}: This element is suppressed. This means it is ignored when computing
>           the status of the difference (SUCCESS, WARNING, or FAILURE).
> 
>   fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
>   fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
>   fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
>   fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
>   fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
>   fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
>   fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
>   fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
>   fdo#106680 https://bugs.freedesktop.org/show_bug.cgi?id=106680
>   fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
>   fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
>   fdo#108039 https://bugs.freedesktop.org/show_bug.cgi?id=108039
>   fdo#108130 https://bugs.freedesktop.org/show_bug.cgi?id=108130
>   fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
>   fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
> 
> 
> == Participating hosts (6 -> 6) ==
> 
>   No changes in participating hosts
> 
> 
> == Build changes ==
> 
>     * Linux: CI_DRM_4916 -> Patchwork_10333
> 
>   CI_DRM_4916: c3900869be8592412dc71001c22c7452a7044eab @ git://anongit.freedesktop.org/gfx-ci/linux
>   IGT_4662: ebf6a1dd1795e2f014ff3c47fe2eb4d5255845bd @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
>   Patchwork_10333: de3c5d5af683585af5574cfd32fe25ed597faf8e @ git://anongit.freedesktop.org/gfx-ci/linux
>   piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10333/shards.html
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-10-03  9:22 ` [PATCH] " Chris Chiu
@ 2018-10-03 17:57   ` Guang Bai
  2018-10-08 14:35     ` Chris Chiu
  0 siblings, 1 reply; 18+ messages in thread
From: Guang Bai @ 2018-10-03 17:57 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula, Chris Chiu

On some platforms, slowly unplugging (wiggling) the HDMI cable makes
the kernel to believe the HDMI display still connected. This is because
the HDMI DDC lines are disconnected sometimes later after the hot-plug
interrupt triggered. Use the hot plug live states to honor HDMI hot plug
status in addtion to access the DDC channels.

v2: Fix the formatting issue

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Guang Bai <guang.bai@intel.com>
---
 drivers/gpu/drm/i915/intel_hotplug.c | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
index 648a13c..98ab1ab 100644
--- a/drivers/gpu/drm/i915/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/intel_hotplug.c
@@ -246,17 +246,43 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
 	intel_runtime_pm_put(dev_priv);
 }
 
+#define MAX_SHORT_PULSE_MS	100
+#define PORT_CHECK_LOOP_COUNT	3
+
 bool intel_encoder_hotplug(struct intel_encoder *encoder,
 			   struct intel_connector *connector)
 {
 	struct drm_device *dev = connector->base.dev;
-	enum drm_connector_status old_status;
+	enum drm_connector_status old_status, new_status;
+	enum hpd_pin pin = encoder->hpd_pin;
+	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+	u32 count = 0;
 
 	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
 	old_status = connector->base.status;
 
-	connector->base.status =
-		drm_helper_probe_detect(&connector->base, NULL, false);
+	/*
+	 * Set HDMI connection status based on hot-plug live states and
+	 * display probe results.
+	 */
+	if ((encoder->type == INTEL_OUTPUT_HDMI ||
+	     encoder->type == INTEL_OUTPUT_DDI) &&
+	    dev_priv->hotplug.stats[pin].state == HPD_ENABLED) {
+		do {
+			new_status = connector_status_disconnected;
+			msleep(MAX_SHORT_PULSE_MS);
+
+			if (intel_digital_port_connected(encoder))
+				new_status = drm_helper_probe_detect(&connector->base,
+								     NULL, false);
+			if (new_status == connector_status_connected)
+				break;
+		} while (++count <= PORT_CHECK_LOOP_COUNT);
+		connector->base.status = new_status;
+	} else {
+		connector->base.status =
+			drm_helper_probe_detect(&connector->base, NULL, false);
+	}
 
 	if (old_status == connector->base.status)
 		return false;
-- 
2.7.4

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

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

* ✗ Fi.CI.BAT: failure for drm/i915: Fix the HDMI hot plug disconnection failure (rev2)
  2018-10-03  5:12 [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure Guang Bai
                   ` (3 preceding siblings ...)
  2018-10-03  9:34 ` ✗ Fi.CI.IGT: failure for drm/i915: Fix the HDMI hot plug disconnection failure Patchwork
@ 2018-10-03 18:41 ` Patchwork
  4 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2018-10-03 18:41 UTC (permalink / raw)
  To: Guang Bai; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Fix the HDMI hot plug disconnection failure (rev2)
URL   : https://patchwork.freedesktop.org/series/50477/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4923 -> Patchwork_10347 =

== Summary - FAILURE ==

  Serious unknown changes coming with Patchwork_10347 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_10347, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/50477/revisions/2/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_10347:

  === IGT changes ===

    ==== Possible regressions ====

    igt@kms_flip@basic-flip-vs-modeset:
      fi-glk-j4005:       PASS -> DMESG-WARN
      fi-elk-e7500:       PASS -> DMESG-WARN

    
    ==== Warnings ====

    igt@pm_rpm@module-reload:
      fi-hsw-4770r:       SKIP -> PASS

    
== Known issues ==

  Here are the changes found in Patchwork_10347 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_sanitycheck:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#107726)

    igt@gem_exec_suspend@basic-s3:
      fi-bdw-samus:       PASS -> INCOMPLETE (fdo#107773)

    igt@gem_exec_suspend@basic-s4-devices:
      fi-kbl-7500u:       PASS -> DMESG-WARN (fdo#107139, fdo#105128)

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     PASS -> FAIL (fdo#103167)

    
    ==== Possible fixes ====

    igt@drv_getparams_basic@basic-eu-total:
      fi-kbl-7560u:       INCOMPLETE (fdo#103665) -> PASS

    igt@drv_module_reload@basic-reload-inject:
      fi-hsw-4770r:       DMESG-WARN (fdo#107425, fdo#107924) -> PASS

    igt@gem_basic@bad-close:
      fi-glk-j4005:       DMESG-WARN (fdo#105719) -> PASS +1

    igt@pm_rpm@module-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#107726) -> PASS

    
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
  fdo#105719 https://bugs.freedesktop.org/show_bug.cgi?id=105719
  fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
  fdo#107425 https://bugs.freedesktop.org/show_bug.cgi?id=107425
  fdo#107726 https://bugs.freedesktop.org/show_bug.cgi?id=107726
  fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
  fdo#107924 https://bugs.freedesktop.org/show_bug.cgi?id=107924


== Participating hosts (49 -> 42) ==

  Additional (1): fi-pnv-d510 
  Missing    (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bwr-2160 fi-bsw-cyan fi-ctg-p8600 fi-blb-e6850 


== Build changes ==

    * Linux: CI_DRM_4923 -> Patchwork_10347

  CI_DRM_4923: ebe8b202efb15420473f26d2386d1302bfc91429 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4665: 267870165d9ef66b4ab423e4efe7bacba023d75e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10347: b2aa0791339bd4d8cbbb956c7dd423e8d0f419f5 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

b2aa0791339b drm/i915: Fix the HDMI hot plug disconnection failure (v2)

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10347/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-10-03 17:57   ` [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2) Guang Bai
@ 2018-10-08 14:35     ` Chris Chiu
  2018-10-08 15:56       ` Guang Bai
  0 siblings, 1 reply; 18+ messages in thread
From: Chris Chiu @ 2018-10-08 14:35 UTC (permalink / raw)
  To: guang.bai; +Cc: Jani Nikula, intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 3058 bytes --]

Thanks! I have no problem with this patch.

On Thu, Oct 4, 2018 at 2:08 AM Guang Bai <guang.bai@intel.com> wrote:

> On some platforms, slowly unplugging (wiggling) the HDMI cable makes
> the kernel to believe the HDMI display still connected. This is because
> the HDMI DDC lines are disconnected sometimes later after the hot-plug
> interrupt triggered. Use the hot plug live states to honor HDMI hot plug
> status in addtion to access the DDC channels.
>
> v2: Fix the formatting issue
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Chris Chiu <chiu@endlessm.com>
> Signed-off-by: Guang Bai <guang.bai@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hotplug.c | 32 +++++++++++++++++++++++++++++---
>  1 file changed, 29 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
> b/drivers/gpu/drm/i915/intel_hotplug.c
> index 648a13c..98ab1ab 100644
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -246,17 +246,43 @@ static void intel_hpd_irq_storm_reenable_work(struct
> work_struct *work)
>         intel_runtime_pm_put(dev_priv);
>  }
>
> +#define MAX_SHORT_PULSE_MS     100
> +#define PORT_CHECK_LOOP_COUNT  3
> +
>  bool intel_encoder_hotplug(struct intel_encoder *encoder,
>                            struct intel_connector *connector)
>  {
>         struct drm_device *dev = connector->base.dev;
> -       enum drm_connector_status old_status;
> +       enum drm_connector_status old_status, new_status;
> +       enum hpd_pin pin = encoder->hpd_pin;
> +       struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> +       u32 count = 0;
>
>         WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
>         old_status = connector->base.status;
>
> -       connector->base.status =
> -               drm_helper_probe_detect(&connector->base, NULL, false);
> +       /*
> +        * Set HDMI connection status based on hot-plug live states and
> +        * display probe results.
> +        */
> +       if ((encoder->type == INTEL_OUTPUT_HDMI ||
> +            encoder->type == INTEL_OUTPUT_DDI) &&
> +           dev_priv->hotplug.stats[pin].state == HPD_ENABLED) {
> +               do {
> +                       new_status = connector_status_disconnected;
> +                       msleep(MAX_SHORT_PULSE_MS);
> +
> +                       if (intel_digital_port_connected(encoder))
> +                               new_status =
> drm_helper_probe_detect(&connector->base,
> +                                                                    NULL,
> false);
> +                       if (new_status == connector_status_connected)
> +                               break;
> +               } while (++count <= PORT_CHECK_LOOP_COUNT);
> +               connector->base.status = new_status;
> +       } else {
> +               connector->base.status =
> +                       drm_helper_probe_detect(&connector->base, NULL,
> false);
> +       }
>
>         if (old_status == connector->base.status)
>                 return false;
> --
> 2.7.4
>
>

[-- Attachment #1.2: Type: text/html, Size: 4049 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-10-08 14:35     ` Chris Chiu
@ 2018-10-08 15:56       ` Guang Bai
  2018-10-10 17:52         ` Guang Bai
  0 siblings, 1 reply; 18+ messages in thread
From: Guang Bai @ 2018-10-08 15:56 UTC (permalink / raw)
  To: Chris Chiu; +Cc: Jani Nikula, intel-gfx

On Mon, 8 Oct 2018 22:35:34 +0800
Chris Chiu <chiu@endlessm.com> wrote:

> Thanks! I have no problem with this patch.

There are Fi.CI.BAT failures with the v2 (only with formatting fix
added) while the previous patch had passing results.
Now trying to identify why the failures happened with trybot
Thanks,
Guang

> 
> On Thu, Oct 4, 2018 at 2:08 AM Guang Bai <guang.bai@intel.com> wrote:
> 
> > On some platforms, slowly unplugging (wiggling) the HDMI cable makes
> > the kernel to believe the HDMI display still connected. This is
> > because the HDMI DDC lines are disconnected sometimes later after
> > the hot-plug interrupt triggered. Use the hot plug live states to
> > honor HDMI hot plug status in addtion to access the DDC channels.
> >
> > v2: Fix the formatting issue
> >
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Cc: Chris Chiu <chiu@endlessm.com>
> > Signed-off-by: Guang Bai <guang.bai@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_hotplug.c | 32
> > +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+),
> > 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
> > b/drivers/gpu/drm/i915/intel_hotplug.c
> > index 648a13c..98ab1ab 100644
> > --- a/drivers/gpu/drm/i915/intel_hotplug.c
> > +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> > @@ -246,17 +246,43 @@ static void
> > intel_hpd_irq_storm_reenable_work(struct work_struct *work)
> >         intel_runtime_pm_put(dev_priv);
> >  }
> >
> > +#define MAX_SHORT_PULSE_MS     100
> > +#define PORT_CHECK_LOOP_COUNT  3
> > +
> >  bool intel_encoder_hotplug(struct intel_encoder *encoder,
> >                            struct intel_connector *connector)
> >  {
> >         struct drm_device *dev = connector->base.dev;
> > -       enum drm_connector_status old_status;
> > +       enum drm_connector_status old_status, new_status;
> > +       enum hpd_pin pin = encoder->hpd_pin;
> > +       struct drm_i915_private *dev_priv =
> > to_i915(encoder->base.dev);
> > +       u32 count = 0;
> >
> >         WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> >         old_status = connector->base.status;
> >
> > -       connector->base.status =
> > -               drm_helper_probe_detect(&connector->base, NULL,
> > false);
> > +       /*
> > +        * Set HDMI connection status based on hot-plug live states
> > and
> > +        * display probe results.
> > +        */
> > +       if ((encoder->type == INTEL_OUTPUT_HDMI ||
> > +            encoder->type == INTEL_OUTPUT_DDI) &&
> > +           dev_priv->hotplug.stats[pin].state == HPD_ENABLED) {
> > +               do {
> > +                       new_status = connector_status_disconnected;
> > +                       msleep(MAX_SHORT_PULSE_MS);
> > +
> > +                       if (intel_digital_port_connected(encoder))
> > +                               new_status =
> > drm_helper_probe_detect(&connector->base,
> > +
> > NULL, false);
> > +                       if (new_status ==
> > connector_status_connected)
> > +                               break;
> > +               } while (++count <= PORT_CHECK_LOOP_COUNT);
> > +               connector->base.status = new_status;
> > +       } else {
> > +               connector->base.status =
> > +                       drm_helper_probe_detect(&connector->base,
> > NULL, false);
> > +       }
> >
> >         if (old_status == connector->base.status)
> >                 return false;
> > --
> > 2.7.4
> >
> >  

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

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-10-08 15:56       ` Guang Bai
@ 2018-10-10 17:52         ` Guang Bai
  2018-10-23  9:14           ` Chris Chiu
  0 siblings, 1 reply; 18+ messages in thread
From: Guang Bai @ 2018-10-10 17:52 UTC (permalink / raw)
  To: Chris Chiu; +Cc: Jani Nikula, intel-gfx

On Mon, 8 Oct 2018 08:56:20 -0700
Guang Bai <guang.bai@intel.com> wrote:

> On Mon, 8 Oct 2018 22:35:34 +0800
> Chris Chiu <chiu@endlessm.com> wrote:
> 
> > Thanks! I have no problem with this patch.  
> 
> There are Fi.CI.BAT failures with the v2 (only with formatting fix
> added) while the previous patch had passing results.
> Now trying to identify why the failures happened with trybot
> Thanks,
> Guang
The tribot run my patch twice and passes the tests without any error
however I'm recommended to chase down root causes of Patchwork Fi.CI.BAT
test errors still - WIP on that.
Thanks,
Guang
> 
> > 
> > On Thu, Oct 4, 2018 at 2:08 AM Guang Bai <guang.bai@intel.com>
> > wrote: 
> > > On some platforms, slowly unplugging (wiggling) the HDMI cable
> > > makes the kernel to believe the HDMI display still connected.
> > > This is because the HDMI DDC lines are disconnected sometimes
> > > later after the hot-plug interrupt triggered. Use the hot plug
> > > live states to honor HDMI hot plug status in addtion to access
> > > the DDC channels.
> > >
> > > v2: Fix the formatting issue
> > >
> > > Cc: Jani Nikula <jani.nikula@intel.com>
> > > Cc: Chris Chiu <chiu@endlessm.com>
> > > Signed-off-by: Guang Bai <guang.bai@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/intel_hotplug.c | 32
> > > +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+),
> > > 3 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
> > > b/drivers/gpu/drm/i915/intel_hotplug.c
> > > index 648a13c..98ab1ab 100644
> > > --- a/drivers/gpu/drm/i915/intel_hotplug.c
> > > +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> > > @@ -246,17 +246,43 @@ static void
> > > intel_hpd_irq_storm_reenable_work(struct work_struct *work)
> > >         intel_runtime_pm_put(dev_priv);
> > >  }
> > >
> > > +#define MAX_SHORT_PULSE_MS     100
> > > +#define PORT_CHECK_LOOP_COUNT  3
> > > +
> > >  bool intel_encoder_hotplug(struct intel_encoder *encoder,
> > >                            struct intel_connector *connector)
> > >  {
> > >         struct drm_device *dev = connector->base.dev;
> > > -       enum drm_connector_status old_status;
> > > +       enum drm_connector_status old_status, new_status;
> > > +       enum hpd_pin pin = encoder->hpd_pin;
> > > +       struct drm_i915_private *dev_priv =
> > > to_i915(encoder->base.dev);
> > > +       u32 count = 0;
> > >
> > >         WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> > >         old_status = connector->base.status;
> > >
> > > -       connector->base.status =
> > > -               drm_helper_probe_detect(&connector->base, NULL,
> > > false);
> > > +       /*
> > > +        * Set HDMI connection status based on hot-plug live
> > > states and
> > > +        * display probe results.
> > > +        */
> > > +       if ((encoder->type == INTEL_OUTPUT_HDMI ||
> > > +            encoder->type == INTEL_OUTPUT_DDI) &&
> > > +           dev_priv->hotplug.stats[pin].state == HPD_ENABLED) {
> > > +               do {
> > > +                       new_status =
> > > connector_status_disconnected;
> > > +                       msleep(MAX_SHORT_PULSE_MS);
> > > +
> > > +                       if (intel_digital_port_connected(encoder))
> > > +                               new_status =
> > > drm_helper_probe_detect(&connector->base,
> > > +
> > > NULL, false);
> > > +                       if (new_status ==
> > > connector_status_connected)
> > > +                               break;
> > > +               } while (++count <= PORT_CHECK_LOOP_COUNT);
> > > +               connector->base.status = new_status;
> > > +       } else {
> > > +               connector->base.status =
> > > +                       drm_helper_probe_detect(&connector->base,
> > > NULL, false);
> > > +       }
> > >
> > >         if (old_status == connector->base.status)
> > >                 return false;
> > > --
> > > 2.7.4
> > >
> > >    
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-10-10 17:52         ` Guang Bai
@ 2018-10-23  9:14           ` Chris Chiu
  2018-10-29 17:12             ` Guang Bai
  0 siblings, 1 reply; 18+ messages in thread
From: Chris Chiu @ 2018-10-23  9:14 UTC (permalink / raw)
  To: guang.bai; +Cc: Jani Nikula, intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 4407 bytes --]

On Thu, Oct 11, 2018 at 2:04 AM Guang Bai <guang.bai@intel.com> wrote:

> On Mon, 8 Oct 2018 08:56:20 -0700
> Guang Bai <guang.bai@intel.com> wrote:
>
> > On Mon, 8 Oct 2018 22:35:34 +0800
> > Chris Chiu <chiu@endlessm.com> wrote:
> >
> > > Thanks! I have no problem with this patch.
> >
> > There are Fi.CI.BAT failures with the v2 (only with formatting fix
> > added) while the previous patch had passing results.
> > Now trying to identify why the failures happened with trybot
> > Thanks,
> > Guang
> The tribot run my patch twice and passes the tests without any error
> however I'm recommended to chase down root causes of Patchwork Fi.CI.BAT
> test errors still - WIP on that.
> Thanks,
> Guang
>

Gentle ping. Any good news on this?

Chris


> >
> > >
> > > On Thu, Oct 4, 2018 at 2:08 AM Guang Bai <guang.bai@intel.com>
> > > wrote:
> > > > On some platforms, slowly unplugging (wiggling) the HDMI cable
> > > > makes the kernel to believe the HDMI display still connected.
> > > > This is because the HDMI DDC lines are disconnected sometimes
> > > > later after the hot-plug interrupt triggered. Use the hot plug
> > > > live states to honor HDMI hot plug status in addtion to access
> > > > the DDC channels.
> > > >
> > > > v2: Fix the formatting issue
> > > >
> > > > Cc: Jani Nikula <jani.nikula@intel.com>
> > > > Cc: Chris Chiu <chiu@endlessm.com>
> > > > Signed-off-by: Guang Bai <guang.bai@intel.com>
> > > > ---
> > > >  drivers/gpu/drm/i915/intel_hotplug.c | 32
> > > > +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+),
> > > > 3 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > index 648a13c..98ab1ab 100644
> > > > --- a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > @@ -246,17 +246,43 @@ static void
> > > > intel_hpd_irq_storm_reenable_work(struct work_struct *work)
> > > >         intel_runtime_pm_put(dev_priv);
> > > >  }
> > > >
> > > > +#define MAX_SHORT_PULSE_MS     100
> > > > +#define PORT_CHECK_LOOP_COUNT  3
> > > > +
> > > >  bool intel_encoder_hotplug(struct intel_encoder *encoder,
> > > >                            struct intel_connector *connector)
> > > >  {
> > > >         struct drm_device *dev = connector->base.dev;
> > > > -       enum drm_connector_status old_status;
> > > > +       enum drm_connector_status old_status, new_status;
> > > > +       enum hpd_pin pin = encoder->hpd_pin;
> > > > +       struct drm_i915_private *dev_priv =
> > > > to_i915(encoder->base.dev);
> > > > +       u32 count = 0;
> > > >
> > > >         WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> > > >         old_status = connector->base.status;
> > > >
> > > > -       connector->base.status =
> > > > -               drm_helper_probe_detect(&connector->base, NULL,
> > > > false);
> > > > +       /*
> > > > +        * Set HDMI connection status based on hot-plug live
> > > > states and
> > > > +        * display probe results.
> > > > +        */
> > > > +       if ((encoder->type == INTEL_OUTPUT_HDMI ||
> > > > +            encoder->type == INTEL_OUTPUT_DDI) &&
> > > > +           dev_priv->hotplug.stats[pin].state == HPD_ENABLED) {
> > > > +               do {
> > > > +                       new_status =
> > > > connector_status_disconnected;
> > > > +                       msleep(MAX_SHORT_PULSE_MS);
> > > > +
> > > > +                       if (intel_digital_port_connected(encoder))
> > > > +                               new_status =
> > > > drm_helper_probe_detect(&connector->base,
> > > > +
> > > > NULL, false);
> > > > +                       if (new_status ==
> > > > connector_status_connected)
> > > > +                               break;
> > > > +               } while (++count <= PORT_CHECK_LOOP_COUNT);
> > > > +               connector->base.status = new_status;
> > > > +       } else {
> > > > +               connector->base.status =
> > > > +                       drm_helper_probe_detect(&connector->base,
> > > > NULL, false);
> > > > +       }
> > > >
> > > >         if (old_status == connector->base.status)
> > > >                 return false;
> > > > --
> > > > 2.7.4
> > > >
> > > >
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
>

[-- Attachment #1.2: Type: text/html, Size: 6860 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-10-23  9:14           ` Chris Chiu
@ 2018-10-29 17:12             ` Guang Bai
  2018-11-13  1:04               ` Chris Chiu
  0 siblings, 1 reply; 18+ messages in thread
From: Guang Bai @ 2018-10-29 17:12 UTC (permalink / raw)
  To: Chris Chiu; +Cc: Jani Nikula, intel-gfx

On Tue, 23 Oct 2018 17:14:34 +0800
Chris Chiu <chiu@endlessm.com> wrote:

> On Thu, Oct 11, 2018 at 2:04 AM Guang Bai <guang.bai@intel.com> wrote:
> 
> > On Mon, 8 Oct 2018 08:56:20 -0700
> > Guang Bai <guang.bai@intel.com> wrote:
> >  
> > > On Mon, 8 Oct 2018 22:35:34 +0800
> > > Chris Chiu <chiu@endlessm.com> wrote:
> > >  
> > > > Thanks! I have no problem with this patch.  
> > >
> > > There are Fi.CI.BAT failures with the v2 (only with formatting fix
> > > added) while the previous patch had passing results.
> > > Now trying to identify why the failures happened with trybot
> > > Thanks,
> > > Guang  
> > The tribot run my patch twice and passes the tests without any error
> > however I'm recommended to chase down root causes of Patchwork
> > Fi.CI.BAT test errors still - WIP on that.
> > Thanks,
> > Guang
> >  
> 
> Gentle ping. Any good news on this?
> 
> Chris
> 
Sorry...was distracted by other dev taks...will get update ASAP.
-Guang
> 
> > >  
> > > >
> > > > On Thu, Oct 4, 2018 at 2:08 AM Guang Bai <guang.bai@intel.com>
> > > > wrote:  
> > > > > On some platforms, slowly unplugging (wiggling) the HDMI cable
> > > > > makes the kernel to believe the HDMI display still connected.
> > > > > This is because the HDMI DDC lines are disconnected sometimes
> > > > > later after the hot-plug interrupt triggered. Use the hot plug
> > > > > live states to honor HDMI hot plug status in addtion to access
> > > > > the DDC channels.
> > > > >
> > > > > v2: Fix the formatting issue
> > > > >
> > > > > Cc: Jani Nikula <jani.nikula@intel.com>
> > > > > Cc: Chris Chiu <chiu@endlessm.com>
> > > > > Signed-off-by: Guang Bai <guang.bai@intel.com>
> > > > > ---
> > > > >  drivers/gpu/drm/i915/intel_hotplug.c | 32
> > > > > +++++++++++++++++++++++++++++--- 1 file changed, 29
> > > > > insertions(+), 3 deletions(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > index 648a13c..98ab1ab 100644
> > > > > --- a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > @@ -246,17 +246,43 @@ static void
> > > > > intel_hpd_irq_storm_reenable_work(struct work_struct *work)
> > > > >         intel_runtime_pm_put(dev_priv);
> > > > >  }
> > > > >
> > > > > +#define MAX_SHORT_PULSE_MS     100
> > > > > +#define PORT_CHECK_LOOP_COUNT  3
> > > > > +
> > > > >  bool intel_encoder_hotplug(struct intel_encoder *encoder,
> > > > >                            struct intel_connector *connector)
> > > > >  {
> > > > >         struct drm_device *dev = connector->base.dev;
> > > > > -       enum drm_connector_status old_status;
> > > > > +       enum drm_connector_status old_status, new_status;
> > > > > +       enum hpd_pin pin = encoder->hpd_pin;
> > > > > +       struct drm_i915_private *dev_priv =
> > > > > to_i915(encoder->base.dev);
> > > > > +       u32 count = 0;
> > > > >
> > > > >         WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> > > > >         old_status = connector->base.status;
> > > > >
> > > > > -       connector->base.status =
> > > > > -               drm_helper_probe_detect(&connector->base,
> > > > > NULL, false);
> > > > > +       /*
> > > > > +        * Set HDMI connection status based on hot-plug live
> > > > > states and
> > > > > +        * display probe results.
> > > > > +        */
> > > > > +       if ((encoder->type == INTEL_OUTPUT_HDMI ||
> > > > > +            encoder->type == INTEL_OUTPUT_DDI) &&
> > > > > +           dev_priv->hotplug.stats[pin].state ==
> > > > > HPD_ENABLED) {
> > > > > +               do {
> > > > > +                       new_status =
> > > > > connector_status_disconnected;
> > > > > +                       msleep(MAX_SHORT_PULSE_MS);
> > > > > +
> > > > > +                       if
> > > > > (intel_digital_port_connected(encoder))
> > > > > +                               new_status =
> > > > > drm_helper_probe_detect(&connector->base,
> > > > > +
> > > > > NULL, false);
> > > > > +                       if (new_status ==
> > > > > connector_status_connected)
> > > > > +                               break;
> > > > > +               } while (++count <= PORT_CHECK_LOOP_COUNT);
> > > > > +               connector->base.status = new_status;
> > > > > +       } else {
> > > > > +               connector->base.status =
> > > > > +
> > > > > drm_helper_probe_detect(&connector->base, NULL, false);
> > > > > +       }
> > > > >
> > > > >         if (old_status == connector->base.status)
> > > > >                 return false;
> > > > > --
> > > > > 2.7.4
> > > > >
> > > > >  
> > >
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx  
> >
> >  

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

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-10-29 17:12             ` Guang Bai
@ 2018-11-13  1:04               ` Chris Chiu
  2018-11-13  5:07                 ` Guang Bai
  0 siblings, 1 reply; 18+ messages in thread
From: Chris Chiu @ 2018-11-13  1:04 UTC (permalink / raw)
  To: guang.bai; +Cc: Jani Nikula, intel-gfx, linux


[-- Attachment #1.1: Type: text/plain, Size: 5195 bytes --]

Gentle ping. Just want to know if you have time for this so far. Thanks

Chris

On Tue, Oct 30, 2018 at 1:24 AM Guang Bai <guang.bai@intel.com> wrote:

> On Tue, 23 Oct 2018 17:14:34 +0800
> Chris Chiu <chiu@endlessm.com> wrote:
>
> > On Thu, Oct 11, 2018 at 2:04 AM Guang Bai <guang.bai@intel.com> wrote:
> >
> > > On Mon, 8 Oct 2018 08:56:20 -0700
> > > Guang Bai <guang.bai@intel.com> wrote:
> > >
> > > > On Mon, 8 Oct 2018 22:35:34 +0800
> > > > Chris Chiu <chiu@endlessm.com> wrote:
> > > >
> > > > > Thanks! I have no problem with this patch.
> > > >
> > > > There are Fi.CI.BAT failures with the v2 (only with formatting fix
> > > > added) while the previous patch had passing results.
> > > > Now trying to identify why the failures happened with trybot
> > > > Thanks,
> > > > Guang
> > > The tribot run my patch twice and passes the tests without any error
> > > however I'm recommended to chase down root causes of Patchwork
> > > Fi.CI.BAT test errors still - WIP on that.
> > > Thanks,
> > > Guang
> > >
> >
> > Gentle ping. Any good news on this?
> >
> > Chris
> >
> Sorry...was distracted by other dev taks...will get update ASAP.
> -Guang
> >
> > > >
> > > > >
> > > > > On Thu, Oct 4, 2018 at 2:08 AM Guang Bai <guang.bai@intel.com>
> > > > > wrote:
> > > > > > On some platforms, slowly unplugging (wiggling) the HDMI cable
> > > > > > makes the kernel to believe the HDMI display still connected.
> > > > > > This is because the HDMI DDC lines are disconnected sometimes
> > > > > > later after the hot-plug interrupt triggered. Use the hot plug
> > > > > > live states to honor HDMI hot plug status in addtion to access
> > > > > > the DDC channels.
> > > > > >
> > > > > > v2: Fix the formatting issue
> > > > > >
> > > > > > Cc: Jani Nikula <jani.nikula@intel.com>
> > > > > > Cc: Chris Chiu <chiu@endlessm.com>
> > > > > > Signed-off-by: Guang Bai <guang.bai@intel.com>
> > > > > > ---
> > > > > >  drivers/gpu/drm/i915/intel_hotplug.c | 32
> > > > > > +++++++++++++++++++++++++++++--- 1 file changed, 29
> > > > > > insertions(+), 3 deletions(-)
> > > > > >
> > > > > > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > index 648a13c..98ab1ab 100644
> > > > > > --- a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > @@ -246,17 +246,43 @@ static void
> > > > > > intel_hpd_irq_storm_reenable_work(struct work_struct *work)
> > > > > >         intel_runtime_pm_put(dev_priv);
> > > > > >  }
> > > > > >
> > > > > > +#define MAX_SHORT_PULSE_MS     100
> > > > > > +#define PORT_CHECK_LOOP_COUNT  3
> > > > > > +
> > > > > >  bool intel_encoder_hotplug(struct intel_encoder *encoder,
> > > > > >                            struct intel_connector *connector)
> > > > > >  {
> > > > > >         struct drm_device *dev = connector->base.dev;
> > > > > > -       enum drm_connector_status old_status;
> > > > > > +       enum drm_connector_status old_status, new_status;
> > > > > > +       enum hpd_pin pin = encoder->hpd_pin;
> > > > > > +       struct drm_i915_private *dev_priv =
> > > > > > to_i915(encoder->base.dev);
> > > > > > +       u32 count = 0;
> > > > > >
> > > > > >         WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> > > > > >         old_status = connector->base.status;
> > > > > >
> > > > > > -       connector->base.status =
> > > > > > -               drm_helper_probe_detect(&connector->base,
> > > > > > NULL, false);
> > > > > > +       /*
> > > > > > +        * Set HDMI connection status based on hot-plug live
> > > > > > states and
> > > > > > +        * display probe results.
> > > > > > +        */
> > > > > > +       if ((encoder->type == INTEL_OUTPUT_HDMI ||
> > > > > > +            encoder->type == INTEL_OUTPUT_DDI) &&
> > > > > > +           dev_priv->hotplug.stats[pin].state ==
> > > > > > HPD_ENABLED) {
> > > > > > +               do {
> > > > > > +                       new_status =
> > > > > > connector_status_disconnected;
> > > > > > +                       msleep(MAX_SHORT_PULSE_MS);
> > > > > > +
> > > > > > +                       if
> > > > > > (intel_digital_port_connected(encoder))
> > > > > > +                               new_status =
> > > > > > drm_helper_probe_detect(&connector->base,
> > > > > > +
> > > > > > NULL, false);
> > > > > > +                       if (new_status ==
> > > > > > connector_status_connected)
> > > > > > +                               break;
> > > > > > +               } while (++count <= PORT_CHECK_LOOP_COUNT);
> > > > > > +               connector->base.status = new_status;
> > > > > > +       } else {
> > > > > > +               connector->base.status =
> > > > > > +
> > > > > > drm_helper_probe_detect(&connector->base, NULL, false);
> > > > > > +       }
> > > > > >
> > > > > >         if (old_status == connector->base.status)
> > > > > >                 return false;
> > > > > > --
> > > > > > 2.7.4
> > > > > >
> > > > > >
> > > >
> > > > _______________________________________________
> > > > Intel-gfx mailing list
> > > > Intel-gfx@lists.freedesktop.org
> > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > >
> > >
>
>

[-- Attachment #1.2: Type: text/html, Size: 8401 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-11-13  1:04               ` Chris Chiu
@ 2018-11-13  5:07                 ` Guang Bai
  2018-11-13 11:07                   ` Jani Nikula
  2018-11-20  3:11                   ` Chris Chiu
  0 siblings, 2 replies; 18+ messages in thread
From: Guang Bai @ 2018-11-13  5:07 UTC (permalink / raw)
  To: Chris Chiu; +Cc: Jani Nikula, intel-gfx, linux

On Tue, 13 Nov 2018 09:04:37 +0800
Chris Chiu <chiu@endlessm.com> wrote:

> Gentle ping. Just want to know if you have time for this so far.
> Thanks
> 
> Chris
Actually I'm still working on it right now with
DRM_MODE_CONNECTOR_HDMIA/HDMIB, recommended by James, I'm able to
differentiate the HDMI or DP even the encoder type is the
"INTEL_OUTPUT_DDI", I still have the "trybot" intermittent test failures
with new DRM connector types. Even worse, there is phantom
"intel_encoder_hotplug()" call following the correct one:
When connecting both DP and HDMI on the platform, unplug the DP, the
"i915_hotplug_work_func()" first calls the "intel_encoder_hotplug()"
with DP encoder, then calls again with HDMI encoder.
I haven't identified if the work function get queued twice or itself
is incorrectly identifying wrong encoder hotplut status. Will try to
get everything cleaned up ASAP.
Thanks,
Guang
> 
> On Tue, Oct 30, 2018 at 1:24 AM Guang Bai <guang.bai@intel.com> wrote:
> 
> > On Tue, 23 Oct 2018 17:14:34 +0800
> > Chris Chiu <chiu@endlessm.com> wrote:
> >  
> > > On Thu, Oct 11, 2018 at 2:04 AM Guang Bai <guang.bai@intel.com>
> > > wrote: 
> > > > On Mon, 8 Oct 2018 08:56:20 -0700
> > > > Guang Bai <guang.bai@intel.com> wrote:
> > > >  
> > > > > On Mon, 8 Oct 2018 22:35:34 +0800
> > > > > Chris Chiu <chiu@endlessm.com> wrote:
> > > > >  
> > > > > > Thanks! I have no problem with this patch.  
> > > > >
> > > > > There are Fi.CI.BAT failures with the v2 (only with
> > > > > formatting fix added) while the previous patch had passing
> > > > > results. Now trying to identify why the failures happened
> > > > > with trybot Thanks,
> > > > > Guang  
> > > > The tribot run my patch twice and passes the tests without any
> > > > error however I'm recommended to chase down root causes of
> > > > Patchwork Fi.CI.BAT test errors still - WIP on that.
> > > > Thanks,
> > > > Guang
> > > >  
> > >
> > > Gentle ping. Any good news on this?
> > >
> > > Chris
> > >  
> > Sorry...was distracted by other dev taks...will get update ASAP.
> > -Guang  
> > >  
> > > > >  
> > > > > >
> > > > > > On Thu, Oct 4, 2018 at 2:08 AM Guang Bai
> > > > > > <guang.bai@intel.com> wrote:  
> > > > > > > On some platforms, slowly unplugging (wiggling) the HDMI
> > > > > > > cable makes the kernel to believe the HDMI display still
> > > > > > > connected. This is because the HDMI DDC lines are
> > > > > > > disconnected sometimes later after the hot-plug interrupt
> > > > > > > triggered. Use the hot plug live states to honor HDMI hot
> > > > > > > plug status in addtion to access the DDC channels.
> > > > > > >
> > > > > > > v2: Fix the formatting issue
> > > > > > >
> > > > > > > Cc: Jani Nikula <jani.nikula@intel.com>
> > > > > > > Cc: Chris Chiu <chiu@endlessm.com>
> > > > > > > Signed-off-by: Guang Bai <guang.bai@intel.com>
> > > > > > > ---
> > > > > > >  drivers/gpu/drm/i915/intel_hotplug.c | 32
> > > > > > > +++++++++++++++++++++++++++++--- 1 file changed, 29
> > > > > > > insertions(+), 3 deletions(-)
> > > > > > >
> > > > > > > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > index 648a13c..98ab1ab 100644
> > > > > > > --- a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > @@ -246,17 +246,43 @@ static void
> > > > > > > intel_hpd_irq_storm_reenable_work(struct work_struct
> > > > > > > *work) intel_runtime_pm_put(dev_priv);
> > > > > > >  }
> > > > > > >
> > > > > > > +#define MAX_SHORT_PULSE_MS     100
> > > > > > > +#define PORT_CHECK_LOOP_COUNT  3
> > > > > > > +
> > > > > > >  bool intel_encoder_hotplug(struct intel_encoder *encoder,
> > > > > > >                            struct intel_connector
> > > > > > > *connector) {
> > > > > > >         struct drm_device *dev = connector->base.dev;
> > > > > > > -       enum drm_connector_status old_status;
> > > > > > > +       enum drm_connector_status old_status, new_status;
> > > > > > > +       enum hpd_pin pin = encoder->hpd_pin;
> > > > > > > +       struct drm_i915_private *dev_priv =
> > > > > > > to_i915(encoder->base.dev);
> > > > > > > +       u32 count = 0;
> > > > > > >
> > > > > > >         WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> > > > > > >         old_status = connector->base.status;
> > > > > > >
> > > > > > > -       connector->base.status =
> > > > > > > -               drm_helper_probe_detect(&connector->base,
> > > > > > > NULL, false);
> > > > > > > +       /*
> > > > > > > +        * Set HDMI connection status based on hot-plug
> > > > > > > live states and
> > > > > > > +        * display probe results.
> > > > > > > +        */
> > > > > > > +       if ((encoder->type == INTEL_OUTPUT_HDMI ||
> > > > > > > +            encoder->type == INTEL_OUTPUT_DDI) &&
> > > > > > > +           dev_priv->hotplug.stats[pin].state ==
> > > > > > > HPD_ENABLED) {
> > > > > > > +               do {
> > > > > > > +                       new_status =
> > > > > > > connector_status_disconnected;
> > > > > > > +                       msleep(MAX_SHORT_PULSE_MS);
> > > > > > > +
> > > > > > > +                       if
> > > > > > > (intel_digital_port_connected(encoder))
> > > > > > > +                               new_status =
> > > > > > > drm_helper_probe_detect(&connector->base,
> > > > > > > +
> > > > > > > NULL, false);
> > > > > > > +                       if (new_status ==
> > > > > > > connector_status_connected)
> > > > > > > +                               break;
> > > > > > > +               } while (++count <=
> > > > > > > PORT_CHECK_LOOP_COUNT);
> > > > > > > +               connector->base.status = new_status;
> > > > > > > +       } else {
> > > > > > > +               connector->base.status =
> > > > > > > +
> > > > > > > drm_helper_probe_detect(&connector->base, NULL, false);
> > > > > > > +       }
> > > > > > >
> > > > > > >         if (old_status == connector->base.status)
> > > > > > >                 return false;
> > > > > > > --
> > > > > > > 2.7.4
> > > > > > >
> > > > > > >  
> > > > >
> > > > > _______________________________________________
> > > > > Intel-gfx mailing list
> > > > > Intel-gfx@lists.freedesktop.org
> > > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx  
> > > >
> > > >  
> >
> >  

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

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-11-13  5:07                 ` Guang Bai
@ 2018-11-13 11:07                   ` Jani Nikula
  2018-11-28 22:58                     ` Guang Bai
  2018-11-20  3:11                   ` Chris Chiu
  1 sibling, 1 reply; 18+ messages in thread
From: Jani Nikula @ 2018-11-13 11:07 UTC (permalink / raw)
  To: Guang Bai, Chris Chiu; +Cc: intel-gfx, linux

On Mon, 12 Nov 2018, Guang Bai <guang.bai@intel.com> wrote:
> Actually I'm still working on it right now with
> DRM_MODE_CONNECTOR_HDMIA/HDMIB, recommended by James, I'm able to
> differentiate the HDMI or DP even the encoder type is the
> "INTEL_OUTPUT_DDI", I still have the "trybot" intermittent test failures
> with new DRM connector types. Even worse, there is phantom
> "intel_encoder_hotplug()" call following the correct one:
> When connecting both DP and HDMI on the platform, unplug the DP, the
> "i915_hotplug_work_func()" first calls the "intel_encoder_hotplug()"
> with DP encoder, then calls again with HDMI encoder.
> I haven't identified if the work function get queued twice or itself
> is incorrectly identifying wrong encoder hotplut status. Will try to
> get everything cleaned up ASAP.

Frankly I liked the simplicity of [1] over the patch in this thread. It
fixed the real-world use case Chris Chiu has, but I understand that it
still failed the slow unplug HDMI test case you have. The problem is, we
have zero visibility to the test case you have. Is it automated or
manual? Can we see the specs or source code for the test case?

If we have to consider the live status unreliable, it's possible to
devise a pathological test case that will always fail, regardless of
what we do in the driver. Does the test case reflect real world usage?

Also Cc: Ville for input.

BR,
Jani.



[1] http://patchwork.freedesktop.org/patch/msgid/20180925071836.24711-1-jani.nikula@intel.com


-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-11-13  5:07                 ` Guang Bai
  2018-11-13 11:07                   ` Jani Nikula
@ 2018-11-20  3:11                   ` Chris Chiu
  1 sibling, 0 replies; 18+ messages in thread
From: Chris Chiu @ 2018-11-20  3:11 UTC (permalink / raw)
  To: guang.bai; +Cc: Jani Nikula, intel-gfx, linux


[-- Attachment #1.1: Type: text/plain, Size: 6800 bytes --]

On Tue, Nov 13, 2018 at 1:18 PM Guang Bai <guang.bai@intel.com> wrote:

> On Tue, 13 Nov 2018 09:04:37 +0800
> Chris Chiu <chiu@endlessm.com> wrote:
>
> > Gentle ping. Just want to know if you have time for this so far.
> > Thanks
> >
> > Chris
> Actually I'm still working on it right now with
> DRM_MODE_CONNECTOR_HDMIA/HDMIB, recommended by James, I'm able to
> differentiate the HDMI or DP even the encoder type is the
> "INTEL_OUTPUT_DDI", I still have the "trybot" intermittent test failures
> with new DRM connector types. Even worse, there is phantom
> "intel_encoder_hotplug()" call following the correct one:
> When connecting both DP and HDMI on the platform, unplug the DP, the
> "i915_hotplug_work_func()" first calls the "intel_encoder_hotplug()"
> with DP encoder, then calls again with HDMI encoder.
> I haven't identified if the work function get queued twice or itself
> is incorrectly identifying wrong encoder hotplut status. Will try to
> get everything cleaned up ASAP.
> Thanks,
> Guang
> >
> >


Anything I can help? Maybe test in a more complicated use case? I have lots
of different laptops/AIOs/Desktops if you need.

Chris


> On Tue, Oct 30, 2018 at 1:24 AM Guang Bai <guang.bai@intel.com> wrote:
> >
> > > On Tue, 23 Oct 2018 17:14:34 +0800
> > > Chris Chiu <chiu@endlessm.com> wrote:
> > >
> > > > On Thu, Oct 11, 2018 at 2:04 AM Guang Bai <guang.bai@intel.com>
> > > > wrote:
> > > > > On Mon, 8 Oct 2018 08:56:20 -0700
> > > > > Guang Bai <guang.bai@intel.com> wrote:
> > > > >
> > > > > > On Mon, 8 Oct 2018 22:35:34 +0800
> > > > > > Chris Chiu <chiu@endlessm.com> wrote:
> > > > > >
> > > > > > > Thanks! I have no problem with this patch.
> > > > > >
> > > > > > There are Fi.CI.BAT failures with the v2 (only with
> > > > > > formatting fix added) while the previous patch had passing
> > > > > > results. Now trying to identify why the failures happened
> > > > > > with trybot Thanks,
> > > > > > Guang
> > > > > The tribot run my patch twice and passes the tests without any
> > > > > error however I'm recommended to chase down root causes of
> > > > > Patchwork Fi.CI.BAT test errors still - WIP on that.
> > > > > Thanks,
> > > > > Guang
> > > > >
> > > >
> > > > Gentle ping. Any good news on this?
> > > >
> > > > Chris
> > > >
> > > Sorry...was distracted by other dev taks...will get update ASAP.
> > > -Guang
> > > >
> > > > > >
> > > > > > >
> > > > > > > On Thu, Oct 4, 2018 at 2:08 AM Guang Bai
> > > > > > > <guang.bai@intel.com> wrote:
> > > > > > > > On some platforms, slowly unplugging (wiggling) the HDMI
> > > > > > > > cable makes the kernel to believe the HDMI display still
> > > > > > > > connected. This is because the HDMI DDC lines are
> > > > > > > > disconnected sometimes later after the hot-plug interrupt
> > > > > > > > triggered. Use the hot plug live states to honor HDMI hot
> > > > > > > > plug status in addtion to access the DDC channels.
> > > > > > > >
> > > > > > > > v2: Fix the formatting issue
> > > > > > > >
> > > > > > > > Cc: Jani Nikula <jani.nikula@intel.com>
> > > > > > > > Cc: Chris Chiu <chiu@endlessm.com>
> > > > > > > > Signed-off-by: Guang Bai <guang.bai@intel.com>
> > > > > > > > ---
> > > > > > > >  drivers/gpu/drm/i915/intel_hotplug.c | 32
> > > > > > > > +++++++++++++++++++++++++++++--- 1 file changed, 29
> > > > > > > > insertions(+), 3 deletions(-)
> > > > > > > >
> > > > > > > > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > > b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > > index 648a13c..98ab1ab 100644
> > > > > > > > --- a/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > > +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> > > > > > > > @@ -246,17 +246,43 @@ static void
> > > > > > > > intel_hpd_irq_storm_reenable_work(struct work_struct
> > > > > > > > *work) intel_runtime_pm_put(dev_priv);
> > > > > > > >  }
> > > > > > > >
> > > > > > > > +#define MAX_SHORT_PULSE_MS     100
> > > > > > > > +#define PORT_CHECK_LOOP_COUNT  3
> > > > > > > > +
> > > > > > > >  bool intel_encoder_hotplug(struct intel_encoder *encoder,
> > > > > > > >                            struct intel_connector
> > > > > > > > *connector) {
> > > > > > > >         struct drm_device *dev = connector->base.dev;
> > > > > > > > -       enum drm_connector_status old_status;
> > > > > > > > +       enum drm_connector_status old_status, new_status;
> > > > > > > > +       enum hpd_pin pin = encoder->hpd_pin;
> > > > > > > > +       struct drm_i915_private *dev_priv =
> > > > > > > > to_i915(encoder->base.dev);
> > > > > > > > +       u32 count = 0;
> > > > > > > >
> > > > > > > >         WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> > > > > > > >         old_status = connector->base.status;
> > > > > > > >
> > > > > > > > -       connector->base.status =
> > > > > > > > -               drm_helper_probe_detect(&connector->base,
> > > > > > > > NULL, false);
> > > > > > > > +       /*
> > > > > > > > +        * Set HDMI connection status based on hot-plug
> > > > > > > > live states and
> > > > > > > > +        * display probe results.
> > > > > > > > +        */
> > > > > > > > +       if ((encoder->type == INTEL_OUTPUT_HDMI ||
> > > > > > > > +            encoder->type == INTEL_OUTPUT_DDI) &&
> > > > > > > > +           dev_priv->hotplug.stats[pin].state ==
> > > > > > > > HPD_ENABLED) {
> > > > > > > > +               do {
> > > > > > > > +                       new_status =
> > > > > > > > connector_status_disconnected;
> > > > > > > > +                       msleep(MAX_SHORT_PULSE_MS);
> > > > > > > > +
> > > > > > > > +                       if
> > > > > > > > (intel_digital_port_connected(encoder))
> > > > > > > > +                               new_status =
> > > > > > > > drm_helper_probe_detect(&connector->base,
> > > > > > > > +
> > > > > > > > NULL, false);
> > > > > > > > +                       if (new_status ==
> > > > > > > > connector_status_connected)
> > > > > > > > +                               break;
> > > > > > > > +               } while (++count <=
> > > > > > > > PORT_CHECK_LOOP_COUNT);
> > > > > > > > +               connector->base.status = new_status;
> > > > > > > > +       } else {
> > > > > > > > +               connector->base.status =
> > > > > > > > +
> > > > > > > > drm_helper_probe_detect(&connector->base, NULL, false);
> > > > > > > > +       }
> > > > > > > >
> > > > > > > >         if (old_status == connector->base.status)
> > > > > > > >                 return false;
> > > > > > > > --
> > > > > > > > 2.7.4
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > > _______________________________________________
> > > > > > Intel-gfx mailing list
> > > > > > Intel-gfx@lists.freedesktop.org
> > > > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > > > >
> > > > >
> > >
> > >
>
>

[-- Attachment #1.2: Type: text/html, Size: 11253 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

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

* Re: [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2)
  2018-11-13 11:07                   ` Jani Nikula
@ 2018-11-28 22:58                     ` Guang Bai
  0 siblings, 0 replies; 18+ messages in thread
From: Guang Bai @ 2018-11-28 22:58 UTC (permalink / raw)
  To: Jani Nikula; +Cc: linux, intel-gfx, Chris Chiu

On Tue, 13 Nov 2018 13:07:46 +0200
Jani Nikula <jani.nikula@intel.com> wrote:

> On Mon, 12 Nov 2018, Guang Bai <guang.bai@intel.com> wrote:
> > Actually I'm still working on it right now with
> > DRM_MODE_CONNECTOR_HDMIA/HDMIB, recommended by James, I'm able to
> > differentiate the HDMI or DP even the encoder type is the
> > "INTEL_OUTPUT_DDI", I still have the "trybot" intermittent test
> > failures with new DRM connector types. Even worse, there is phantom
> > "intel_encoder_hotplug()" call following the correct one:
> > When connecting both DP and HDMI on the platform, unplug the DP, the
> > "i915_hotplug_work_func()" first calls the "intel_encoder_hotplug()"
> > with DP encoder, then calls again with HDMI encoder.
> > I haven't identified if the work function get queued twice or itself
> > is incorrectly identifying wrong encoder hotplut status. Will try to
> > get everything cleaned up ASAP.  
> 
> Frankly I liked the simplicity of [1] over the patch in this thread.
> It fixed the real-world use case Chris Chiu has, but I understand
> that it still failed the slow unplug HDMI test case you have. The
> problem is, we have zero visibility to the test case you have. Is it
> automated or manual? Can we see the specs or source code for the test
> case?
> 
> If we have to consider the live status unreliable, it's possible to
> devise a pathological test case that will always fail, regardless of
> what we do in the driver. Does the test case reflect real world usage?
> 
> Also Cc: Ville for input.
> 
> BR,
> Jani.
> 
Hi Jani, Ville & Chris (Chiu):
Sorry for the late reply as I have beening bumping around different
projects and also spent sometime to investigate [v2] failures with
testing the codes on trybot
1. My testcase: I have one+ customer KBL laptop and uBuntu16.04
running, slowly unplug the HDMI cable (wiggling), the issue can be
reproduced very easily - Just check kernel HDMI-A-1 connecting states
2. I belive Chris is using roughly the same test case?
3. I don't like the [v2] solution either since it's *not* clean and
have intermittent trybot/patchwork failures
4. with latest drm-tip codes, I'm able to workout a very clean solution
[v3] today and it passes the patchwork tests - Would you like to try it
out and also review the change?
Thanks,
Guang
> 
> 
> [1]
> http://patchwork.freedesktop.org/patch/msgid/20180925071836.24711-1-jani.nikula@intel.com
> 
> 

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

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

end of thread, other threads:[~2018-11-28 23:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03  5:12 [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure Guang Bai
2018-10-03  5:33 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-10-03  5:57 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-03  9:22 ` [PATCH] " Chris Chiu
2018-10-03 17:57   ` [PATCH] drm/i915: Fix the HDMI hot plug disconnection failure (v2) Guang Bai
2018-10-08 14:35     ` Chris Chiu
2018-10-08 15:56       ` Guang Bai
2018-10-10 17:52         ` Guang Bai
2018-10-23  9:14           ` Chris Chiu
2018-10-29 17:12             ` Guang Bai
2018-11-13  1:04               ` Chris Chiu
2018-11-13  5:07                 ` Guang Bai
2018-11-13 11:07                   ` Jani Nikula
2018-11-28 22:58                     ` Guang Bai
2018-11-20  3:11                   ` Chris Chiu
2018-10-03  9:34 ` ✗ Fi.CI.IGT: failure for drm/i915: Fix the HDMI hot plug disconnection failure Patchwork
2018-10-03  9:52   ` Martin Peres
2018-10-03 18:41 ` ✗ Fi.CI.BAT: failure for drm/i915: Fix the HDMI hot plug disconnection failure (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.