All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] i915 HDMI connector status is connected after disconnection
@ 2018-07-05  7:58 Chris Chiu
  2018-07-05  8:58   ` Jani Nikula
                   ` (5 more replies)
  0 siblings, 6 replies; 31+ messages in thread
From: Chris Chiu @ 2018-07-05  7:58 UTC (permalink / raw)
  To: Jani Nikula, joonas.lahtinen, rodrigo.vivi, David Airlie
  Cc: intel-gfx, dri-devel, Linux Kernel, Linux Upstreaming Team

Hi,
    We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
the HDMI connector status stays connected even the HDMI cable has been
unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
checking the status while plug/unplug the HDMI, it shows
"disconnected" before plug in HDMI cable, then switch to "connected"
after plugin, and still stay "connected" after unplug. This would
cause the audio output path cannot correctly switch from HDMI to
internal speaker after unplugging the HDMI.

I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
present. The full "dmesg" log is here.
https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1

The HDMI cable is plugged in at ~26th second.
"[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
audio support"
then unplug the HDMI at ~73th second.
"[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
audio support"

Please advise what I can do to fix this. Thanks

Chris

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-05  7:58 [BUG] i915 HDMI connector status is connected after disconnection Chris Chiu
@ 2018-07-05  8:58   ` Jani Nikula
  2018-07-05 14:40   ` Ville Syrjälä
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 31+ messages in thread
From: Jani Nikula @ 2018-07-05  8:58 UTC (permalink / raw)
  To: Chris Chiu, joonas.lahtinen, rodrigo.vivi, David Airlie
  Cc: intel-gfx, dri-devel, Linux Kernel, Linux Upstreaming Team

On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
> Hi,
>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
> the HDMI connector status stays connected even the HDMI cable has been
> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
> checking the status while plug/unplug the HDMI, it shows
> "disconnected" before plug in HDMI cable, then switch to "connected"
> after plugin, and still stay "connected" after unplug. This would
> cause the audio output path cannot correctly switch from HDMI to
> internal speaker after unplugging the HDMI.
>
> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
> present. The full "dmesg" log is here.
> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>
> The HDMI cable is plugged in at ~26th second.
> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> audio support"
> then unplug the HDMI at ~73th second.
> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> audio support"
>
> Please advise what I can do to fix this. Thanks

Seems rather odd. Please file a bug report at [1]. Attach the dmesg on
the bug. Please attach 'xrandr --verbose' output before and after
unplugging on the bug.

Please also try drm-tip branch of [2].

BR,
Jani.


[1] https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=DRM/Intel
[2] https://cgit.freedesktop.org/drm/drm-tip


-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
@ 2018-07-05  8:58   ` Jani Nikula
  0 siblings, 0 replies; 31+ messages in thread
From: Jani Nikula @ 2018-07-05  8:58 UTC (permalink / raw)
  To: Chris Chiu, joonas.lahtinen, rodrigo.vivi, David Airlie
  Cc: intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
> Hi,
>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
> the HDMI connector status stays connected even the HDMI cable has been
> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
> checking the status while plug/unplug the HDMI, it shows
> "disconnected" before plug in HDMI cable, then switch to "connected"
> after plugin, and still stay "connected" after unplug. This would
> cause the audio output path cannot correctly switch from HDMI to
> internal speaker after unplugging the HDMI.
>
> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
> present. The full "dmesg" log is here.
> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>
> The HDMI cable is plugged in at ~26th second.
> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> audio support"
> then unplug the HDMI at ~73th second.
> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> audio support"
>
> Please advise what I can do to fix this. Thanks

Seems rather odd. Please file a bug report at [1]. Attach the dmesg on
the bug. Please attach 'xrandr --verbose' output before and after
unplugging on the bug.

Please also try drm-tip branch of [2].

BR,
Jani.


[1] https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=DRM/Intel
[2] https://cgit.freedesktop.org/drm/drm-tip


-- 
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] 31+ messages in thread

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-05  8:58   ` Jani Nikula
@ 2018-07-05  9:04     ` Chris Wilson
  -1 siblings, 0 replies; 31+ messages in thread
From: Chris Wilson @ 2018-07-05  9:04 UTC (permalink / raw)
  To: Chris Chiu, David Airlie, Jani Nikula, joonas.lahtinen, rodrigo.vivi
  Cc: intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

Quoting Jani Nikula (2018-07-05 09:58:57)
> On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
> > Hi,
> >     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
> > i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
> > the HDMI connector status stays connected even the HDMI cable has been
> > unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
> > checking the status while plug/unplug the HDMI, it shows
> > "disconnected" before plug in HDMI cable, then switch to "connected"
> > after plugin, and still stay "connected" after unplug. This would
> > cause the audio output path cannot correctly switch from HDMI to
> > internal speaker after unplugging the HDMI.
> >
> > I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
> > present. The full "dmesg" log is here.
> > https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
> >
> > The HDMI cable is plugged in at ~26th second.
> > "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> > audio support"
> > then unplug the HDMI at ~73th second.
> > "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> > audio support"
> >
> > Please advise what I can do to fix this. Thanks
> 
> Seems rather odd. Please file a bug report at [1]. Attach the dmesg on
> the bug. Please attach 'xrandr --verbose' output before and after
> unplugging on the bug.

Note that 'xrandr --verbose' will trigger a reprobe of the devices,
papering over any missed probe following hotplug.  I would suggest
preceding with 'xrandr --current --verbose'.

If all you are doing is checking status, you need to 'echo detect >
status' to trigger a reprobe after hotplug.
-Chris

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
@ 2018-07-05  9:04     ` Chris Wilson
  0 siblings, 0 replies; 31+ messages in thread
From: Chris Wilson @ 2018-07-05  9:04 UTC (permalink / raw)
  To: Chris Chiu, David Airlie, Jani Nikula, joonas.lahtinen, rodrigo.vivi
  Cc: intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

Quoting Jani Nikula (2018-07-05 09:58:57)
> On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
> > Hi,
> >     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
> > i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
> > the HDMI connector status stays connected even the HDMI cable has been
> > unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
> > checking the status while plug/unplug the HDMI, it shows
> > "disconnected" before plug in HDMI cable, then switch to "connected"
> > after plugin, and still stay "connected" after unplug. This would
> > cause the audio output path cannot correctly switch from HDMI to
> > internal speaker after unplugging the HDMI.
> >
> > I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
> > present. The full "dmesg" log is here.
> > https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
> >
> > The HDMI cable is plugged in at ~26th second.
> > "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> > audio support"
> > then unplug the HDMI at ~73th second.
> > "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> > audio support"
> >
> > Please advise what I can do to fix this. Thanks
> 
> Seems rather odd. Please file a bug report at [1]. Attach the dmesg on
> the bug. Please attach 'xrandr --verbose' output before and after
> unplugging on the bug.

Note that 'xrandr --verbose' will trigger a reprobe of the devices,
papering over any missed probe following hotplug.  I would suggest
preceding with 'xrandr --current --verbose'.

If all you are doing is checking status, you need to 'echo detect >
status' to trigger a reprobe after hotplug.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-05  9:04     ` Chris Wilson
@ 2018-07-05  9:37       ` Jani Nikula
  -1 siblings, 0 replies; 31+ messages in thread
From: Jani Nikula @ 2018-07-05  9:37 UTC (permalink / raw)
  To: Chris Wilson, Chris Chiu, David Airlie, joonas.lahtinen, rodrigo.vivi
  Cc: intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

On Thu, 05 Jul 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Jani Nikula (2018-07-05 09:58:57)
>> On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
>> > Hi,
>> >     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>> > i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>> > the HDMI connector status stays connected even the HDMI cable has been
>> > unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>> > checking the status while plug/unplug the HDMI, it shows
>> > "disconnected" before plug in HDMI cable, then switch to "connected"
>> > after plugin, and still stay "connected" after unplug. This would
>> > cause the audio output path cannot correctly switch from HDMI to
>> > internal speaker after unplugging the HDMI.
>> >
>> > I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>> > present. The full "dmesg" log is here.
>> > https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>> >
>> > The HDMI cable is plugged in at ~26th second.
>> > "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>> > audio support"
>> > then unplug the HDMI at ~73th second.
>> > "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>> > audio support"
>> >
>> > Please advise what I can do to fix this. Thanks
>> 
>> Seems rather odd. Please file a bug report at [1]. Attach the dmesg on
>> the bug. Please attach 'xrandr --verbose' output before and after
>> unplugging on the bug.
>
> Note that 'xrandr --verbose' will trigger a reprobe of the devices,
> papering over any missed probe following hotplug.  I would suggest
> preceding with 'xrandr --current --verbose'.
>
> If all you are doing is checking status, you need to 'echo detect >
> status' to trigger a reprobe after hotplug.

I was curious about the logs seemingly indicating that we can read the
EDID even after the user says they've unplugged the cable. The updating
of sysfs status attribute is another matter.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
@ 2018-07-05  9:37       ` Jani Nikula
  0 siblings, 0 replies; 31+ messages in thread
From: Jani Nikula @ 2018-07-05  9:37 UTC (permalink / raw)
  To: Chris Wilson, Chris Chiu, David Airlie, joonas.lahtinen, rodrigo.vivi
  Cc: intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

On Thu, 05 Jul 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Jani Nikula (2018-07-05 09:58:57)
>> On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
>> > Hi,
>> >     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>> > i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>> > the HDMI connector status stays connected even the HDMI cable has been
>> > unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>> > checking the status while plug/unplug the HDMI, it shows
>> > "disconnected" before plug in HDMI cable, then switch to "connected"
>> > after plugin, and still stay "connected" after unplug. This would
>> > cause the audio output path cannot correctly switch from HDMI to
>> > internal speaker after unplugging the HDMI.
>> >
>> > I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>> > present. The full "dmesg" log is here.
>> > https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>> >
>> > The HDMI cable is plugged in at ~26th second.
>> > "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>> > audio support"
>> > then unplug the HDMI at ~73th second.
>> > "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>> > audio support"
>> >
>> > Please advise what I can do to fix this. Thanks
>> 
>> Seems rather odd. Please file a bug report at [1]. Attach the dmesg on
>> the bug. Please attach 'xrandr --verbose' output before and after
>> unplugging on the bug.
>
> Note that 'xrandr --verbose' will trigger a reprobe of the devices,
> papering over any missed probe following hotplug.  I would suggest
> preceding with 'xrandr --current --verbose'.
>
> If all you are doing is checking status, you need to 'echo detect >
> status' to trigger a reprobe after hotplug.

I was curious about the logs seemingly indicating that we can read the
EDID even after the user says they've unplugged the cable. The updating
of sysfs status attribute is another matter.

BR,
Jani.


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

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-05  9:37       ` Jani Nikula
  (?)
@ 2018-07-05 13:02       ` Chris Chiu
  2018-07-05 13:18         ` Jani Nikula
  -1 siblings, 1 reply; 31+ messages in thread
From: Chris Chiu @ 2018-07-05 13:02 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Chris Wilson, David Airlie, joonas.lahtinen, rodrigo.vivi,
	intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

On Thu, Jul 5, 2018 at 5:37 PM, Jani Nikula <jani.nikula@intel.com> wrote:
> On Thu, 05 Jul 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> Quoting Jani Nikula (2018-07-05 09:58:57)
>>> On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
>>> > Hi,
>>> >     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>>> > i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>>> > the HDMI connector status stays connected even the HDMI cable has been
>>> > unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>>> > checking the status while plug/unplug the HDMI, it shows
>>> > "disconnected" before plug in HDMI cable, then switch to "connected"
>>> > after plugin, and still stay "connected" after unplug. This would
>>> > cause the audio output path cannot correctly switch from HDMI to
>>> > internal speaker after unplugging the HDMI.
>>> >
>>> > I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>>> > present. The full "dmesg" log is here.
>>> > https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>> >
>>> > The HDMI cable is plugged in at ~26th second.
>>> > "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>> > audio support"
>>> > then unplug the HDMI at ~73th second.
>>> > "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>> > audio support"
>>> >
>>> > Please advise what I can do to fix this. Thanks
>>>
>>> Seems rather odd. Please file a bug report at [1]. Attach the dmesg on
>>> the bug. Please attach 'xrandr --verbose' output before and after
>>> unplugging on the bug.
>>
>> Note that 'xrandr --verbose' will trigger a reprobe of the devices,
>> papering over any missed probe following hotplug.  I would suggest
>> preceding with 'xrandr --current --verbose'.
>>
>> If all you are doing is checking status, you need to 'echo detect >
>> status' to trigger a reprobe after hotplug.

It's interesting that reprobe triggered by 'xrandr --verbose' after unplug will
get the status back to "disconnected". But if I just do 'xrandr
--current --verbose'
before and after unplugging the cable, the output shows the same status
'connected'.

Here's the output of 'xrandr --verbose' before unplugging HDMI
https://gist.github.com/mschiu77/ea2e843078297f344596243418dcdaf7

And the output of 'xrandr --current --verbose' after unplugging the cable
https://gist.github.com/mschiu77/55756c0801046d49cd9bc3f87712b079

Then do 'xrandr --current --verbose' to trigger reprobe, the ouput
https://gist.github.com/mschiu77/72e6ab5438cbe64443300fc4fd71770c

It means that the HDMI unplug not detected by the driver?

Chris

>
> I was curious about the logs seemingly indicating that we can read the
> EDID even after the user says they've unplugged the cable. The updating
> of sysfs status attribute is another matter.
>
> BR,
> Jani.
>
>
> --
> Jani Nikula, Intel Open Source Graphics Center

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-05 13:02       ` Chris Chiu
@ 2018-07-05 13:18         ` Jani Nikula
  2018-07-05 13:30           ` Chris Chiu
  0 siblings, 1 reply; 31+ messages in thread
From: Jani Nikula @ 2018-07-05 13:18 UTC (permalink / raw)
  To: Chris Chiu
  Cc: Chris Wilson, David Airlie, joonas.lahtinen, rodrigo.vivi,
	intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
> On Thu, Jul 5, 2018 at 5:37 PM, Jani Nikula <jani.nikula@intel.com> wrote:
>> On Thu, 05 Jul 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>>> Quoting Jani Nikula (2018-07-05 09:58:57)
>>>> On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
>>>> > Hi,
>>>> >     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>>>> > i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>>>> > the HDMI connector status stays connected even the HDMI cable has been
>>>> > unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>>>> > checking the status while plug/unplug the HDMI, it shows
>>>> > "disconnected" before plug in HDMI cable, then switch to "connected"
>>>> > after plugin, and still stay "connected" after unplug. This would
>>>> > cause the audio output path cannot correctly switch from HDMI to
>>>> > internal speaker after unplugging the HDMI.
>>>> >
>>>> > I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>>>> > present. The full "dmesg" log is here.
>>>> > https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>>> >
>>>> > The HDMI cable is plugged in at ~26th second.
>>>> > "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>> > audio support"
>>>> > then unplug the HDMI at ~73th second.
>>>> > "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>> > audio support"
>>>> >
>>>> > Please advise what I can do to fix this. Thanks
>>>>
>>>> Seems rather odd. Please file a bug report at [1]. Attach the dmesg on
>>>> the bug. Please attach 'xrandr --verbose' output before and after
>>>> unplugging on the bug.
>>>
>>> Note that 'xrandr --verbose' will trigger a reprobe of the devices,
>>> papering over any missed probe following hotplug.  I would suggest
>>> preceding with 'xrandr --current --verbose'.
>>>
>>> If all you are doing is checking status, you need to 'echo detect >
>>> status' to trigger a reprobe after hotplug.
>
> It's interesting that reprobe triggered by 'xrandr --verbose' after unplug will
> get the status back to "disconnected". But if I just do 'xrandr
> --current --verbose'
> before and after unplugging the cable, the output shows the same status
> 'connected'.
>
> Here's the output of 'xrandr --verbose' before unplugging HDMI
> https://gist.github.com/mschiu77/ea2e843078297f344596243418dcdaf7
>
> And the output of 'xrandr --current --verbose' after unplugging the cable
> https://gist.github.com/mschiu77/55756c0801046d49cd9bc3f87712b079
>
> Then do 'xrandr --current --verbose' to trigger reprobe, the ouput
> https://gist.github.com/mschiu77/72e6ab5438cbe64443300fc4fd71770c
>
> It means that the HDMI unplug not detected by the driver?

Please do file the bug, and attach the information there. People go on
vacations, the pastebins will go away, and the memory of all of this
will fade.

BR,
Jani.

>
> Chris
>
>>
>> I was curious about the logs seemingly indicating that we can read the
>> EDID even after the user says they've unplugged the cable. The updating
>> of sysfs status attribute is another matter.
>>
>> BR,
>> Jani.
>>
>>
>> --
>> Jani Nikula, Intel Open Source Graphics Center

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-05 13:18         ` Jani Nikula
@ 2018-07-05 13:30           ` Chris Chiu
  0 siblings, 0 replies; 31+ messages in thread
From: Chris Chiu @ 2018-07-05 13:30 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Chris Wilson, David Airlie, joonas.lahtinen, rodrigo.vivi,
	intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

On Thu, Jul 5, 2018 at 9:18 PM, Jani Nikula <jani.nikula@intel.com> wrote:
> On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
>> On Thu, Jul 5, 2018 at 5:37 PM, Jani Nikula <jani.nikula@intel.com> wrote:
>>> On Thu, 05 Jul 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>>>> Quoting Jani Nikula (2018-07-05 09:58:57)
>>>>> On Thu, 05 Jul 2018, Chris Chiu <chiu@endlessm.com> wrote:
>>>>> > Hi,
>>>>> >     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>>>>> > i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>>>>> > the HDMI connector status stays connected even the HDMI cable has been
>>>>> > unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>>>>> > checking the status while plug/unplug the HDMI, it shows
>>>>> > "disconnected" before plug in HDMI cable, then switch to "connected"
>>>>> > after plugin, and still stay "connected" after unplug. This would
>>>>> > cause the audio output path cannot correctly switch from HDMI to
>>>>> > internal speaker after unplugging the HDMI.
>>>>> >
>>>>> > I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>>>>> > present. The full "dmesg" log is here.
>>>>> > https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>>>> >
>>>>> > The HDMI cable is plugged in at ~26th second.
>>>>> > "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>>> > audio support"
>>>>> > then unplug the HDMI at ~73th second.
>>>>> > "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>>> > audio support"
>>>>> >
>>>>> > Please advise what I can do to fix this. Thanks
>>>>>
>>>>> Seems rather odd. Please file a bug report at [1]. Attach the dmesg on
>>>>> the bug. Please attach 'xrandr --verbose' output before and after
>>>>> unplugging on the bug.
>>>>
>>>> Note that 'xrandr --verbose' will trigger a reprobe of the devices,
>>>> papering over any missed probe following hotplug.  I would suggest
>>>> preceding with 'xrandr --current --verbose'.
>>>>
>>>> If all you are doing is checking status, you need to 'echo detect >
>>>> status' to trigger a reprobe after hotplug.
>>
>> It's interesting that reprobe triggered by 'xrandr --verbose' after unplug will
>> get the status back to "disconnected". But if I just do 'xrandr
>> --current --verbose'
>> before and after unplugging the cable, the output shows the same status
>> 'connected'.
>>
>> Here's the output of 'xrandr --verbose' before unplugging HDMI
>> https://gist.github.com/mschiu77/ea2e843078297f344596243418dcdaf7
>>
>> And the output of 'xrandr --current --verbose' after unplugging the cable
>> https://gist.github.com/mschiu77/55756c0801046d49cd9bc3f87712b079
>>
>> Then do 'xrandr --current --verbose' to trigger reprobe, the ouput
>> https://gist.github.com/mschiu77/72e6ab5438cbe64443300fc4fd71770c
>>
>> It means that the HDMI unplug not detected by the driver?
>
> Please do file the bug, and attach the information there. People go on
> vacations, the pastebins will go away, and the memory of all of this
> will fade.
>

Sorry that I missed to list here. I've reported the bug as follows
https://bugs.freedesktop.org/show_bug.cgi?id=107125

Thanks

> BR,
> Jani.
>
>>
>> Chris
>>
>>>
>>> I was curious about the logs seemingly indicating that we can read the
>>> EDID even after the user says they've unplugged the cable. The updating
>>> of sysfs status attribute is another matter.
>>>
>>> BR,
>>> Jani.
>>>
>>>
>>> --
>>> Jani Nikula, Intel Open Source Graphics Center
>
> --
> Jani Nikula, Intel Open Source Graphics Center

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-05  7:58 [BUG] i915 HDMI connector status is connected after disconnection Chris Chiu
@ 2018-07-05 14:40   ` Ville Syrjälä
  2018-07-05 14:40   ` Ville Syrjälä
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 31+ messages in thread
From: Ville Syrjälä @ 2018-07-05 14:40 UTC (permalink / raw)
  To: Chris Chiu
  Cc: Jani Nikula, joonas.lahtinen, rodrigo.vivi, David Airlie,
	intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:
> Hi,
>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
> the HDMI connector status stays connected even the HDMI cable has been
> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
> checking the status while plug/unplug the HDMI, it shows
> "disconnected" before plug in HDMI cable, then switch to "connected"
> after plugin, and still stay "connected" after unplug. This would
> cause the audio output path cannot correctly switch from HDMI to
> internal speaker after unplugging the HDMI.
> 
> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
> present. The full "dmesg" log is here.
> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
> 
> The HDMI cable is plugged in at ~26th second.
> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> audio support"
> then unplug the HDMI at ~73th second.
> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> audio support"
> 
> Please advise what I can do to fix this. Thanks

Pull the cable out faster?

I presume this is the same old case of hpd disconnecting slightly
before ddc and we still manage to read the EDID when processing
the hpd irq. We kinda tried to fix that with the live status
check but that thing failed spectacularly.

-- 
Ville Syrjälä
Intel

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
@ 2018-07-05 14:40   ` Ville Syrjälä
  0 siblings, 0 replies; 31+ messages in thread
From: Ville Syrjälä @ 2018-07-05 14:40 UTC (permalink / raw)
  To: Chris Chiu
  Cc: Jani Nikula, intel-gfx, Linux Kernel, dri-devel, David Airlie,
	rodrigo.vivi, Linux Upstreaming Team

On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:
> Hi,
>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
> the HDMI connector status stays connected even the HDMI cable has been
> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
> checking the status while plug/unplug the HDMI, it shows
> "disconnected" before plug in HDMI cable, then switch to "connected"
> after plugin, and still stay "connected" after unplug. This would
> cause the audio output path cannot correctly switch from HDMI to
> internal speaker after unplugging the HDMI.
> 
> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
> present. The full "dmesg" log is here.
> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
> 
> The HDMI cable is plugged in at ~26th second.
> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> audio support"
> then unplug the HDMI at ~73th second.
> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
> audio support"
> 
> Please advise what I can do to fix this. Thanks

Pull the cable out faster?

I presume this is the same old case of hpd disconnecting slightly
before ddc and we still manage to read the EDID when processing
the hpd irq. We kinda tried to fix that with the live status
check but that thing failed spectacularly.

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-05 14:40   ` Ville Syrjälä
  (?)
@ 2018-07-06  6:44   ` Chris Chiu
  2018-07-06 17:41     ` Guang Bai
  2018-08-22  6:30       ` Chris Chiu
  -1 siblings, 2 replies; 31+ messages in thread
From: Chris Chiu @ 2018-07-06  6:44 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: Jani Nikula, joonas.lahtinen, rodrigo.vivi, David Airlie,
	intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
<ville.syrjala@linux.intel.com> wrote:
> On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:
>> Hi,
>>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>> the HDMI connector status stays connected even the HDMI cable has been
>> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>> checking the status while plug/unplug the HDMI, it shows
>> "disconnected" before plug in HDMI cable, then switch to "connected"
>> after plugin, and still stay "connected" after unplug. This would
>> cause the audio output path cannot correctly switch from HDMI to
>> internal speaker after unplugging the HDMI.
>>
>> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>> present. The full "dmesg" log is here.
>> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>
>> The HDMI cable is plugged in at ~26th second.
>> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>> audio support"
>> then unplug the HDMI at ~73th second.
>> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>> audio support"
>>
>> Please advise what I can do to fix this. Thanks
>
> Pull the cable out faster?
>
> I presume this is the same old case of hpd disconnecting slightly
> before ddc and we still manage to read the EDID when processing
> the hpd irq. We kinda tried to fix that with the live status
> check but that thing failed spectacularly.
>
> --
> Ville Syrjälä
> Intel

Thanks for the suggestion. I tried pulling the cable out faster, the status
shows correctly. I also tried branch drm-tip of
https://cgit.freedesktop.org/drm/drm-tip
but the symptom persists.

Anything I can help here? Or any old commit/patch I can try to do some
experiments?

Chris

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-06  6:44   ` Chris Chiu
@ 2018-07-06 17:41     ` Guang Bai
  2018-07-06 20:38       ` Rodrigo Vivi
  2018-08-22  6:30       ` Chris Chiu
  1 sibling, 1 reply; 31+ messages in thread
From: Guang Bai @ 2018-07-06 17:41 UTC (permalink / raw)
  To: intel-gfx

On Fri, 6 Jul 2018 14:44:58 +0800
Chris Chiu <chiu@endlessm.com> wrote:

> On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
> > On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:  
> >> Hi,
> >>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD
> >> (intel i5-8250U), X530UN (intel i7-8550U) share the same problem,
> >> which is the HDMI connector status stays connected even the HDMI
> >> cable has been unplugged. Look into the
> >> "/sys/class/drm/card0-HDMI-A-1/status" for checking the status
> >> while plug/unplug the HDMI, it shows "disconnected" before plug in
> >> HDMI cable, then switch to "connected" after plugin, and still
> >> stay "connected" after unplug. This would cause the audio output
> >> path cannot correctly switch from HDMI to internal speaker after
> >> unplugging the HDMI.
> >>
> >> I then try to verify with the latest kernel 4.18.0-rc3+, the bug
> >> still present. The full "dmesg" log is here.
> >> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
> >>
> >> The HDMI cable is plugged in at ~26th second.
> >> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has
> >> basic audio support"
> >> then unplug the HDMI at ~73th second.
> >> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has
> >> basic audio support"
> >>
> >> Please advise what I can do to fix this. Thanks  
> >
> > Pull the cable out faster?
> >
> > I presume this is the same old case of hpd disconnecting slightly
> > before ddc and we still manage to read the EDID when processing
> > the hpd irq. We kinda tried to fix that with the live status
> > check but that thing failed spectacularly.
> >
> > --
> > Ville Syrjälä
> > Intel  
> 
> Thanks for the suggestion. I tried pulling the cable out faster, the
> status shows correctly. I also tried branch drm-tip of
> https://cgit.freedesktop.org/drm/drm-tip
> but the symptom persists.
> 
> Anything I can help here? Or any old commit/patch I can try to do some
> experiments?
> 
> Chris
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

I'm working on a same issue with HP KBL ThinPro laptop where both

kernel 4.9.79 & 4.15.7 are failing the same way:
- Unplug the HDMI cable slowly the connector status is still
  "connected"

Debugging shows from kernel 4.9 and up to 4.18 drim/i915 behaves the
same way:
- When the HDMI calbe is unplugged, there is a transition time when
  the DDC lines are still connected and i915 can read back the EDID
  and honors "connected" state

This problem does not happen on Windows7 & Windows 10 on the same
failing platform - Windows KMD does *not* read the DDC when seeing the
corresponding PCH/HPD pins indicating "disconnected" within 300ms-400ms
period - This checking is done during bottom-half interrupt routines

I worked patches with both 4.15.7 and 4.17.1 intercepting this Windows
KMD logics; It seems these patches work for HP KBL ThinPro laptop - My
patches are being tested by HP team - I was just about to post the open
discussion on this topic to collect inputs from our community
- Do we have to refactor the HDMI hot-plug handling codes to cope with
  this long standing issue?
- Is that OK to add 300ms-500ms delay "msleep(100)" in a loop in the
  bottom half of interrupt routines?

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

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-06 17:41     ` Guang Bai
@ 2018-07-06 20:38       ` Rodrigo Vivi
  2018-07-07  0:03         ` Guang Bai
  0 siblings, 1 reply; 31+ messages in thread
From: Rodrigo Vivi @ 2018-07-06 20:38 UTC (permalink / raw)
  To: Guang Bai; +Cc: intel-gfx

On Fri, Jul 06, 2018 at 10:41:18AM -0700, Guang Bai wrote:
> On Fri, 6 Jul 2018 14:44:58 +0800
> Chris Chiu <chiu@endlessm.com> wrote:
> 
> > On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
> > <ville.syrjala@linux.intel.com> wrote:
> > > On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:  
> > >> Hi,
> > >>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD
> > >> (intel i5-8250U), X530UN (intel i7-8550U) share the same problem,
> > >> which is the HDMI connector status stays connected even the HDMI
> > >> cable has been unplugged. Look into the
> > >> "/sys/class/drm/card0-HDMI-A-1/status" for checking the status
> > >> while plug/unplug the HDMI, it shows "disconnected" before plug in
> > >> HDMI cable, then switch to "connected" after plugin, and still
> > >> stay "connected" after unplug. This would cause the audio output
> > >> path cannot correctly switch from HDMI to internal speaker after
> > >> unplugging the HDMI.
> > >>
> > >> I then try to verify with the latest kernel 4.18.0-rc3+, the bug
> > >> still present. The full "dmesg" log is here.
> > >> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
> > >>
> > >> The HDMI cable is plugged in at ~26th second.
> > >> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has
> > >> basic audio support"
> > >> then unplug the HDMI at ~73th second.
> > >> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has
> > >> basic audio support"
> > >>
> > >> Please advise what I can do to fix this. Thanks  
> > >
> > > Pull the cable out faster?
> > >
> > > I presume this is the same old case of hpd disconnecting slightly
> > > before ddc and we still manage to read the EDID when processing
> > > the hpd irq. We kinda tried to fix that with the live status
> > > check but that thing failed spectacularly.
> > >
> > > --
> > > Ville Syrjälä
> > > Intel  
> > 
> > Thanks for the suggestion. I tried pulling the cable out faster, the
> > status shows correctly. I also tried branch drm-tip of
> > https://cgit.freedesktop.org/drm/drm-tip
> > but the symptom persists.
> > 
> > Anything I can help here? Or any old commit/patch I can try to do some
> > experiments?
> > 
> > Chris
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> I'm working on a same issue with HP KBL ThinPro laptop where both
> 
> kernel 4.9.79 & 4.15.7 are failing the same way:
> - Unplug the HDMI cable slowly the connector status is still
>   "connected"
> 
> Debugging shows from kernel 4.9 and up to 4.18 drim/i915 behaves the
> same way:
> - When the HDMI calbe is unplugged, there is a transition time when
>   the DDC lines are still connected and i915 can read back the EDID
>   and honors "connected" state
> 
> This problem does not happen on Windows7 & Windows 10 on the same
> failing platform - Windows KMD does *not* read the DDC when seeing the
> corresponding PCH/HPD pins indicating "disconnected" within 300ms-400ms
> period - This checking is done during bottom-half interrupt routines
> 
> I worked patches with both 4.15.7 and 4.17.1 intercepting this Windows
> KMD logics; It seems these patches work for HP KBL ThinPro laptop - My
> patches are being tested by HP team - I was just about to post the open
> discussion on this topic to collect inputs from our community

please send them out anyways ;)

> - Do we have to refactor the HDMI hot-plug handling codes to cope with
>   this long standing issue?

What is your proposal for re-work?

> - Is that OK to add 300ms-500ms delay "msleep(100)" in a loop in the
>   bottom half of interrupt routines?

Well, We fight to add the delays only when they are required by specs,
rather than experimental on single display/configuration...
but/however/nevertheless we have cases that we retry aux communications
32 times because a specific monitor...

please show your patch and we discuss on top of it...

> 
> Regards,
> -Guang
> _______________________________________________
> 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] 31+ messages in thread

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-06 20:38       ` Rodrigo Vivi
@ 2018-07-07  0:03         ` Guang Bai
  0 siblings, 0 replies; 31+ messages in thread
From: Guang Bai @ 2018-07-07  0:03 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: intel-gfx

On Fri, 6 Jul 2018 13:38:06 -0700
Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:

> On Fri, Jul 06, 2018 at 10:41:18AM -0700, Guang Bai wrote:
> > On Fri, 6 Jul 2018 14:44:58 +0800
> > Chris Chiu <chiu@endlessm.com> wrote:
> >   
> > > On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
> > > <ville.syrjala@linux.intel.com> wrote:  
> > > > On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:    
> > > >> Hi,
> > > >>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD
> > > >> (intel i5-8250U), X530UN (intel i7-8550U) share the same
> > > >> problem, which is the HDMI connector status stays connected
> > > >> even the HDMI cable has been unplugged. Look into the
> > > >> "/sys/class/drm/card0-HDMI-A-1/status" for checking the status
> > > >> while plug/unplug the HDMI, it shows "disconnected" before
> > > >> plug in HDMI cable, then switch to "connected" after plugin,
> > > >> and still stay "connected" after unplug. This would cause the
> > > >> audio output path cannot correctly switch from HDMI to
> > > >> internal speaker after unplugging the HDMI.
> > > >>
> > > >> I then try to verify with the latest kernel 4.18.0-rc3+, the
> > > >> bug still present. The full "dmesg" log is here.
> > > >> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
> > > >>
> > > >> The HDMI cable is plugged in at ~26th second.
> > > >> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has
> > > >> basic audio support"
> > > >> then unplug the HDMI at ~73th second.
> > > >> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has
> > > >> basic audio support"
> > > >>
> > > >> Please advise what I can do to fix this. Thanks    
> > > >
> > > > Pull the cable out faster?
> > > >
> > > > I presume this is the same old case of hpd disconnecting
> > > > slightly before ddc and we still manage to read the EDID when
> > > > processing the hpd irq. We kinda tried to fix that with the
> > > > live status check but that thing failed spectacularly.
> > > >
> > > > --
> > > > Ville Syrjälä
> > > > Intel    
> > > 
> > > Thanks for the suggestion. I tried pulling the cable out faster,
> > > the status shows correctly. I also tried branch drm-tip of
> > > https://cgit.freedesktop.org/drm/drm-tip
> > > but the symptom persists.
> > > 
> > > Anything I can help here? Or any old commit/patch I can try to do
> > > some experiments?
> > > 
> > > Chris
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx  
> > 
> > I'm working on a same issue with HP KBL ThinPro laptop where both
> > 
> > kernel 4.9.79 & 4.15.7 are failing the same way:
> > - Unplug the HDMI cable slowly the connector status is still
> >   "connected"
> > 
> > Debugging shows from kernel 4.9 and up to 4.18 drim/i915 behaves the
> > same way:
> > - When the HDMI calbe is unplugged, there is a transition time when
> >   the DDC lines are still connected and i915 can read back the EDID
> >   and honors "connected" state
> > 
> > This problem does not happen on Windows7 & Windows 10 on the same
> > failing platform - Windows KMD does *not* read the DDC when seeing
> > the corresponding PCH/HPD pins indicating "disconnected" within
> > 300ms-400ms period - This checking is done during bottom-half
> > interrupt routines
> > 
> > I worked patches with both 4.15.7 and 4.17.1 intercepting this
> > Windows KMD logics; It seems these patches work for HP KBL ThinPro
> > laptop - My patches are being tested by HP team - I was just about
> > to post the open discussion on this topic to collect inputs from
> > our community  
> 
> please send them out anyways ;)
> 
> > - Do we have to refactor the HDMI hot-plug handling codes to cope
> > with this long standing issue?  
> 
> What is your proposal for re-work?
> 
> > - Is that OK to add 300ms-500ms delay "msleep(100)" in a loop in the
> >   bottom half of interrupt routines?  
> 
> Well, We fight to add the delays only when they are required by specs,
> rather than experimental on single display/configuration...
> but/however/nevertheless we have cases that we retry aux
> communications 32 times because a specific monitor...
> 
> please show your patch and we discuss on top of it...
> 
> > 
> > Regards,
> > -Guang
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx  

Following is my temp/test patch evaluated by customers per this HDMI
hot-plut issue:

From 1b5a3c32bd50c88c22cb375f7815c9462f29eae5 Mon Sep 17 00:00:00 2001
From: Guang Bai <guang.bai@intel.com>
Date: Fri, 6 Jul 2018 16:46:55 -0700
Subject: [PATCH] drm/i915: Temp/testing codes to address HDMI hot-plug
issue

When slowly unplugging the HDMI cable, some platforms still
show the HDMI "connected" status - This issue happens from
kernel 4.9 and up to 4.17.1 and drm-tip
---
 drivers/gpu/drm/i915/intel_hotplug.c | 45
+++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+),
1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
b/drivers/gpu/drm/i915/intel_hotplug.c index 875d5d2..fafa9a7 100644
--- a/drivers/gpu/drm/i915/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/intel_hotplug.c
@@ -271,6 +271,8 @@ static bool intel_hpd_irq_event(struct drm_device
*dev, WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
        old_status = connector->status;

+       DRM_DEBUG_KMS(">>> HP-TEST: Enter %s ...\n", __FUNCTION__);
+
        connector->status = drm_helper_probe_detect(connector, NULL,
  false);

        if (old_status == connector->status)
@@ -285,6 +287,45 @@ static bool intel_hpd_irq_event(struct drm_device
        *dev, return true;
 }

+static bool intel_hpd_irq_event2(struct drm_i915_private *dev_priv,
+                                struct drm_connector *connector)
+{
+       struct drm_device *dev = &dev_priv->drm;
+       struct intel_connector *intel_connector =
to_intel_connector(connector);
+       struct intel_encoder *intel_encoder = intel_connector->encoder;
+       enum hpd_pin pin = intel_encoder->hpd_pin;
+       bool changed = false;
+       bool check_connect = false;
+       u32 count = 0;
+
+       DRM_DEBUG_KMS(">>> HP-TEST: Enter %s ...\n", __FUNCTION__);
+
+       if (HAS_PCH_SPT(dev_priv) &&
+           dev_priv->hotplug.stats[pin].state == HPD_ENABLED) {
+               do {
+                       msleep(100);
+                       /*
+                        * Hard-code CPT PORT-B hot-plug status bit
checking.
+                        * Runtime checking based on port & pin TBD
+                        */
+                       if (I915_READ(SDEISR) & SDE_PORTB_HOTPLUG_CPT) {
+                               check_connect = true;
+                               break;
+                       }
+               } while (++count <= 4);
+       } else
+               check_connect = true;
+
+       if (check_connect) {
+               changed |= intel_hpd_irq_event(dev, connector);
+       } else {
+               changed = (intel_connector->base.status !=
+                          connector_status_disconnected);
+               intel_connector->base.status =
connector_status_disconnected;
+       }
+       return changed;
+}
+
 static void i915_digport_work_func(struct work_struct *work)
 {
        struct drm_i915_private *dev_priv =
@@ -370,9 +411,11 @@ static void i915_hotplug_work_func(struct
work_struct *work) if (hpd_event_bits & (1 << intel_encoder->hpd_pin)) {
                        DRM_DEBUG_KMS("Connector %s (pin %i) received
hotplug event.\n", connector->name, intel_encoder->hpd_pin);
+                       DRM_DEBUG_KMS(">>> HP-TEST:
intel_encoder->hot_plug = %llx...\n",
+                                       (unsigned long
long)(intel_encoder->hot_plug)); if (intel_encoder->hot_plug)
                                intel_encoder->hot_plug(intel_encoder);
-                       if (intel_hpd_irq_event(dev, connector))
+                       if (intel_hpd_irq_event2(dev_priv, connector))
                                changed = true;
                }
        }
-- 
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] 31+ messages in thread

* ✗ Fi.CI.BAT: failure for i915 HDMI connector status is connected after disconnection
  2018-07-05  7:58 [BUG] i915 HDMI connector status is connected after disconnection Chris Chiu
  2018-07-05  8:58   ` Jani Nikula
  2018-07-05 14:40   ` Ville Syrjälä
@ 2018-07-07  0:13 ` Patchwork
  2018-09-19 12:22 ` ✗ Fi.CI.CHECKPATCH: warning for i915 HDMI connector status is connected after disconnection (rev2) Patchwork
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 31+ messages in thread
From: Patchwork @ 2018-07-07  0:13 UTC (permalink / raw)
  To: Guang Bai; +Cc: intel-gfx

== Series Details ==

Series: i915 HDMI connector status is connected after disconnection
URL   : https://patchwork.freedesktop.org/series/46108/
State : failure

== Summary ==

Applying: i915 HDMI connector status is connected after disconnection
error: patch fragment without header at line 7: @@ -285,6 +287,45 @@ static bool intel_hpd_irq_event(struct drm_device
error: could not build fake ancestor
Patch failed at 0001 i915 HDMI connector status is connected after disconnection
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-07-06  6:44   ` Chris Chiu
@ 2018-08-22  6:30       ` Chris Chiu
  2018-08-22  6:30       ` Chris Chiu
  1 sibling, 0 replies; 31+ messages in thread
From: Chris Chiu @ 2018-08-22  6:30 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: Jani Nikula, joonas.lahtinen, rodrigo.vivi, David Airlie,
	intel-gfx, Linux Upstreaming Team, Linux Kernel, dri-devel

On Fri, Jul 6, 2018 at 2:44 PM, Chris Chiu <chiu@endlessm.com> wrote:
> On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
>> On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:
>>> Hi,
>>>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>>> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>>> the HDMI connector status stays connected even the HDMI cable has been
>>> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>>> checking the status while plug/unplug the HDMI, it shows
>>> "disconnected" before plug in HDMI cable, then switch to "connected"
>>> after plugin, and still stay "connected" after unplug. This would
>>> cause the audio output path cannot correctly switch from HDMI to
>>> internal speaker after unplugging the HDMI.
>>>
>>> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>>> present. The full "dmesg" log is here.
>>> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>>
>>> The HDMI cable is plugged in at ~26th second.
>>> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>> audio support"
>>> then unplug the HDMI at ~73th second.
>>> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>> audio support"
>>>
>>> Please advise what I can do to fix this. Thanks
>>
>> Pull the cable out faster?
>>
>> I presume this is the same old case of hpd disconnecting slightly
>> before ddc and we still manage to read the EDID when processing
>> the hpd irq. We kinda tried to fix that with the live status
>> check but that thing failed spectacularly.
>>
>> --
>> Ville Syrjälä
>> Intel

There's a patch https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8.
And I verified on the X705FD/X560UD which were easy to reproduce, the patch
works as expected. Can anyone kindly give comments about this patch?
We can do anything to help fix this issue upstream. Thanks

Chris

> Thanks for the suggestion. I tried pulling the cable out faster, the status
> shows correctly. I also tried branch drm-tip of
> https://cgit.freedesktop.org/drm/drm-tip
> but the symptom persists.
>
> Anything I can help here? Or any old commit/patch I can try to do some
> experiments?
>
> Chris

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
@ 2018-08-22  6:30       ` Chris Chiu
  0 siblings, 0 replies; 31+ messages in thread
From: Chris Chiu @ 2018-08-22  6:30 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: Jani Nikula, intel-gfx, Linux Kernel, dri-devel, David Airlie,
	rodrigo.vivi, Linux Upstreaming Team

On Fri, Jul 6, 2018 at 2:44 PM, Chris Chiu <chiu@endlessm.com> wrote:
> On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
>> On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:
>>> Hi,
>>>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>>> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>>> the HDMI connector status stays connected even the HDMI cable has been
>>> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>>> checking the status while plug/unplug the HDMI, it shows
>>> "disconnected" before plug in HDMI cable, then switch to "connected"
>>> after plugin, and still stay "connected" after unplug. This would
>>> cause the audio output path cannot correctly switch from HDMI to
>>> internal speaker after unplugging the HDMI.
>>>
>>> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>>> present. The full "dmesg" log is here.
>>> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>>
>>> The HDMI cable is plugged in at ~26th second.
>>> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>> audio support"
>>> then unplug the HDMI at ~73th second.
>>> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>> audio support"
>>>
>>> Please advise what I can do to fix this. Thanks
>>
>> Pull the cable out faster?
>>
>> I presume this is the same old case of hpd disconnecting slightly
>> before ddc and we still manage to read the EDID when processing
>> the hpd irq. We kinda tried to fix that with the live status
>> check but that thing failed spectacularly.
>>
>> --
>> Ville Syrjälä
>> Intel

There's a patch https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8.
And I verified on the X705FD/X560UD which were easy to reproduce, the patch
works as expected. Can anyone kindly give comments about this patch?
We can do anything to help fix this issue upstream. Thanks

Chris

> Thanks for the suggestion. I tried pulling the cable out faster, the status
> shows correctly. I also tried branch drm-tip of
> https://cgit.freedesktop.org/drm/drm-tip
> but the symptom persists.
>
> Anything I can help here? Or any old commit/patch I can try to do some
> experiments?
>
> Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-08-22  6:30       ` Chris Chiu
  (?)
@ 2018-08-24 15:04       ` Jani Nikula
  2018-09-11 10:25           ` Chris Chiu
  -1 siblings, 1 reply; 31+ messages in thread
From: Jani Nikula @ 2018-08-24 15:04 UTC (permalink / raw)
  To: Chris Chiu, Ville Syrjälä
  Cc: joonas.lahtinen, rodrigo.vivi, David Airlie, intel-gfx,
	Linux Upstreaming Team, Linux Kernel, dri-devel

On Wed, 22 Aug 2018, Chris Chiu <chiu@endlessm.com> wrote:
> On Fri, Jul 6, 2018 at 2:44 PM, Chris Chiu <chiu@endlessm.com> wrote:
>> On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
>> <ville.syrjala@linux.intel.com> wrote:
>>> On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:
>>>> Hi,
>>>>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>>>> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>>>> the HDMI connector status stays connected even the HDMI cable has been
>>>> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>>>> checking the status while plug/unplug the HDMI, it shows
>>>> "disconnected" before plug in HDMI cable, then switch to "connected"
>>>> after plugin, and still stay "connected" after unplug. This would
>>>> cause the audio output path cannot correctly switch from HDMI to
>>>> internal speaker after unplugging the HDMI.
>>>>
>>>> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>>>> present. The full "dmesg" log is here.
>>>> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>>>
>>>> The HDMI cable is plugged in at ~26th second.
>>>> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>> audio support"
>>>> then unplug the HDMI at ~73th second.
>>>> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>> audio support"
>>>>
>>>> Please advise what I can do to fix this. Thanks
>>>
>>> Pull the cable out faster?
>>>
>>> I presume this is the same old case of hpd disconnecting slightly
>>> before ddc and we still manage to read the EDID when processing
>>> the hpd irq. We kinda tried to fix that with the live status
>>> check but that thing failed spectacularly.
>>>
>>> --
>>> Ville Syrjälä
>>> Intel
>
> There's a patch https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8.
> And I verified on the X705FD/X560UD which were easy to reproduce, the patch
> works as expected. Can anyone kindly give comments about this patch?
> We can do anything to help fix this issue upstream. Thanks

Seems like a hack. Should look into hw based debouncing or a slight
delay in the hotplug work processing I think.

BR,
Jani.

>
> Chris
>
>> Thanks for the suggestion. I tried pulling the cable out faster, the status
>> shows correctly. I also tried branch drm-tip of
>> https://cgit.freedesktop.org/drm/drm-tip
>> but the symptom persists.
>>
>> Anything I can help here? Or any old commit/patch I can try to do some
>> experiments?
>>
>> Chris

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-08-24 15:04       ` Jani Nikula
@ 2018-09-11 10:25           ` Chris Chiu
  0 siblings, 0 replies; 31+ messages in thread
From: Chris Chiu @ 2018-09-11 10:25 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Ville Syrjälä,
	joonas.lahtinen, rodrigo.vivi, David Airlie, intel-gfx,
	Linux Upstreaming Team, Linux Kernel, dri-devel

On Fri, Aug 24, 2018 at 11:04 PM, Jani Nikula <jani.nikula@intel.com> wrote:
> On Wed, 22 Aug 2018, Chris Chiu <chiu@endlessm.com> wrote:
>> On Fri, Jul 6, 2018 at 2:44 PM, Chris Chiu <chiu@endlessm.com> wrote:
>>> On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
>>> <ville.syrjala@linux.intel.com> wrote:
>>>> On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:
>>>>> Hi,
>>>>>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>>>>> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>>>>> the HDMI connector status stays connected even the HDMI cable has been
>>>>> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>>>>> checking the status while plug/unplug the HDMI, it shows
>>>>> "disconnected" before plug in HDMI cable, then switch to "connected"
>>>>> after plugin, and still stay "connected" after unplug. This would
>>>>> cause the audio output path cannot correctly switch from HDMI to
>>>>> internal speaker after unplugging the HDMI.
>>>>>
>>>>> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>>>>> present. The full "dmesg" log is here.
>>>>> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>>>>
>>>>> The HDMI cable is plugged in at ~26th second.
>>>>> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>>> audio support"
>>>>> then unplug the HDMI at ~73th second.
>>>>> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>>> audio support"
>>>>>
>>>>> Please advise what I can do to fix this. Thanks
>>>>
>>>> Pull the cable out faster?
>>>>
>>>> I presume this is the same old case of hpd disconnecting slightly
>>>> before ddc and we still manage to read the EDID when processing
>>>> the hpd irq. We kinda tried to fix that with the live status
>>>> check but that thing failed spectacularly.
>>>>
>>>> --
>>>> Ville Syrjälä
>>>> Intel
>>
>> There's a patch https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8.
>> And I verified on the X705FD/X560UD which were easy to reproduce, the patch
>> works as expected. Can anyone kindly give comments about this patch?
>> We can do anything to help fix this issue upstream. Thanks
>
> Seems like a hack. Should look into hw based debouncing or a slight
> delay in the hotplug work processing I think.
>
> BR,
> Jani.
>
So you're suggesting to add a slight delay directly in i915_hotplug_work_func()?
And any suggestion about the 'hw based' debouncing? Maybe some examples
that I can refer to?

Thanks

>>
>> Chris
>>
>>> Thanks for the suggestion. I tried pulling the cable out faster, the status
>>> shows correctly. I also tried branch drm-tip of
>>> https://cgit.freedesktop.org/drm/drm-tip
>>> but the symptom persists.
>>>
>>> Anything I can help here? Or any old commit/patch I can try to do some
>>> experiments?
>>>
>>> Chris
>
> --
> Jani Nikula, Intel Open Source Graphics Center

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
@ 2018-09-11 10:25           ` Chris Chiu
  0 siblings, 0 replies; 31+ messages in thread
From: Chris Chiu @ 2018-09-11 10:25 UTC (permalink / raw)
  To: Jani Nikula
  Cc: David Airlie, intel-gfx, Linux Kernel, dri-devel, rodrigo.vivi,
	Linux Upstreaming Team

On Fri, Aug 24, 2018 at 11:04 PM, Jani Nikula <jani.nikula@intel.com> wrote:
> On Wed, 22 Aug 2018, Chris Chiu <chiu@endlessm.com> wrote:
>> On Fri, Jul 6, 2018 at 2:44 PM, Chris Chiu <chiu@endlessm.com> wrote:
>>> On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
>>> <ville.syrjala@linux.intel.com> wrote:
>>>> On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:
>>>>> Hi,
>>>>>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>>>>> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>>>>> the HDMI connector status stays connected even the HDMI cable has been
>>>>> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>>>>> checking the status while plug/unplug the HDMI, it shows
>>>>> "disconnected" before plug in HDMI cable, then switch to "connected"
>>>>> after plugin, and still stay "connected" after unplug. This would
>>>>> cause the audio output path cannot correctly switch from HDMI to
>>>>> internal speaker after unplugging the HDMI.
>>>>>
>>>>> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>>>>> present. The full "dmesg" log is here.
>>>>> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>>>>
>>>>> The HDMI cable is plugged in at ~26th second.
>>>>> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>>> audio support"
>>>>> then unplug the HDMI at ~73th second.
>>>>> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>>> audio support"
>>>>>
>>>>> Please advise what I can do to fix this. Thanks
>>>>
>>>> Pull the cable out faster?
>>>>
>>>> I presume this is the same old case of hpd disconnecting slightly
>>>> before ddc and we still manage to read the EDID when processing
>>>> the hpd irq. We kinda tried to fix that with the live status
>>>> check but that thing failed spectacularly.
>>>>
>>>> --
>>>> Ville Syrjälä
>>>> Intel
>>
>> There's a patch https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8.
>> And I verified on the X705FD/X560UD which were easy to reproduce, the patch
>> works as expected. Can anyone kindly give comments about this patch?
>> We can do anything to help fix this issue upstream. Thanks
>
> Seems like a hack. Should look into hw based debouncing or a slight
> delay in the hotplug work processing I think.
>
> BR,
> Jani.
>
So you're suggesting to add a slight delay directly in i915_hotplug_work_func()?
And any suggestion about the 'hw based' debouncing? Maybe some examples
that I can refer to?

Thanks

>>
>> Chris
>>
>>> Thanks for the suggestion. I tried pulling the cable out faster, the status
>>> shows correctly. I also tried branch drm-tip of
>>> https://cgit.freedesktop.org/drm/drm-tip
>>> but the symptom persists.
>>>
>>> Anything I can help here? Or any old commit/patch I can try to do some
>>> experiments?
>>>
>>> Chris
>
> --
> 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] 31+ messages in thread

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-09-11 10:25           ` Chris Chiu
@ 2018-09-19 11:20             ` Chris Chiu
  -1 siblings, 0 replies; 31+ messages in thread
From: Chris Chiu @ 2018-09-19 11:20 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Ville Syrjälä,
	joonas.lahtinen, rodrigo.vivi, David Airlie, intel-gfx,
	Linux Upstreaming Team, Linux Kernel, dri-devel

On Tue, Sep 11, 2018 at 6:25 PM, Chris Chiu <chiu@endlessm.com> wrote:
> On Fri, Aug 24, 2018 at 11:04 PM, Jani Nikula <jani.nikula@intel.com> wrote:
>> On Wed, 22 Aug 2018, Chris Chiu <chiu@endlessm.com> wrote:
>>> On Fri, Jul 6, 2018 at 2:44 PM, Chris Chiu <chiu@endlessm.com> wrote:
>>>> On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
>>>> <ville.syrjala@linux.intel.com> wrote:
>>>>> On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:
>>>>>> Hi,
>>>>>>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>>>>>> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>>>>>> the HDMI connector status stays connected even the HDMI cable has been
>>>>>> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>>>>>> checking the status while plug/unplug the HDMI, it shows
>>>>>> "disconnected" before plug in HDMI cable, then switch to "connected"
>>>>>> after plugin, and still stay "connected" after unplug. This would
>>>>>> cause the audio output path cannot correctly switch from HDMI to
>>>>>> internal speaker after unplugging the HDMI.
>>>>>>
>>>>>> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>>>>>> present. The full "dmesg" log is here.
>>>>>> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>>>>>
>>>>>> The HDMI cable is plugged in at ~26th second.
>>>>>> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>>>> audio support"
>>>>>> then unplug the HDMI at ~73th second.
>>>>>> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>>>> audio support"
>>>>>>
>>>>>> Please advise what I can do to fix this. Thanks
>>>>>
>>>>> Pull the cable out faster?
>>>>>
>>>>> I presume this is the same old case of hpd disconnecting slightly
>>>>> before ddc and we still manage to read the EDID when processing
>>>>> the hpd irq. We kinda tried to fix that with the live status
>>>>> check but that thing failed spectacularly.
>>>>>
>>>>> --
>>>>> Ville Syrjälä
>>>>> Intel
>>>
>>> There's a patch https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8.
>>> And I verified on the X705FD/X560UD which were easy to reproduce, the patch
>>> works as expected. Can anyone kindly give comments about this patch?
>>> We can do anything to help fix this issue upstream. Thanks
>>
>> Seems like a hack. Should look into hw based debouncing or a slight
>> delay in the hotplug work processing I think.
>>
>> BR,
>> Jani.
>>

I tried to add a slight delay in the hotplug work as follows

--- a/drivers/gpu/drm/i915/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/intel_hotplug.c
@@ -378,6 +378,8 @@ static void do_i915_hotplug_check(struct work_struct *work,

        spin_unlock_irq(&dev_priv->irq_lock);

+       msleep(100);
+
        drm_connector_list_iter_begin(dev, &conn_iter);
        drm_for_each_connector_iter(connector, &conn_iter) {
                intel_connector = to_intel_connector(connector);

It does work in most cases, but still fail to update the status if I
unplug the HDMI
cable very slow. I basically pull the HDMI cable in loose connected
state first, and
hold in that state ~1 second, totally unplug after that. The status in
sysfs will report
connected as it used to. There was no problem when I tried the patch
https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8

I'll try to modify this patch a little bit and send upstream for
discussion later. Please
advise if any. Thanks.

Chris

> So you're suggesting to add a slight delay directly in i915_hotplug_work_func()?
> And any suggestion about the 'hw based' debouncing? Maybe some examples
> that I can refer to?
>
> Thanks
>
>>>
>>> Chris
>>>
>>>> Thanks for the suggestion. I tried pulling the cable out faster, the status
>>>> shows correctly. I also tried branch drm-tip of
>>>> https://cgit.freedesktop.org/drm/drm-tip
>>>> but the symptom persists.
>>>>
>>>> Anything I can help here? Or any old commit/patch I can try to do some
>>>> experiments?
>>>>
>>>> Chris
>>
>> --
>> Jani Nikula, Intel Open Source Graphics Center

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
@ 2018-09-19 11:20             ` Chris Chiu
  0 siblings, 0 replies; 31+ messages in thread
From: Chris Chiu @ 2018-09-19 11:20 UTC (permalink / raw)
  To: Jani Nikula
  Cc: David Airlie, intel-gfx, Linux Kernel, dri-devel, rodrigo.vivi,
	Linux Upstreaming Team

On Tue, Sep 11, 2018 at 6:25 PM, Chris Chiu <chiu@endlessm.com> wrote:
> On Fri, Aug 24, 2018 at 11:04 PM, Jani Nikula <jani.nikula@intel.com> wrote:
>> On Wed, 22 Aug 2018, Chris Chiu <chiu@endlessm.com> wrote:
>>> On Fri, Jul 6, 2018 at 2:44 PM, Chris Chiu <chiu@endlessm.com> wrote:
>>>> On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrjälä
>>>> <ville.syrjala@linux.intel.com> wrote:
>>>>> On Thu, Jul 05, 2018 at 03:58:36PM +0800, Chris Chiu wrote:
>>>>>> Hi,
>>>>>>     We have few ASUS laptops X705FD (The new WiskyLake), X560UD (intel
>>>>>> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is
>>>>>> the HDMI connector status stays connected even the HDMI cable has been
>>>>>> unplugged. Look into the "/sys/class/drm/card0-HDMI-A-1/status" for
>>>>>> checking the status while plug/unplug the HDMI, it shows
>>>>>> "disconnected" before plug in HDMI cable, then switch to "connected"
>>>>>> after plugin, and still stay "connected" after unplug. This would
>>>>>> cause the audio output path cannot correctly switch from HDMI to
>>>>>> internal speaker after unplugging the HDMI.
>>>>>>
>>>>>> I then try to verify with the latest kernel 4.18.0-rc3+, the bug still
>>>>>> present. The full "dmesg" log is here.
>>>>>> https://gist.github.com/mschiu77/d761d7c5cf191b7868d4d7788ae087f1
>>>>>>
>>>>>> The HDMI cable is plugged in at ~26th second.
>>>>>> "[ 26.214371] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>>>> audio support"
>>>>>> then unplug the HDMI at ~73th second.
>>>>>> "[ 73.328361] [drm:drm_detect_monitor_audio [drm]] Monitor has basic
>>>>>> audio support"
>>>>>>
>>>>>> Please advise what I can do to fix this. Thanks
>>>>>
>>>>> Pull the cable out faster?
>>>>>
>>>>> I presume this is the same old case of hpd disconnecting slightly
>>>>> before ddc and we still manage to read the EDID when processing
>>>>> the hpd irq. We kinda tried to fix that with the live status
>>>>> check but that thing failed spectacularly.
>>>>>
>>>>> --
>>>>> Ville Syrjälä
>>>>> Intel
>>>
>>> There's a patch https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8.
>>> And I verified on the X705FD/X560UD which were easy to reproduce, the patch
>>> works as expected. Can anyone kindly give comments about this patch?
>>> We can do anything to help fix this issue upstream. Thanks
>>
>> Seems like a hack. Should look into hw based debouncing or a slight
>> delay in the hotplug work processing I think.
>>
>> BR,
>> Jani.
>>

I tried to add a slight delay in the hotplug work as follows

--- a/drivers/gpu/drm/i915/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/intel_hotplug.c
@@ -378,6 +378,8 @@ static void do_i915_hotplug_check(struct work_struct *work,

        spin_unlock_irq(&dev_priv->irq_lock);

+       msleep(100);
+
        drm_connector_list_iter_begin(dev, &conn_iter);
        drm_for_each_connector_iter(connector, &conn_iter) {
                intel_connector = to_intel_connector(connector);

It does work in most cases, but still fail to update the status if I
unplug the HDMI
cable very slow. I basically pull the HDMI cable in loose connected
state first, and
hold in that state ~1 second, totally unplug after that. The status in
sysfs will report
connected as it used to. There was no problem when I tried the patch
https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8

I'll try to modify this patch a little bit and send upstream for
discussion later. Please
advise if any. Thanks.

Chris

> So you're suggesting to add a slight delay directly in i915_hotplug_work_func()?
> And any suggestion about the 'hw based' debouncing? Maybe some examples
> that I can refer to?
>
> Thanks
>
>>>
>>> Chris
>>>
>>>> Thanks for the suggestion. I tried pulling the cable out faster, the status
>>>> shows correctly. I also tried branch drm-tip of
>>>> https://cgit.freedesktop.org/drm/drm-tip
>>>> but the symptom persists.
>>>>
>>>> Anything I can help here? Or any old commit/patch I can try to do some
>>>> experiments?
>>>>
>>>> Chris
>>
>> --
>> 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] 31+ messages in thread

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-09-19 11:20             ` Chris Chiu
@ 2018-09-19 12:08               ` Jani Nikula
  -1 siblings, 0 replies; 31+ messages in thread
From: Jani Nikula @ 2018-09-19 12:08 UTC (permalink / raw)
  To: Chris Chiu
  Cc: Ville Syrjälä,
	joonas.lahtinen, rodrigo.vivi, David Airlie, intel-gfx,
	Linux Upstreaming Team, Linux Kernel, dri-devel

On Wed, 19 Sep 2018, Chris Chiu <chiu@endlessm.com> wrote:
> I tried to add a slight delay in the hotplug work as follows
>
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -378,6 +378,8 @@ static void do_i915_hotplug_check(struct work_struct *work,
>
>         spin_unlock_irq(&dev_priv->irq_lock);
>
> +       msleep(100);
> +
>         drm_connector_list_iter_begin(dev, &conn_iter);
>         drm_for_each_connector_iter(connector, &conn_iter) {
>                 intel_connector = to_intel_connector(connector);
>
> It does work in most cases, but still fail to update the status if I
> unplug the HDMI
> cable very slow. I basically pull the HDMI cable in loose connected
> state first, and
> hold in that state ~1 second, totally unplug after that. The status in
> sysfs will report
> connected as it used to. There was no problem when I tried the patch
> https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8
>
> I'll try to modify this patch a little bit and send upstream for
> discussion later. Please
> advise if any. Thanks.

Please let's not add excessive msleeps in work functions.

My idea was more along the lines of making the hotplug function run in a
delayed work. After a chat with Ville, below is what I came up with.

Please let me know how it works. Feel free to toy with the
delay. However, 1-2 seconds or more seems too much.

BR,
Jani.



From 72515b3e856171e52e96bb74796774f595a7f418 Mon Sep 17 00:00:00 2001
From: Jani Nikula <jani.nikula@intel.com>
Date: Tue, 18 Sep 2018 13:12:34 +0300
Subject: [PATCH] drm/i915: delay hotplug scheduling
Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Cc: Jani Nikula <jani.nikula@intel.com>

On some systems we get the hotplug irq on unplug before the DDC pins
have been disconnected, resulting in connector status remaining
connected. Since previous attempts at using hotplug live status before
DDC have failed, the only viable option is to reduce the window for
mistakes. Delay the hotplug processing.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h      |  2 +-
 drivers/gpu/drm/i915/intel_hotplug.c | 15 ++++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 7d4daa7412f1..27f579abddae 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -286,7 +286,7 @@ enum hpd_pin {
 #define HPD_STORM_DEFAULT_THRESHOLD 5
 
 struct i915_hotplug {
-	struct work_struct hotplug_work;
+	struct delayed_work hotplug_work;
 
 	struct {
 		unsigned long last_jiffies;
diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
index 648a13c6043c..3af64daa5cfc 100644
--- a/drivers/gpu/drm/i915/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/intel_hotplug.c
@@ -110,6 +110,8 @@ enum hpd_pin intel_hpd_pin_default(struct drm_i915_private *dev_priv,
 	}
 }
 
+#define HOTPLUG_DELAY_MS		300
+
 #define HPD_STORM_DETECT_PERIOD		1000
 #define HPD_STORM_REENABLE_DELAY	(2 * 60 * 1000)
 
@@ -319,7 +321,8 @@ static void i915_digport_work_func(struct work_struct *work)
 		spin_lock_irq(&dev_priv->irq_lock);
 		dev_priv->hotplug.event_bits |= old_bits;
 		spin_unlock_irq(&dev_priv->irq_lock);
-		schedule_work(&dev_priv->hotplug.hotplug_work);
+		schedule_delayed_work(&dev_priv->hotplug.hotplug_work,
+				      msecs_to_jiffies(HOTPLUG_DELAY_MS));
 	}
 }
 
@@ -329,7 +332,7 @@ static void i915_digport_work_func(struct work_struct *work)
 static void i915_hotplug_work_func(struct work_struct *work)
 {
 	struct drm_i915_private *dev_priv =
-		container_of(work, struct drm_i915_private, hotplug.hotplug_work);
+		container_of(work, struct drm_i915_private, hotplug.hotplug_work.work);
 	struct drm_device *dev = &dev_priv->drm;
 	struct intel_connector *intel_connector;
 	struct intel_encoder *intel_encoder;
@@ -466,7 +469,8 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
 	if (queue_dig)
 		queue_work(dev_priv->hotplug.dp_wq, &dev_priv->hotplug.dig_port_work);
 	if (queue_hp)
-		schedule_work(&dev_priv->hotplug.hotplug_work);
+		schedule_delayed_work(&dev_priv->hotplug.hotplug_work,
+				      msecs_to_jiffies(HOTPLUG_DELAY_MS));
 }
 
 /**
@@ -586,7 +590,8 @@ void intel_hpd_poll_init(struct drm_i915_private *dev_priv)
 
 void intel_hpd_init_work(struct drm_i915_private *dev_priv)
 {
-	INIT_WORK(&dev_priv->hotplug.hotplug_work, i915_hotplug_work_func);
+	INIT_DELAYED_WORK(&dev_priv->hotplug.hotplug_work,
+			  i915_hotplug_work_func);
 	INIT_WORK(&dev_priv->hotplug.dig_port_work, i915_digport_work_func);
 	INIT_WORK(&dev_priv->hotplug.poll_init_work, i915_hpd_poll_init_work);
 	INIT_DELAYED_WORK(&dev_priv->hotplug.reenable_work,
@@ -604,7 +609,7 @@ void intel_hpd_cancel_work(struct drm_i915_private *dev_priv)
 	spin_unlock_irq(&dev_priv->irq_lock);
 
 	cancel_work_sync(&dev_priv->hotplug.dig_port_work);
-	cancel_work_sync(&dev_priv->hotplug.hotplug_work);
+	cancel_delayed_work_sync(&dev_priv->hotplug.hotplug_work);
 	cancel_work_sync(&dev_priv->hotplug.poll_init_work);
 	cancel_delayed_work_sync(&dev_priv->hotplug.reenable_work);
 }
-- 
2.11.0


-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
@ 2018-09-19 12:08               ` Jani Nikula
  0 siblings, 0 replies; 31+ messages in thread
From: Jani Nikula @ 2018-09-19 12:08 UTC (permalink / raw)
  To: Chris Chiu
  Cc: David Airlie, intel-gfx, Linux Kernel, dri-devel, rodrigo.vivi,
	Linux Upstreaming Team

On Wed, 19 Sep 2018, Chris Chiu <chiu@endlessm.com> wrote:
> I tried to add a slight delay in the hotplug work as follows
>
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -378,6 +378,8 @@ static void do_i915_hotplug_check(struct work_struct *work,
>
>         spin_unlock_irq(&dev_priv->irq_lock);
>
> +       msleep(100);
> +
>         drm_connector_list_iter_begin(dev, &conn_iter);
>         drm_for_each_connector_iter(connector, &conn_iter) {
>                 intel_connector = to_intel_connector(connector);
>
> It does work in most cases, but still fail to update the status if I
> unplug the HDMI
> cable very slow. I basically pull the HDMI cable in loose connected
> state first, and
> hold in that state ~1 second, totally unplug after that. The status in
> sysfs will report
> connected as it used to. There was no problem when I tried the patch
> https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8
>
> I'll try to modify this patch a little bit and send upstream for
> discussion later. Please
> advise if any. Thanks.

Please let's not add excessive msleeps in work functions.

My idea was more along the lines of making the hotplug function run in a
delayed work. After a chat with Ville, below is what I came up with.

Please let me know how it works. Feel free to toy with the
delay. However, 1-2 seconds or more seems too much.

BR,
Jani.



From 72515b3e856171e52e96bb74796774f595a7f418 Mon Sep 17 00:00:00 2001
From: Jani Nikula <jani.nikula@intel.com>
Date: Tue, 18 Sep 2018 13:12:34 +0300
Subject: [PATCH] drm/i915: delay hotplug scheduling
Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Cc: Jani Nikula <jani.nikula@intel.com>

On some systems we get the hotplug irq on unplug before the DDC pins
have been disconnected, resulting in connector status remaining
connected. Since previous attempts at using hotplug live status before
DDC have failed, the only viable option is to reduce the window for
mistakes. Delay the hotplug processing.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h      |  2 +-
 drivers/gpu/drm/i915/intel_hotplug.c | 15 ++++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 7d4daa7412f1..27f579abddae 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -286,7 +286,7 @@ enum hpd_pin {
 #define HPD_STORM_DEFAULT_THRESHOLD 5
 
 struct i915_hotplug {
-	struct work_struct hotplug_work;
+	struct delayed_work hotplug_work;
 
 	struct {
 		unsigned long last_jiffies;
diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
index 648a13c6043c..3af64daa5cfc 100644
--- a/drivers/gpu/drm/i915/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/intel_hotplug.c
@@ -110,6 +110,8 @@ enum hpd_pin intel_hpd_pin_default(struct drm_i915_private *dev_priv,
 	}
 }
 
+#define HOTPLUG_DELAY_MS		300
+
 #define HPD_STORM_DETECT_PERIOD		1000
 #define HPD_STORM_REENABLE_DELAY	(2 * 60 * 1000)
 
@@ -319,7 +321,8 @@ static void i915_digport_work_func(struct work_struct *work)
 		spin_lock_irq(&dev_priv->irq_lock);
 		dev_priv->hotplug.event_bits |= old_bits;
 		spin_unlock_irq(&dev_priv->irq_lock);
-		schedule_work(&dev_priv->hotplug.hotplug_work);
+		schedule_delayed_work(&dev_priv->hotplug.hotplug_work,
+				      msecs_to_jiffies(HOTPLUG_DELAY_MS));
 	}
 }
 
@@ -329,7 +332,7 @@ static void i915_digport_work_func(struct work_struct *work)
 static void i915_hotplug_work_func(struct work_struct *work)
 {
 	struct drm_i915_private *dev_priv =
-		container_of(work, struct drm_i915_private, hotplug.hotplug_work);
+		container_of(work, struct drm_i915_private, hotplug.hotplug_work.work);
 	struct drm_device *dev = &dev_priv->drm;
 	struct intel_connector *intel_connector;
 	struct intel_encoder *intel_encoder;
@@ -466,7 +469,8 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
 	if (queue_dig)
 		queue_work(dev_priv->hotplug.dp_wq, &dev_priv->hotplug.dig_port_work);
 	if (queue_hp)
-		schedule_work(&dev_priv->hotplug.hotplug_work);
+		schedule_delayed_work(&dev_priv->hotplug.hotplug_work,
+				      msecs_to_jiffies(HOTPLUG_DELAY_MS));
 }
 
 /**
@@ -586,7 +590,8 @@ void intel_hpd_poll_init(struct drm_i915_private *dev_priv)
 
 void intel_hpd_init_work(struct drm_i915_private *dev_priv)
 {
-	INIT_WORK(&dev_priv->hotplug.hotplug_work, i915_hotplug_work_func);
+	INIT_DELAYED_WORK(&dev_priv->hotplug.hotplug_work,
+			  i915_hotplug_work_func);
 	INIT_WORK(&dev_priv->hotplug.dig_port_work, i915_digport_work_func);
 	INIT_WORK(&dev_priv->hotplug.poll_init_work, i915_hpd_poll_init_work);
 	INIT_DELAYED_WORK(&dev_priv->hotplug.reenable_work,
@@ -604,7 +609,7 @@ void intel_hpd_cancel_work(struct drm_i915_private *dev_priv)
 	spin_unlock_irq(&dev_priv->irq_lock);
 
 	cancel_work_sync(&dev_priv->hotplug.dig_port_work);
-	cancel_work_sync(&dev_priv->hotplug.hotplug_work);
+	cancel_delayed_work_sync(&dev_priv->hotplug.hotplug_work);
 	cancel_work_sync(&dev_priv->hotplug.poll_init_work);
 	cancel_delayed_work_sync(&dev_priv->hotplug.reenable_work);
 }
-- 
2.11.0


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

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

* ✗ Fi.CI.CHECKPATCH: warning for i915 HDMI connector status is connected after disconnection (rev2)
  2018-07-05  7:58 [BUG] i915 HDMI connector status is connected after disconnection Chris Chiu
                   ` (2 preceding siblings ...)
  2018-07-07  0:13 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2018-09-19 12:22 ` Patchwork
  2018-09-19 12:40 ` ✓ Fi.CI.BAT: success " Patchwork
  2018-09-19 14:50 ` ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 0 replies; 31+ messages in thread
From: Patchwork @ 2018-09-19 12:22 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: i915 HDMI connector status is connected after disconnection (rev2)
URL   : https://patchwork.freedesktop.org/series/46108/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
b6026b7e42ea i915 HDMI connector status is connected after disconnection
-:11: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#11: 
> @@ -378,6 +378,8 @@ static void do_i915_hotplug_check(struct work_struct *work,

-:45: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit fatal: bad o ("4796774f595a7f418")'
#45: 
>From 72515b3e856171e52e96bb74796774f595a7f418 Mon Sep 17 00:00:00 2001

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

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

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

* ✓ Fi.CI.BAT: success for i915 HDMI connector status is connected after disconnection (rev2)
  2018-07-05  7:58 [BUG] i915 HDMI connector status is connected after disconnection Chris Chiu
                   ` (3 preceding siblings ...)
  2018-09-19 12:22 ` ✗ Fi.CI.CHECKPATCH: warning for i915 HDMI connector status is connected after disconnection (rev2) Patchwork
@ 2018-09-19 12:40 ` Patchwork
  2018-09-19 14:50 ` ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 0 replies; 31+ messages in thread
From: Patchwork @ 2018-09-19 12:40 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: i915 HDMI connector status is connected after disconnection (rev2)
URL   : https://patchwork.freedesktop.org/series/46108/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4842 -> Patchwork_10224 =

== Summary - SUCCESS ==

  No regressions found.

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

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-no-display:
      fi-cnl-u:           NOTRUN -> DMESG-WARN (fdo#105763)

    igt@gem_exec_suspend@basic-s4-devices:
      fi-blb-e6850:       PASS -> INCOMPLETE (fdo#107718)

    igt@kms_flip@basic-flip-vs-modeset:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106000)

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

    igt@kms_psr@primary_mmap_gtt:
      fi-cnl-u:           NOTRUN -> FAIL (fdo#107383) +3

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

    
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
  fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
  fdo#107383 https://bugs.freedesktop.org/show_bug.cgi?id=107383
  fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
  fdo#107726 https://bugs.freedesktop.org/show_bug.cgi?id=107726


== Participating hosts (51 -> 47) ==

  Additional (2): fi-cnl-u fi-skl-iommu 
  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-skl-6700hq 


== Build changes ==

    * Linux: CI_DRM_4842 -> Patchwork_10224

  CI_DRM_4842: c852a798cb607a487898b96c63708f0cb1ce61ff @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4646: d409cc6f234fbc0122c64be27ba85b5603658de5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10224: b6026b7e42eaffd61b62553a51094df70abe5986 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

b6026b7e42ea i915 HDMI connector status is connected after disconnection

== Logs ==

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

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

* ✓ Fi.CI.IGT: success for i915 HDMI connector status is connected after disconnection (rev2)
  2018-07-05  7:58 [BUG] i915 HDMI connector status is connected after disconnection Chris Chiu
                   ` (4 preceding siblings ...)
  2018-09-19 12:40 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-09-19 14:50 ` Patchwork
  5 siblings, 0 replies; 31+ messages in thread
From: Patchwork @ 2018-09-19 14:50 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: i915 HDMI connector status is connected after disconnection (rev2)
URL   : https://patchwork.freedesktop.org/series/46108/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4842_full -> Patchwork_10224_full =

== Summary - SUCCESS ==

  No regressions found.

  

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_suspend@shrink:
      shard-glk:          PASS -> INCOMPLETE (k.org#198133, fdo#103359, fdo#106886)

    igt@kms_chv_cursor_fail@pipe-a-64x64-bottom-edge:
      shard-glk:          PASS -> FAIL (fdo#104671)

    igt@kms_cursor_legacy@cursora-vs-flipa-toggle:
      shard-glk:          PASS -> DMESG-WARN (fdo#106538, fdo#105763)

    igt@kms_draw_crc@draw-method-xrgb2101010-mmap-gtt-xtiled:
      shard-glk:          PASS -> FAIL (fdo#103184)

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

    igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend:
      shard-snb:          NOTRUN -> INCOMPLETE (fdo#105411)

    
    ==== Possible fixes ====

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

    
    ==== Warnings ====

    igt@kms_frontbuffer_tracking@fbc-1p-indfb-fliptrack:
      shard-snb:          INCOMPLETE (fdo#105411) -> DMESG-WARN (fdo#107469)

    
  fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#104671 https://bugs.freedesktop.org/show_bug.cgi?id=104671
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
  fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
  fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
  fdo#107469 https://bugs.freedesktop.org/show_bug.cgi?id=107469
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


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

  Missing    (1): pig-snb-2600 


== Build changes ==

    * Linux: CI_DRM_4842 -> Patchwork_10224

  CI_DRM_4842: c852a798cb607a487898b96c63708f0cb1ce61ff @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4646: d409cc6f234fbc0122c64be27ba85b5603658de5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10224: b6026b7e42eaffd61b62553a51094df70abe5986 @ 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_10224/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
  2018-09-19 12:08               ` Jani Nikula
@ 2018-09-20  7:32                 ` Chris Chiu
  -1 siblings, 0 replies; 31+ messages in thread
From: Chris Chiu @ 2018-09-20  7:32 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Ville Syrjälä,
	joonas.lahtinen, rodrigo.vivi, David Airlie, intel-gfx,
	Linux Upstreaming Team, Linux Kernel, dri-devel

On Wed, Sep 19, 2018 at 8:08 PM, Jani Nikula <jani.nikula@intel.com> wrote:
> On Wed, 19 Sep 2018, Chris Chiu <chiu@endlessm.com> wrote:
>> I tried to add a slight delay in the hotplug work as follows
>>
>> --- a/drivers/gpu/drm/i915/intel_hotplug.c
>> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
>> @@ -378,6 +378,8 @@ static void do_i915_hotplug_check(struct work_struct *work,
>>
>>         spin_unlock_irq(&dev_priv->irq_lock);
>>
>> +       msleep(100);
>> +
>>         drm_connector_list_iter_begin(dev, &conn_iter);
>>         drm_for_each_connector_iter(connector, &conn_iter) {
>>                 intel_connector = to_intel_connector(connector);
>>
>> It does work in most cases, but still fail to update the status if I
>> unplug the HDMI
>> cable very slow. I basically pull the HDMI cable in loose connected
>> state first, and
>> hold in that state ~1 second, totally unplug after that. The status in
>> sysfs will report
>> connected as it used to. There was no problem when I tried the patch
>> https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8
>>
>> I'll try to modify this patch a little bit and send upstream for
>> discussion later. Please
>> advise if any. Thanks.
>
> Please let's not add excessive msleeps in work functions.
>
> My idea was more along the lines of making the hotplug function run in a
> delayed work. After a chat with Ville, below is what I came up with.
>
> Please let me know how it works. Feel free to toy with the
> delay. However, 1-2 seconds or more seems too much.
>
> BR,
> Jani.
>

Thanks to the patch. It works in most cases on my problematic laptops.
After lots
of experiments, ex. pull the cable out with different paces, range
delay from 300 to
800 msec, it makes no significant difference for a longer delay. So
300 msec is good
enough for most cases. It at least updates the status correctly with a
visible quick
display blink when disconnecting HDMI. And compared to other machines which have
no such problem, the HDMI cable slow pull out also result in the same
problem. I'll
say the test result is OK for me. Thanks.

Chris

>
>
> From 72515b3e856171e52e96bb74796774f595a7f418 Mon Sep 17 00:00:00 2001
> From: Jani Nikula <jani.nikula@intel.com>
> Date: Tue, 18 Sep 2018 13:12:34 +0300
> Subject: [PATCH] drm/i915: delay hotplug scheduling
> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
> Cc: Jani Nikula <jani.nikula@intel.com>
>
> On some systems we get the hotplug irq on unplug before the DDC pins
> have been disconnected, resulting in connector status remaining
> connected. Since previous attempts at using hotplug live status before
> DDC have failed, the only viable option is to reduce the window for
> mistakes. Delay the hotplug processing.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h      |  2 +-
>  drivers/gpu/drm/i915/intel_hotplug.c | 15 ++++++++++-----
>  2 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 7d4daa7412f1..27f579abddae 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -286,7 +286,7 @@ enum hpd_pin {
>  #define HPD_STORM_DEFAULT_THRESHOLD 5
>
>  struct i915_hotplug {
> -       struct work_struct hotplug_work;
> +       struct delayed_work hotplug_work;
>
>         struct {
>                 unsigned long last_jiffies;
> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
> index 648a13c6043c..3af64daa5cfc 100644
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -110,6 +110,8 @@ enum hpd_pin intel_hpd_pin_default(struct drm_i915_private *dev_priv,
>         }
>  }
>
> +#define HOTPLUG_DELAY_MS               300
> +
>  #define HPD_STORM_DETECT_PERIOD                1000
>  #define HPD_STORM_REENABLE_DELAY       (2 * 60 * 1000)
>
> @@ -319,7 +321,8 @@ static void i915_digport_work_func(struct work_struct *work)
>                 spin_lock_irq(&dev_priv->irq_lock);
>                 dev_priv->hotplug.event_bits |= old_bits;
>                 spin_unlock_irq(&dev_priv->irq_lock);
> -               schedule_work(&dev_priv->hotplug.hotplug_work);
> +               schedule_delayed_work(&dev_priv->hotplug.hotplug_work,
> +                                     msecs_to_jiffies(HOTPLUG_DELAY_MS));
>         }
>  }
>
> @@ -329,7 +332,7 @@ static void i915_digport_work_func(struct work_struct *work)
>  static void i915_hotplug_work_func(struct work_struct *work)
>  {
>         struct drm_i915_private *dev_priv =
> -               container_of(work, struct drm_i915_private, hotplug.hotplug_work);
> +               container_of(work, struct drm_i915_private, hotplug.hotplug_work.work);
>         struct drm_device *dev = &dev_priv->drm;
>         struct intel_connector *intel_connector;
>         struct intel_encoder *intel_encoder;
> @@ -466,7 +469,8 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
>         if (queue_dig)
>                 queue_work(dev_priv->hotplug.dp_wq, &dev_priv->hotplug.dig_port_work);
>         if (queue_hp)
> -               schedule_work(&dev_priv->hotplug.hotplug_work);
> +               schedule_delayed_work(&dev_priv->hotplug.hotplug_work,
> +                                     msecs_to_jiffies(HOTPLUG_DELAY_MS));
>  }
>
>  /**
> @@ -586,7 +590,8 @@ void intel_hpd_poll_init(struct drm_i915_private *dev_priv)
>
>  void intel_hpd_init_work(struct drm_i915_private *dev_priv)
>  {
> -       INIT_WORK(&dev_priv->hotplug.hotplug_work, i915_hotplug_work_func);
> +       INIT_DELAYED_WORK(&dev_priv->hotplug.hotplug_work,
> +                         i915_hotplug_work_func);
>         INIT_WORK(&dev_priv->hotplug.dig_port_work, i915_digport_work_func);
>         INIT_WORK(&dev_priv->hotplug.poll_init_work, i915_hpd_poll_init_work);
>         INIT_DELAYED_WORK(&dev_priv->hotplug.reenable_work,
> @@ -604,7 +609,7 @@ void intel_hpd_cancel_work(struct drm_i915_private *dev_priv)
>         spin_unlock_irq(&dev_priv->irq_lock);
>
>         cancel_work_sync(&dev_priv->hotplug.dig_port_work);
> -       cancel_work_sync(&dev_priv->hotplug.hotplug_work);
> +       cancel_delayed_work_sync(&dev_priv->hotplug.hotplug_work);
>         cancel_work_sync(&dev_priv->hotplug.poll_init_work);
>         cancel_delayed_work_sync(&dev_priv->hotplug.reenable_work);
>  }
> --
> 2.11.0
>
>
> --
> Jani Nikula, Intel Open Source Graphics Center

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

* Re: [BUG] i915 HDMI connector status is connected after disconnection
@ 2018-09-20  7:32                 ` Chris Chiu
  0 siblings, 0 replies; 31+ messages in thread
From: Chris Chiu @ 2018-09-20  7:32 UTC (permalink / raw)
  To: Jani Nikula
  Cc: David Airlie, intel-gfx, Linux Kernel, dri-devel, rodrigo.vivi,
	Linux Upstreaming Team

On Wed, Sep 19, 2018 at 8:08 PM, Jani Nikula <jani.nikula@intel.com> wrote:
> On Wed, 19 Sep 2018, Chris Chiu <chiu@endlessm.com> wrote:
>> I tried to add a slight delay in the hotplug work as follows
>>
>> --- a/drivers/gpu/drm/i915/intel_hotplug.c
>> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
>> @@ -378,6 +378,8 @@ static void do_i915_hotplug_check(struct work_struct *work,
>>
>>         spin_unlock_irq(&dev_priv->irq_lock);
>>
>> +       msleep(100);
>> +
>>         drm_connector_list_iter_begin(dev, &conn_iter);
>>         drm_for_each_connector_iter(connector, &conn_iter) {
>>                 intel_connector = to_intel_connector(connector);
>>
>> It does work in most cases, but still fail to update the status if I
>> unplug the HDMI
>> cable very slow. I basically pull the HDMI cable in loose connected
>> state first, and
>> hold in that state ~1 second, totally unplug after that. The status in
>> sysfs will report
>> connected as it used to. There was no problem when I tried the patch
>> https://bugs.freedesktop.org/show_bug.cgi?id=107125#c8
>>
>> I'll try to modify this patch a little bit and send upstream for
>> discussion later. Please
>> advise if any. Thanks.
>
> Please let's not add excessive msleeps in work functions.
>
> My idea was more along the lines of making the hotplug function run in a
> delayed work. After a chat with Ville, below is what I came up with.
>
> Please let me know how it works. Feel free to toy with the
> delay. However, 1-2 seconds or more seems too much.
>
> BR,
> Jani.
>

Thanks to the patch. It works in most cases on my problematic laptops.
After lots
of experiments, ex. pull the cable out with different paces, range
delay from 300 to
800 msec, it makes no significant difference for a longer delay. So
300 msec is good
enough for most cases. It at least updates the status correctly with a
visible quick
display blink when disconnecting HDMI. And compared to other machines which have
no such problem, the HDMI cable slow pull out also result in the same
problem. I'll
say the test result is OK for me. Thanks.

Chris

>
>
> From 72515b3e856171e52e96bb74796774f595a7f418 Mon Sep 17 00:00:00 2001
> From: Jani Nikula <jani.nikula@intel.com>
> Date: Tue, 18 Sep 2018 13:12:34 +0300
> Subject: [PATCH] drm/i915: delay hotplug scheduling
> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
> Cc: Jani Nikula <jani.nikula@intel.com>
>
> On some systems we get the hotplug irq on unplug before the DDC pins
> have been disconnected, resulting in connector status remaining
> connected. Since previous attempts at using hotplug live status before
> DDC have failed, the only viable option is to reduce the window for
> mistakes. Delay the hotplug processing.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h      |  2 +-
>  drivers/gpu/drm/i915/intel_hotplug.c | 15 ++++++++++-----
>  2 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 7d4daa7412f1..27f579abddae 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -286,7 +286,7 @@ enum hpd_pin {
>  #define HPD_STORM_DEFAULT_THRESHOLD 5
>
>  struct i915_hotplug {
> -       struct work_struct hotplug_work;
> +       struct delayed_work hotplug_work;
>
>         struct {
>                 unsigned long last_jiffies;
> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
> index 648a13c6043c..3af64daa5cfc 100644
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -110,6 +110,8 @@ enum hpd_pin intel_hpd_pin_default(struct drm_i915_private *dev_priv,
>         }
>  }
>
> +#define HOTPLUG_DELAY_MS               300
> +
>  #define HPD_STORM_DETECT_PERIOD                1000
>  #define HPD_STORM_REENABLE_DELAY       (2 * 60 * 1000)
>
> @@ -319,7 +321,8 @@ static void i915_digport_work_func(struct work_struct *work)
>                 spin_lock_irq(&dev_priv->irq_lock);
>                 dev_priv->hotplug.event_bits |= old_bits;
>                 spin_unlock_irq(&dev_priv->irq_lock);
> -               schedule_work(&dev_priv->hotplug.hotplug_work);
> +               schedule_delayed_work(&dev_priv->hotplug.hotplug_work,
> +                                     msecs_to_jiffies(HOTPLUG_DELAY_MS));
>         }
>  }
>
> @@ -329,7 +332,7 @@ static void i915_digport_work_func(struct work_struct *work)
>  static void i915_hotplug_work_func(struct work_struct *work)
>  {
>         struct drm_i915_private *dev_priv =
> -               container_of(work, struct drm_i915_private, hotplug.hotplug_work);
> +               container_of(work, struct drm_i915_private, hotplug.hotplug_work.work);
>         struct drm_device *dev = &dev_priv->drm;
>         struct intel_connector *intel_connector;
>         struct intel_encoder *intel_encoder;
> @@ -466,7 +469,8 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
>         if (queue_dig)
>                 queue_work(dev_priv->hotplug.dp_wq, &dev_priv->hotplug.dig_port_work);
>         if (queue_hp)
> -               schedule_work(&dev_priv->hotplug.hotplug_work);
> +               schedule_delayed_work(&dev_priv->hotplug.hotplug_work,
> +                                     msecs_to_jiffies(HOTPLUG_DELAY_MS));
>  }
>
>  /**
> @@ -586,7 +590,8 @@ void intel_hpd_poll_init(struct drm_i915_private *dev_priv)
>
>  void intel_hpd_init_work(struct drm_i915_private *dev_priv)
>  {
> -       INIT_WORK(&dev_priv->hotplug.hotplug_work, i915_hotplug_work_func);
> +       INIT_DELAYED_WORK(&dev_priv->hotplug.hotplug_work,
> +                         i915_hotplug_work_func);
>         INIT_WORK(&dev_priv->hotplug.dig_port_work, i915_digport_work_func);
>         INIT_WORK(&dev_priv->hotplug.poll_init_work, i915_hpd_poll_init_work);
>         INIT_DELAYED_WORK(&dev_priv->hotplug.reenable_work,
> @@ -604,7 +609,7 @@ void intel_hpd_cancel_work(struct drm_i915_private *dev_priv)
>         spin_unlock_irq(&dev_priv->irq_lock);
>
>         cancel_work_sync(&dev_priv->hotplug.dig_port_work);
> -       cancel_work_sync(&dev_priv->hotplug.hotplug_work);
> +       cancel_delayed_work_sync(&dev_priv->hotplug.hotplug_work);
>         cancel_work_sync(&dev_priv->hotplug.poll_init_work);
>         cancel_delayed_work_sync(&dev_priv->hotplug.reenable_work);
>  }
> --
> 2.11.0
>
>
> --
> 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] 31+ messages in thread

end of thread, other threads:[~2018-09-20  7:32 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-05  7:58 [BUG] i915 HDMI connector status is connected after disconnection Chris Chiu
2018-07-05  8:58 ` Jani Nikula
2018-07-05  8:58   ` Jani Nikula
2018-07-05  9:04   ` Chris Wilson
2018-07-05  9:04     ` Chris Wilson
2018-07-05  9:37     ` Jani Nikula
2018-07-05  9:37       ` Jani Nikula
2018-07-05 13:02       ` Chris Chiu
2018-07-05 13:18         ` Jani Nikula
2018-07-05 13:30           ` Chris Chiu
2018-07-05 14:40 ` Ville Syrjälä
2018-07-05 14:40   ` Ville Syrjälä
2018-07-06  6:44   ` Chris Chiu
2018-07-06 17:41     ` Guang Bai
2018-07-06 20:38       ` Rodrigo Vivi
2018-07-07  0:03         ` Guang Bai
2018-08-22  6:30     ` Chris Chiu
2018-08-22  6:30       ` Chris Chiu
2018-08-24 15:04       ` Jani Nikula
2018-09-11 10:25         ` Chris Chiu
2018-09-11 10:25           ` Chris Chiu
2018-09-19 11:20           ` Chris Chiu
2018-09-19 11:20             ` Chris Chiu
2018-09-19 12:08             ` Jani Nikula
2018-09-19 12:08               ` Jani Nikula
2018-09-20  7:32               ` Chris Chiu
2018-09-20  7:32                 ` Chris Chiu
2018-07-07  0:13 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-09-19 12:22 ` ✗ Fi.CI.CHECKPATCH: warning for i915 HDMI connector status is connected after disconnection (rev2) Patchwork
2018-09-19 12:40 ` ✓ Fi.CI.BAT: success " Patchwork
2018-09-19 14:50 ` ✓ Fi.CI.IGT: " 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.