Received: by 10.213.65.68 with SMTP id h4csp297098imn; Mon, 12 Mar 2018 14:13:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELtHq8WvBnl1Sp7Jbdezm1qSyPD6x0i56Jfqk7h2LGMPGwBcS/FC5Lg5OLXWraQnMuBeDG/Z X-Received: by 2002:a17:902:be16:: with SMTP id r22-v6mr6787980pls.268.1520889236567; Mon, 12 Mar 2018 14:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520889236; cv=none; d=google.com; s=arc-20160816; b=a0HQW7rAuZZOfuLXLlrPcviskSmatk2aYSMjWw+FX34mLib/TAxyNsQ7O0bWSiCNyE ifwyVw4vW4GNfomXaUKkZoiazSmu8b0k0GsjuCEpatGNaN+xF0gFp5+hADDgpSRa9DV8 N9NWuwfpU7fXatdLGaC2mQPGGfpPOrzwSybC9XU4QUmKtURF49KV3NK3fuUufdXxr9qT jx2DqQ690MhI+cU9NmS6XE8d5txYALYW8hHYsxMLuzrb7S/zPpPkHQJ6gqXo9zWBjwV/ SpU0ZWgcxtxs/eGXZdzRJkuERMG5y71qzw5rDrnZdoOBE3SsF0B4mL0Ri2QZ7NuBzAu7 ykSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=4O+qhLrb6CbjXA1GqyNC697BbeE7CfKcj3XHYOj/sA0=; b=xBWlOCtcMSkDsdoX2okRugaCW2PXGkjF1rrE6lHmx1BGhfyioN/OFGjgT0vBDpleF2 gSnNU0xgGJJuApY53KDUpJVgK7LTcaHrY5yp7G2EZs+1KDU7egzVEL272IlXsLJtvcX4 KzZolWy9GDENAMTx02vY7jSqrGED/J+uZzinJXnvGiaSt4Yh3/rs355Dchl94TAe+Sre DPCE9LASvYeY654MkSO3Oz9xbVkkrQCipTL2rQzoQTSta+r/LICxYu1nl9ixMseDyLNB 1wiKl0kMQ6tndHZjUTIRNOswCq54AbUYG43GS0OjN/BTOQRccLqq/tP5pkiFBKeDEg2z /wgw== 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 s18si4191039pgv.779.2018.03.12.14.13.28; Mon, 12 Mar 2018 14:13:56 -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 S932339AbeCLVMb (ORCPT + 99 others); Mon, 12 Mar 2018 17:12:31 -0400 Received: from mga12.intel.com ([192.55.52.136]:6160 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932242AbeCLVMa (ORCPT ); Mon, 12 Mar 2018 17:12:30 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Mar 2018 14:12:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,463,1515484800"; d="scan'208";a="37574549" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 12 Mar 2018 14:12:27 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Mar 2018 23:12:26 +0200 Date: Mon, 12 Mar 2018 23:12:26 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Lyude Paul Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Manasi Navare , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 5/5] drm/i915: Implement proper fallback training for MST Message-ID: <20180312211226.GT5453@intel.com> References: <20180308232421.14049-1-lyude@redhat.com> <20180309213232.19855-1-lyude@redhat.com> <20180309213232.19855-5-lyude@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180309213232.19855-5-lyude@redhat.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 09, 2018 at 04:32:31PM -0500, Lyude Paul wrote: > @@ -6266,25 +6368,98 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, > return false; > } > > +static void intel_dp_mst_retrain_link_work(struct work_struct *work) > +{ Why do we need another work for this? Can't we just retrain from the hotplug work always? > + struct drm_modeset_acquire_ctx ctx; > + struct intel_dp *intel_dp = container_of(work, typeof(*intel_dp), > + mst_retrain_work); > + struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; > + struct drm_device *dev = intel_encoder->base.dev; > + int ret; > + bool had_error = false; > + > + drm_modeset_acquire_init(&ctx, 0); > + > + for (;;) { > + ret = intel_dp_retrain_link(intel_encoder, &ctx); > + if (ret == -EDEADLK) { > + drm_modeset_backoff(&ctx); > + continue; > + } > + > + break; > + } > + if (!ret) { > + DRM_DEBUG_KMS("Retrain complete\n"); > + goto out; > + } else if (ret == -EIO) { > + DRM_ERROR("IO error with sink during retrain? Aborting\n"); > + had_error = true; > + goto out; > + } > + > + DRM_DEBUG_KMS("Retraining failed with %d, marking link status as bad\n", > + ret); > + > + /* We ran out of retries, if the sink hasn't changed the link rate in > + * it's dpcd yet force us to fallback to a lower link rate/count */ > + if (ret == -EINVAL) { > + ret = intel_dp_get_dpcd(intel_dp); > + if (!ret) { > + DRM_ERROR("IO error while reading dpcd from sink\n"); > + had_error = true; > + goto out; > + } > + > + if (intel_dp->link_rate == intel_dp_max_link_rate(intel_dp) && > + intel_dp->lane_count == intel_dp_max_lane_count(intel_dp)) { > + intel_dp_get_link_train_fallback_values( > + intel_dp, intel_dp_max_link_rate(intel_dp), > + intel_dp_max_lane_count(intel_dp)); > + } > + } > + > + intel_dp->mst_link_is_bad = true; > + intel_dp->mst_bw_locked = false; > + schedule_work(&intel_dp->modeset_retry_work); > +out: > + drm_modeset_drop_locks(&ctx); > + drm_modeset_acquire_fini(&ctx); > + if (had_error) > + drm_kms_helper_hotplug_event(dev); > +} > + -- Ville Syrj?l? Intel OTC