Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp617614imm; Wed, 19 Sep 2018 04:20:42 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbm2iR7BeLZd0hYJPWIeUF3/CF9iD9hjYgknVO7K211fFJBMtTheAHLk/hEX03HSaAbGfS1 X-Received: by 2002:a63:91c2:: with SMTP id l185-v6mr32653067pge.321.1537356042736; Wed, 19 Sep 2018 04:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537356042; cv=none; d=google.com; s=arc-20160816; b=lnrK41WCoCZCDsuxLONEtKaEXIuu8uw8+QZryW9HON16Hbms7y72swaz3/3X0mi2BH CRl3yMSzyf+yMZIbIiWnpkS00OWfwMp+Bl4u+DD+oml+xXmtELZO7lV1tDcyWnFlsG+2 IyLKaAHg/iu/yFCq7i6LZmICxua5SeiGreDbmjDi6sbp/LzlosPO3ZsSi54qv4FQbBAv p6n1rFBiX4aXQ58WbLcafsv7aVFrrdISkt0WekngPNTT8FPwc3lz5siYJuClbMN/izSj f/DG/21VTCoJAjqxPtWY1fGtjGJI0axtPoJbjk1LLax104ACqleUFtn4nj6FlGslB1Wd dSdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature; bh=hA0fQ3tpM8Gwj2bmKphRGaCfWpsJsg7qrXsk9r4dn1Y=; b=tsuWKVbUyjBO98f1buqVvrL/VaMC2rnJPVSThB9Gp9GJXaSCC20YQyhem61LHF7mdc p0hwW7FF4ZjBeOonYq6eBJJWX7rwObrAVYde9F7IZuE4Su481jRUKfZGkjEQ1zEVV8b7 4Qr4Th/h9KScUYcwwzLdky26GfKQq73TgjDyv4yBWcEe+SuQ4zYZOnaj+M4fuUPUo7qk J0bxi1kns6fTkBT6so3W2O8qyYCtYnEmaKCX6WtpaKhIOmM2bW2j05Kiu0wZg3MTyriQ KrIrPkV+tzVxpNqyFilt40X7mlXGYOlQGrRoSXOmB217mJrHKtadB+0Rx69JNYlXIcGl YFsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b="NSbHV3/3"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d41-v6si20779299pla.172.2018.09.19.04.20.27; Wed, 19 Sep 2018 04:20:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b="NSbHV3/3"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731233AbeISQ5c (ORCPT + 99 others); Wed, 19 Sep 2018 12:57:32 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:44094 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727675AbeISQ5c (ORCPT ); Wed, 19 Sep 2018 12:57:32 -0400 Received: by mail-ed1-f65.google.com with SMTP id s10-v6so4538736edb.11 for ; Wed, 19 Sep 2018 04:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hA0fQ3tpM8Gwj2bmKphRGaCfWpsJsg7qrXsk9r4dn1Y=; b=NSbHV3/3kjqBfNS6aMej4bJqKmMkk/YdaSLgGvUCXF7xNghJxx06wMoswhHVolWSOP hGFdKhL4Mbq3HlbfiFL1dToisaDrKkN5RzvY8xfJuFR+YV7oPA/ohK3dsYwOK0ix4xrz 1vht3XPl08IhbOZStDqWs7swrwLunw4N4WjdO/Vx+6RSg4Lq+TNvG+kXKgqAWexP0eYd oMj+I/uVfV/hbE5vEZ+wtYpYs2yARA6K/l65dnk11ExIvsoX728Z0CmsjZLlJTBpPeQK VXS+ORuPZrHNHvsFRCmYHvEcQ5VkbVEoTM7lVdiLWfYouUemyoee/HNKTSmN9Y4ipjf3 jPKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=hA0fQ3tpM8Gwj2bmKphRGaCfWpsJsg7qrXsk9r4dn1Y=; b=d1yJyzZKeDxhBDPC6Z/Cef6f/wksqD0zOzFAq7kijBK2GmFxpKLDjrWdZPT7cGd50c m2yEBF4aRlR13EAY5vvhBioNDZbO+QCcNMDAXhy5apOl/zYg5khsuk3+TkaM1ZuzEdh4 wRxFMOic3h5MTQNOzgxiVa3luAozkdjkv8StHkOZoUMq5hJOldYPvhVCAeZtrAuvjflF Fgn7pzkhSQ9MmyMvLq5cmERHvoL8wrbxeWvjG2xtakCHwBrpZqf1b6y9z07m10kWuAk/ G89m9DrMoEYCmcIsDcMGtegyB3rzn1zBPUlQdSTgu4wTg3M0CBUsOUd7MsZdISVbFhs1 hmPQ== X-Gm-Message-State: APzg51ChCt8AQWF4IYlMnRCUvifakH3Ma+tK2lEG1C2FTiSiCBcHbK3O mBXK1nEPHd1yV7mR4xb9/zKsud67B4R8f2gdySfK4g== X-Received: by 2002:a50:98a3:: with SMTP id j32-v6mr56293417edb.6.1537356003318; Wed, 19 Sep 2018 04:20:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:94ae:0:0:0:0:0 with HTTP; Wed, 19 Sep 2018 04:20:02 -0700 (PDT) In-Reply-To: References: <20180705144009.GC5565@intel.com> <87tvnjlsap.fsf@intel.com> From: Chris Chiu Date: Wed, 19 Sep 2018 19:20:02 +0800 Message-ID: Subject: Re: [BUG] i915 HDMI connector status is connected after disconnection To: Jani Nikula Cc: =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, David Airlie , intel-gfx@lists.freedesktop.org, Linux Upstreaming Team , Linux Kernel , dri-devel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 11, 2018 at 6:25 PM, Chris Chiu wrote: > On Fri, Aug 24, 2018 at 11:04 PM, Jani Nikula wro= te: >> On Wed, 22 Aug 2018, Chris Chiu wrote: >>> On Fri, Jul 6, 2018 at 2:44 PM, Chris Chiu wrote: >>>> On Thu, Jul 5, 2018 at 10:40 PM, Ville Syrj=C3=A4l=C3=A4 >>>> 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 (int= el >>>>>> i5-8250U), X530UN (intel i7-8550U) share the same problem, which is >>>>>> the HDMI connector status stays connected even the HDMI cable has be= en >>>>>> 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 sti= ll >>>>>> 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=C3=A4l=C3=A4 >>>>> Intel >>> >>> There's a patch https://bugs.freedesktop.org/show_bug.cgi?id=3D107125#c= 8. >>> And I verified on the X705FD/X560UD which were easy to reproduce, the p= atch >>> 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 *w= ork, 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 =3D 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=3D107125#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 s= tatus >>>> 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