From patchwork Thu Dec 21 06:36:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhinakaran Pandiyan X-Patchwork-Id: 10126981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 28994603B5 for ; Thu, 21 Dec 2017 06:36:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D20A20856 for ; Thu, 21 Dec 2017 06:36:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12288297C3; Thu, 21 Dec 2017 06:36:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D514F20856 for ; Thu, 21 Dec 2017 06:36:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38D768947A; Thu, 21 Dec 2017 06:36:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id EE994893EB; Thu, 21 Dec 2017 06:36:55 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2017 22:36:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,434,1508828400"; d="scan'208";a="188631858" Received: from dk-thinkpad-x260.jf.intel.com (HELO localhost.localdomain) ([10.54.75.38]) by fmsmga005.fm.intel.com with ESMTP; 20 Dec 2017 22:36:52 -0800 From: Dhinakaran Pandiyan To: intel-gfx@lists.freedesktop.org Subject: [PATCH] drm/dp: Power cycle display if LINK_ADDRESS fails. Date: Wed, 20 Dec 2017 22:36:24 -0800 Message-Id: <20171221063624.2309-1-dhinakaran.pandiyan@intel.com> X-Mailer: git-send-email 2.11.0 Cc: Jani Nikula , Dave Airlie , Dhinakaran Pandiyan , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Occasionally there are LINK_ADDRESS sideband messages timing out with the Lenovo MST dock + Dell MST monitor(w/ in-built branch) setup I have. These failures lead to the display not coming up on boot. Power cycling the port corresponding to the MST monitor's branch device and resending the message fixes the issue. I am not entirely sure if this is specific to my setup. However, as the power state is toggled conditionally on LINK_ADDRESS timeouts, this should not affect the working cases. Cc: Lyude Cc: Dave Airlie Cc: Jani Nikula Signed-off-by: Dhinakaran Pandiyan --- drivers/gpu/drm/drm_dp_mst_topology.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 70dcfa58d3c2..e06defcdcf18 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1596,8 +1596,9 @@ static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, int len; struct drm_dp_sideband_msg_tx *txmsg; int ret; + int attempts = 5; - txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); +retry: txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); if (!txmsg) return; @@ -1635,9 +1636,17 @@ static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, } (*mgr->cbs->hotplug)(mgr); } + } else if (attempts--) { + kfree(txmsg); + drm_dp_send_power_updown_phy(mstb->mgr, mstb->port_parent, + false); + drm_dp_send_power_updown_phy(mstb->mgr, mstb->port_parent, + true); + DRM_DEBUG_KMS("link address failed %d, retrying\n", ret); + goto retry; } else { mstb->link_address_sent = false; - DRM_DEBUG_KMS("link address failed %d\n", ret); + DRM_DEBUG_KMS("link address failed %d, giving up\n", ret); } kfree(txmsg);