Received: by 10.213.65.68 with SMTP id h4csp2469421imn; Thu, 5 Apr 2018 15:56:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx49252s07nrS64iG53KwiDcsSEK/KBcgcKmTeiZv6t4I0+p3ikFZ9+N/SXlBMkNGITklWOiJ X-Received: by 10.98.107.138 with SMTP id g132mr18250002pfc.163.1522968976313; Thu, 05 Apr 2018 15:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522968976; cv=none; d=google.com; s=arc-20160816; b=VSkf2bsu5mgkQrg5I8It8xNDIIr1Z4TTepmDCs96OaB71umYRVrM8SL2463olk9Qay AzklAESchZ++G5meYvmpHf0FNk7DFv5qzuyKDczGFuU9oi2O8YbccMPS936Kp17V4ZeJ YlRpqr3IvPEHp7uNchbq0xR3Qi9RoFihmXvayRqGzVOSBJnIHNDmNJrDrdu988ZeF1D+ xyZEcUgzhuWKBY4ZY/SoXOH7rGBxewtwWNUFDvfKcTPrssx9sTa/ymfiKLWVWBEuF0zN oWrft6TzMfU6VHxNLK8NJqF9zzrKihe6P9Rd8oRtpT5I7JMhdRv71Lw6QspkD652ABId S/3Q== 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:mime-version :references:in-reply-to:date:cc:to:reply-to:from:subject:message-id :arc-authentication-results; bh=XXnbxLAfdgNwiwx3ccuexPI0lLQQyLkVvyOcyk0+hec=; b=W0a58QdbECENVKjYYF9K8HH5qki6D1jawxeU5V0h5dhseF25vm9MKyfdQb90HLjN/V SZIfdB+7+c8FsfaYKE0cKSslAujRq73U08V7sYdjPQjan2fdf+P1CLFZ7qPZDA542czn M9HlJvFu/0VUDchPlT6tW0D1l8XNfqUdEQW4PMnemmXPgXJuRhnzdZrvQmAMSZ4wFoVS DVdns2xx6/NEv+RvcfrkOkB/b05s8nNeWROo4YKyMC1Liw72PrjF5LMbncM9YENuv04j qJG6hxSXXuo4d3haI8S3Zt9rmTxnLYeOs6LfcyL2E3DvK0NaCLsau0ODE76ZG6JT6Q70 6YcA== ARC-Authentication-Results: i=1; mx.google.com; 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 l85si6781626pfb.231.2018.04.05.15.56.02; Thu, 05 Apr 2018 15:56:16 -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; 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 S1752820AbeDEWyx (ORCPT + 99 others); Thu, 5 Apr 2018 18:54:53 -0400 Received: from mga04.intel.com ([192.55.52.120]:25150 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752729AbeDEWys (ORCPT ); Thu, 5 Apr 2018 18:54:48 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 15:54:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="31402956" Received: from dk-h97m-d3h.jf.intel.com (HELO [10.54.75.17]) ([10.54.75.17]) by orsmga008.jf.intel.com with ESMTP; 05 Apr 2018 15:54:47 -0700 Message-ID: <1522970344.2418.51.camel@dk-H97M-D3H> Subject: Re: [Intel-gfx] [PATCH v3] drm/i915/dp: Send DPCD ON for MST before phy_up From: Dhinakaran Pandiyan Reply-To: dhinakaran.pandiyan@intel.com To: Lyude Paul Cc: intel-gfx@lists.freedesktop.org, David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Rodrigo Vivi , Laura Abbott Date: Thu, 05 Apr 2018 16:19:04 -0700 In-Reply-To: <20180405211930.1209-1-lyude@redhat.com> References: <20180405203601.23242-1-lyude@redhat.com> <20180405211930.1209-1-lyude@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-04-05 at 17:19 -0400, Lyude Paul wrote: > When doing a modeset where the sink is transitioning from D3 to D0 , it > would sometimes be possible for the initial power_up_phy() to start > timing out. This would only be observed in the last action before the > sink went into D3 mode was intel_dp_sink_dpms(DRM_MODE_DPMS_OFF). We > originally thought this might be an issue with us accidentally shutting > off the aux block when putting the sink into D3, but since the DP spec > mandates that sinks must wake up within 1ms while we have 100ms to > respond to an ESI irq, this didn't really add up. Turns out that the > problem is more subtle then that: > > It turns out that the timeout is from us not enabling DPMS on the MST > hub before actually trying to initiate sideband communications. This > would cause the first sideband communication (power_up_phy()), to start > timing out because the sink wasn't ready to respond. Afterwards, we > would call intel_dp_sink_dpms(DRM_MODE_DPMS_ON) in > intel_ddi_pre_enable_dp(), which would actually result in waking up the > sink so that sideband requests would work again. > > Since DPMS is what lets us actually bring the hub up into a state where > sideband communications become functional again, we just need to make > sure to enable DPMS on the display before attempting to perform sideband > communications. > > Changes since v1: > - Remove comment above if (!intel_dp->is_mst) - vsryjala > - Move intel_dp_sink_dpms() for MST into intel_dp_post_disable_mst() to > keep enable/disable paths symmetrical > - Improve commit message - dhnkrn > Changes since v2: > - Only send DPMS off when we're disabling the last sink, and only send > DPMS on when we're enabling the first sink - dhnkrn > > Signed-off-by: Lyude Paul > Cc: Dhinakaran Pandiyan > Cc: Ville Syrjälä > Cc: Laura Abbott > Cc: stable@vger.kernel.org > Fixes: ad260ab32a4d9 ("drm/i915/dp: Write to SET_POWER dpcd to enable MST hub.") > --- > drivers/gpu/drm/i915/intel_ddi.c | 6 ++++-- > drivers/gpu/drm/i915/intel_dp_mst.c | 8 +++++++- > 2 files changed, 11 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c > index a6672a9abd85..c0bf7419e1c1 100644 > --- a/drivers/gpu/drm/i915/intel_ddi.c > +++ b/drivers/gpu/drm/i915/intel_ddi.c > @@ -2324,7 +2324,8 @@ static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder, > intel_prepare_dp_ddi_buffers(encoder, crtc_state); > > intel_ddi_init_dp_buf_reg(encoder); > - intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); > + if (!intel_dp->is_mst) > + intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); I believe Ville recommended to check for is_mst = intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) here. The question is, are there cases where intel_dp->is_mst != is_mst? A disconnect in the middle of a modeset would cause intel_dp->is_mst to be false, wouldn't it?