Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp81283ybz; Fri, 24 Apr 2020 12:09:37 -0700 (PDT) X-Google-Smtp-Source: APiQypIV4D1s6RAPz0HkLVzpg4AmeFDeEaa78Juge93jyrv31uuAVINybgQSzq0LxyhwBiXmkgKS X-Received: by 2002:a50:8716:: with SMTP id i22mr8706773edb.248.1587755377631; Fri, 24 Apr 2020 12:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587755377; cv=none; d=google.com; s=arc-20160816; b=eos35wz9voLcg/doUYkEpKL/D0b8c3Y205f3XcWhpvNVsjk1d0HHl8PITUWoXEhYQo lYcOROjmoQiZ5Fny32ZanKkJhdRwbwDrkwumNvfnuopTks+MC3g9ArPzysMTJiat82+K uCnkD5WJZ/JVSQvHnc3CbsMIKzRRwVvkcwqx0Br6w5shSYlq/V8fA6xohq6eP497cNfD 8XCwI0fw7PzelkpU+jgsvblW/25N2oxQCalS1V6nctYPrzBKw2ybcXchmG09U/dTKed7 EJ4ejSr5M/rzrN/fSOGhzsesIfLCchst8kI1aCUphtq6fjZqa34qtKS6KJGnJIgP15Ex yfBg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=2jnvEsORNgR7b9vWe7xevtJyvEa+IeRDZ+hvY7I0CUI=; b=Dg7RqP/y9K4DO+2ZBDUFDLWCFr15ufyKpS2EoclyMQLfe0TRK2PVQ5ARssPAtjqqm4 aPhWFhacLHbBtyM42kZyEeoAHd1tP2cqokeE39bgUmg4WkENybnvhcN4Yr1taGaPiWyh 5okWMG13V/7n7KbwVcqsAxz0/JdKzRZNUTAoLsBDZtrGbt/qcoSqqAfWHXaUxt/gE+O/ ep7GIHqNwCWO/IrE8JVsLDnbBpkI5VuKu9eGHmIPFpxToO51tYlV5DvvtAUkAxeaH2TE v3+wiO20Y6LeOmJMt6HqGpzNAcfIrEg2R0CefXBri94G/NQi6nrr607jwaio8Lbv2EIH 0jXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Wn6FFTWp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w21si3699479ejz.276.2020.04.24.12.09.14; Fri, 24 Apr 2020 12:09:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Wn6FFTWp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729283AbgDXTHe (ORCPT + 99 others); Fri, 24 Apr 2020 15:07:34 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:41919 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727022AbgDXTHd (ORCPT ); Fri, 24 Apr 2020 15:07:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587755252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=2jnvEsORNgR7b9vWe7xevtJyvEa+IeRDZ+hvY7I0CUI=; b=Wn6FFTWp6msZXdJAPODbTYfA0uUAvFgIpDv7Nz+j5GFJznzfFNWTc9kaBf3SOaeGl6OLjF JqxvlmjHru+lMKLAQ0c5AgdZy9E1RhWklus+JvGCYq9UGI45juJUxZiVvRxcH88CF2vJ5M t7DOsbCyfoJuPJXAhvaVkhFzPo7ooco= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-419-RATWQOPrMG61uMefhhjxoA-1; Fri, 24 Apr 2020 15:07:30 -0400 X-MC-Unique: RATWQOPrMG61uMefhhjxoA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9A487800C78; Fri, 24 Apr 2020 19:07:28 +0000 (UTC) Received: from Ruby.redhat.com (ovpn-115-210.rdu2.redhat.com [10.10.115.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7A8460F8D; Fri, 24 Apr 2020 19:07:26 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org Cc: Benjamin Gaignard , Sean Paul , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org Subject: [PATCH] drm/dp_mst: Fix drm_dp_send_dpcd_write() return code Date: Fri, 24 Apr 2020 15:07:22 -0400 Message-Id: <20200424190722.775284-1-lyude@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org drm_dp_mst_wait_tx_reply() returns > 1 if time elapsed in wait_event_timeout() before check_txmsg_state(mgr, txmsg) evaluated to true. However, we make the mistake of returning this time from drm_dp_send_dpcd_write() on success instead of returning the number of bytes written - causing spontaneous failures during link probing: [drm:drm_dp_send_link_address [drm_kms_helper]] *ERROR* GUID check on 10:01 failed: 3975 Yikes! So, fix this by returning the number of bytes written on success instead. Signed-off-by: Lyude Paul Fixes: cb897542c6d2 ("drm/dp_mst: Fix W=3D1 warnings") Cc: Benjamin Gaignard Cc: Sean Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_= dp_mst_topology.c index 03a1496f6120..21dc78cb4ba6 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -3436,8 +3436,12 @@ static int drm_dp_send_dpcd_write(struct drm_dp_ms= t_topology_mgr *mgr, drm_dp_queue_down_tx(mgr, txmsg); =20 ret =3D drm_dp_mst_wait_tx_reply(mstb, txmsg); - if (ret > 0 && txmsg->reply.reply_type =3D=3D DP_SIDEBAND_REPLY_NAK) - ret =3D -EIO; + if (ret > 0) { + if (txmsg->reply.reply_type =3D=3D DP_SIDEBAND_REPLY_NAK) + ret =3D -EIO; + else + ret =3D size; + } =20 kfree(txmsg); fail_put: --=20 2.25.3