Received: by 10.213.65.68 with SMTP id h4csp1131426imn; Wed, 4 Apr 2018 13:12:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx48fE1a9nc01In9r1XMZ7a9XT3Vupzba67cs5XHZ8E1LGA2zhUoPEmr8iH8ys+DMsdMjhicl X-Received: by 2002:a17:902:a608:: with SMTP id u8-v6mr20139495plq.25.1522872754223; Wed, 04 Apr 2018 13:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522872754; cv=none; d=google.com; s=arc-20160816; b=JfIZj7FgaQW4cdYGSLcIYxa02mIZAUJ6lYf3530GoSDtv0A8ZI7oXyU9ipwegdnS5A ZHpMCOCnriAF5ni0svHQB/KmiGBUaI2dYoiYwQb2wSdc6zrhTTkk8cbMqIH/o65duQ8B fXvoZVWJXMA8XnPAC1lnaeuV0c1C8UEl16qqj00dexJ9xphnTJq9jqw/5inTlTz+BusW sVrer7OcPopY+wDqBa/HiJHlh66z8qr/9F30Kr4m1e31x13a1/EUiJKVUBTISFMrRTSh nNi2QyJ/ReieN8fbIRrd8+AkEu73dcdyCAJLXAGDAbF9/0drhFdOWR03AJfPFb0lROou ODKg== 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 :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=RFs9Ybyvt3FSM473F5qdCXou8wbeAhLz0HXItYwpRrI=; b=Oi4f2hcUQYr3xhF0bmQieYP8H6Md3uRMAjsGyTJwL29bGgiE7O84OMLeg6xWFiK3aU 8lUBc7oWMmatdGrGWgyXoXPh24JSseJSWGwKZv5vUvVIL3IyS/wri3sRNM8Fzqy1ZqxW LWBYrsl8+TWPjAgygH/LGKdojQxeCvGyTn9RZ/LhdehQJrHcUzbi2VxwhMUNTKxUlhG9 UP6iksa3G8+bQZfMCjaCjXqIlQROOtUGvA/xGAmLed/lLo3nVRXMlvwT76WrB3WucWxg zTHua75zDTiL50Q1wiIThYw47qlCOHUc2f0POiHOyGpRS7oq3BV2z5ZFqhH3AvIe1h/y kivw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si1764139pgn.473.2018.04.04.13.12.20; Wed, 04 Apr 2018 13:12:34 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110AbeDDULM (ORCPT + 99 others); Wed, 4 Apr 2018 16:11:12 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:36777 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751574AbeDDULK (ORCPT ); Wed, 4 Apr 2018 16:11:10 -0400 Received: by mail-qt0-f194.google.com with SMTP id w23so16413663qtn.3 for ; Wed, 04 Apr 2018 13:11:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=RFs9Ybyvt3FSM473F5qdCXou8wbeAhLz0HXItYwpRrI=; b=FC99u4wcpJy80iLCoe+hHMhuWLN+cujwfLwnMW/iGqTjlwqf//LyVsZlbJ1tVNNPfG neYkDjmvqtSs2O5Sov93VMZ9YjdOJKOR+TiuA2owDUIFsiUbG7Q9yHfUkYQw3+NTA2KQ ToSSDHv/t3Fbm/atXOJ3Poeguf+Iawk1MiRehhvG287MDojjk6XaTKEd7ILwYmW8wCpi 2tf5+fir009V6mwr/j6kTSxDxzhGx62RrEtFD9wrHNW3nP7wWjf5ytuYxSbz+RTdljbq 3p3Nr4siWDIZ/XdCHo0jeICOCj5MlFVJ1gEy5+dPSvG74I/Xn2M1WqzWZZu9ujxqri/Y CCRw== X-Gm-Message-State: ALQs6tDIHQ2yGmJcXEe7HhphogYJVYENQY8H71CkBLeKvmc6/N1A2jZx YW/Dae41q6BNP0mQNvLx0hkAHw== X-Received: by 10.200.114.83 with SMTP id l19mr20704977qtp.325.1522872669849; Wed, 04 Apr 2018 13:11:09 -0700 (PDT) Received: from dhcp-10-20-1-55.bss.redhat.com ([144.121.20.162]) by smtp.gmail.com with ESMTPSA id d84sm1135370qkb.46.2018.04.04.13.11.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Apr 2018 13:11:09 -0700 (PDT) Message-ID: <1522872668.5025.6.camel@redhat.com> Subject: Re: [PATCH v2] drm/i915: Keep AUX block running when disabling DPMS for MST From: Lyude Paul To: Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= Cc: intel-gfx@lists.freedesktop.org, Laura Abbott , Dhinakaran Pandiyan , stable@vger.kernel.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Wed, 04 Apr 2018 16:11:08 -0400 In-Reply-To: <20180404193555.GI5453@intel.com> References: <20180402212142.19841-1-lyude@redhat.com> <20180402212617.21247-1-lyude@redhat.com> <20180404153429.GE5453@intel.com> <1522867061.12403.6.camel@redhat.com> <20180404185313.GG5453@intel.com> <1522868412.12403.13.camel@redhat.com> <20180404193555.GI5453@intel.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 (3.26.6-1.fc27) 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 Wed, 2018-04-04 at 22:35 +0300, Ville Syrjälä wrote: > On Wed, Apr 04, 2018 at 03:00:12PM -0400, Lyude Paul wrote: > > On Wed, 2018-04-04 at 21:53 +0300, Ville Syrjälä wrote: > > > On Wed, Apr 04, 2018 at 02:37:41PM -0400, Lyude Paul wrote: > > > > On Wed, 2018-04-04 at 18:34 +0300, Ville Syrjälä wrote: > > > > > On Mon, Apr 02, 2018 at 05:26:16PM -0400, Lyude Paul wrote: > > > > > > While enabling/disabling DPMS before link training with MST hubs > > > > > > is > > > > > > perfectly valid; unfortunately disabling DPMS results in some > > > > > > devices > > > > > > disabling their AUX CH block as well. For SST this isn't as much > > > > > > of a > > > > > > problem, but for MST we need to be able to continue handling aux > > > > > > transactions even when none of the sinks are turned on since it's > > > > > > possible for us to have a single atomic commit which results in > > > > > > disabling each downstream sink, followed by subsequently re- > > > > > > enabling > > > > > > each sink. > > > > > > > > > > > > If we don't do this, we'll end up stalling any pending ESI > > > > > > interrupts > > > > > > from the sink for up to 1ms. Unfortunately, dropping ESIs during > > > > > > this > > > > > > timespan makes it so that link fallback retraining for MST (which > > > > > > I > > > > > > will > > > > > > be submitting to the ML shortly) fails due to the channel EQ > > > > > > failure > > > > > > interrupts potentially getting dropped. Additionally, when > > > > > > performing > > > > > > a > > > > > > modeset that brings the hub status's link status from bad -> good > > > > > > having > > > > > > ESIs disabled for that long causes us to miss the hub's response > > > > > > to us > > > > > > trying to start link training as well. > > > > > > > > > > > > Since any sink with MST is going to support DisplayPort 1.2 > > > > > > anyway, > > > > > > save > > > > > > us the hassle of trying to wait until the sink comes back up and > > > > > > just > > > > > > never shut the aux block down. > > > > > > > > > > > > Changes since v2: > > > > > > - Fix patch name, no functional changes > > > > > > > > > > > > Signed-off-by: Lyude Paul > > > > > > Cc: Laura Abbott > > > > > > Cc: Dhinakaran Pandiyan > > > > > > Cc: Ville Syrjälä > > > > > > Cc: stable@vger.kernel.org > > > > > > Fixes: ad260ab32a4d9 ("drm/i915/dp: Write to SET_POWER dpcd to > > > > > > enable > > > > > > MST > > > > > > hub.") > > > > > > --- > > > > > > drivers/gpu/drm/i915/intel_dp.c | 6 ++++-- > > > > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > > > > > > > diff --git a/drivers/gpu/drm/i915/intel_dp.c > > > > > > b/drivers/gpu/drm/i915/intel_dp.c > > > > > > index 62f82c4298ac..0479c377981b 100644 > > > > > > --- a/drivers/gpu/drm/i915/intel_dp.c > > > > > > +++ b/drivers/gpu/drm/i915/intel_dp.c > > > > > > @@ -2589,11 +2589,13 @@ void intel_dp_sink_dpms(struct intel_dp > > > > > > *intel_dp, > > > > > > int mode) > > > > > > return; > > > > > > > > > > > > if (mode != DRM_MODE_DPMS_ON) { > > > > > > + unsigned char data = intel_dp->is_mst ? > > > > > > + DP_SET_POWER_D3_AUX_ON : DP_SET_POWER_D3; > > > > > > > > > > This smells like a workaround for an actual bug somewhere. Why > > > > > exactly > > > > > is the slower wakeup or the AUX block a problem for MST but not for > > > > > SST > > > > > when the link training is exactly the same for SST and MST? > > > > > > > > I actually thought about this but I still think this is the > > > > appropriate > > > > fix. > > > > So; the real reason for the wakeup not being a problem with SST is > > > > that > > > > for > > > > DPMS on with SST, we actually do a wait to make sure that the hub is > > > > ready > > > > before continuing. And yes: I'm fairly sure SST does actually have > > > > around > > > > the > > > > same wakeup time that MST does, but with the wait we do it doesn't > > > > reallhy > > > > make a difference. With MST, we could do this but there's a few > > > > reasons I > > > > don't think we should: > > > > * We don't need to. D3_AUX_ON is a part of the 1.2 spec, so any hub > > > > that > > > > has > > > > MST is going to be guaranteed to have this. > > > > * Turning off the aux block means that there's a high chance we're > > > > going > > > > to > > > > miss ESIs from sinks > > > > > > And how exactly do we lose irqs? The hub/whatever throws the up req msgs > > > away if we don't read them within some really short time? > > > > Oh-additionally I did forget to mention that i have actually witnessed the > > channel eq failures in the ESI getting dropped without this patch. > > Not sure what that means. I don't think there is any sideband messaging > involved in link training so not sure what is dropped in this case. The > link status/etc. are just polled directly by the upstream device. no, no nononono they are not always with MST. mdnavare is right regarding the channel EQ occasionally being the only indicator that there's something wrong with the link training. I've seen this with my caldigit ts3 with the mst hub hooked up to it. I'm not entirely sure why, but my guess would be that there's a displayport repeater somewhere in the TS3 that's not an mst branch device. I'd think chances are that from the source's perspective, we might be doing link training with that instead of the actual hub, which means that if link training between the hub and said repeater failed the only way it would be reported would be through the channel eq because it's detected by the MST hub. There's some other behavior regarding this that makes me a little more sure of this. I've got an old Dell P2415Qb monitor with MST on it that actually does manage to train at the full 5.4 GBit/s on the caldigit TS3 without needing fallback retraining. Keep in mind, this monitor is kind of infamous across our office for having a lot of probably-against-spec MST bugs that don't really happen on other devices. That being said, it trains and doesn't ever throw channel EQ failed notifications. But unlike the EVGA MST hub I have which does throw the EQ failed notifications, the screen flickers so often it's really difficult for me to believe it's actually link trained properly. This is mainly where my theory of link status problems that aren't actually visible to the source comes in, because if that's the case then the most likely explanation is that the problematic P2415Qb never sends channel EQ failures because it's firmware just isn't smart enough to monitor the symbol failure rate and detect that link retraining is required. > > > Meaning if > > we miss them, there's a chance the hub may just not choose to send them > > again > > for whatever reason. > > > > > > > * It's faster to keep the aux block on anyway > > > > > > > > > > > > > > > > > > > + > > > > > > if (downstream_hpd_needs_d0(intel_dp)) > > > > > > return; > > > > > > > > > > > > - ret = drm_dp_dpcd_writeb(&intel_dp->aux, > > > > > > DP_SET_POWER, > > > > > > - DP_SET_POWER_D3); > > > > > > + ret = drm_dp_dpcd_writeb(&intel_dp->aux, > > > > > > DP_SET_POWER, > > > > > > data); > > > > > > } else { > > > > > > struct intel_lspcon *lspcon = > > > > > > dp_to_lspcon(intel_dp); > > > > > > > > > > > > -- > > > > > > 2.14.3 > > > > > > > > > > > > > > > > > > -- > > > > Cheers, > > > > Lyude Paul > > > > > > > > > > -- > > Cheers, > > Lyude Paul > > -- Cheers, Lyude Paul