Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2920250ybz; Mon, 27 Apr 2020 07:00:40 -0700 (PDT) X-Google-Smtp-Source: APiQypKHGmCXQb9YlI3LOgICjbOiVwB+Iu4L1GfWi7sWmnI4elj7eZ/YZHdidAAmOIzkAyke2yXA X-Received: by 2002:a50:f390:: with SMTP id g16mr17964680edm.211.1587996040749; Mon, 27 Apr 2020 07:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587996040; cv=none; d=google.com; s=arc-20160816; b=he2tje2N8Lphx2p0GL/jnK5V+fmHfIvwqEZdQmWXD+6Hj6Ss4tUeJAxzkS6jqlQ1F4 bnwzqkz2hLp8ju5qi4XuCGWcESgKj7P640ZDltTwkuZJDkA4+MrGrGg0EDshOdripQZK ZTEgtYsn4W21NBGONFsHPdE5HZIYDq2WLuRsMnufF210tDp3lnx8zT2zInppRMouzXWC 6jqffwTBMk3WMQdFr1IRIZSzrPri/OnTbMQyAmPlwUd4HLW0EKIdRwkW45zilHrYl/gT LVMXou2nPoJBv8u0kuVBd2hxUvijIV8PuljZENDGfENd8kl5RxMfO/0q758j2rqR7npf 03cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=31DWhMiN+Q5O8LjX9FMcdqbPtRnIZ8bro6sPXS/U7gw=; b=SW6wljMKRUSrskVFhVgktrZ4rrvgXuF3jP1VGdTvBXKU0ay14Lf2NaUOHLueLqTxlS G8andJPADyeIt7O+qc+0v6o0xiTAE/KMKoKRktqiAYW+08nkOtZQY5ccFl0QgAfuc/aA US4D9bj6KHsVR/CZ+8R7zLKkq0UwizqjrTFXv3Ie1DcQfX+WPFf+jPKGGmbh5TXVjQwy wgNgsUQEcnZda1jFv+9G8OpRrBLinl5m2kXlOMg34kkWj9EkMemkzgpsxUi/RrPYbCTL eBfW55QtAUAO5F6d1gvNrhLhV3XKt5/a0joCmfQlGQnrc6NqlVcBL1bQR79998I7rhxv qD9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=LxE9mN4V; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c13si8988761edq.97.2020.04.27.07.00.16; Mon, 27 Apr 2020 07:00:40 -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=@poorly.run header.s=google header.b=LxE9mN4V; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727894AbgD0N6p (ORCPT + 99 others); Mon, 27 Apr 2020 09:58:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726769AbgD0N6o (ORCPT ); Mon, 27 Apr 2020 09:58:44 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28B52C0610D5 for ; Mon, 27 Apr 2020 06:58:43 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id i19so18892908ioh.12 for ; Mon, 27 Apr 2020 06:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=31DWhMiN+Q5O8LjX9FMcdqbPtRnIZ8bro6sPXS/U7gw=; b=LxE9mN4VwaFVH57j3DYncmgT6q+BaAcbSPQZswe7GpeID08ZumAd+p0uqp6MtY2llf B8HP4bFZ1bUIcHZVucZQdFyjcemKxpDDwtAkVsIZ4DXVUdkHAISXUgWEdM/UIjQ9XVd2 Ap0vnBhtIbKfI8XNL3QQI0WPkHjJzU6+7aboB8spaFwDDAA53eOA1TwKeOlWh34YwbLE 5wLIUS05PU9Y1K9jxQ7OYBt2b/tCb/qkL095S3oG4ym4KZW0SM5/ROQlnNescBqTaYYa C1gG0/OvJOIihTHWTbsKNGvnGx8GVkBjZT2DuaCdci6le78e13ERfMt8XIjWqlFu4W/1 oiLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=31DWhMiN+Q5O8LjX9FMcdqbPtRnIZ8bro6sPXS/U7gw=; b=EZ4HlWHxUXbJYpRDJfyCYBQH+DYVyODCYFj2fKMfu9kFr2mgORJsi706yqNhrDWY6k VDC/t9gnM6hLAVC2oGOhenJlDTkbrcDIKNPtFA6+HgIJxUzzYrK9UJrNJJtJjrD0xAAa Hp2iCs1sEVZX6OaIdfkQNGZdmMkUB3JZ6z+taAsrDOWgZgXA/1EofDU74JCgoVBxy8tM AAbtAEfg2vXBlhIzzJVK4x7Lidk9kJz4AuxE3swkFsgGpTnuIAYUYTmCRdI9th/Uh0aw UqLHVBcjGB5+KmXuTyV2GHop7vTJNzI44CJyqaFqj395Gmkrvn8/epmFyB3+F56eGmLc Tubw== X-Gm-Message-State: AGi0PubfFGze1rkvsKGpXnqru+YmAVxcVZA3bpux6cWO087wrPeHd4Fz JnYbRJfvoCCrNSBLD6QuJnk+XgIru+ArLfa1bgAhZA== X-Received: by 2002:a05:6602:2e0b:: with SMTP id o11mr20489781iow.94.1587995922530; Mon, 27 Apr 2020 06:58:42 -0700 (PDT) MIME-Version: 1.0 References: <20200424190722.775284-1-lyude@redhat.com> In-Reply-To: <20200424190722.775284-1-lyude@redhat.com> From: Sean Paul Date: Mon, 27 Apr 2020 09:58:06 -0400 Message-ID: Subject: Re: [PATCH] drm/dp_mst: Fix drm_dp_send_dpcd_write() return code To: Lyude Paul Cc: dri-devel , Benjamin Gaignard , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 24, 2020 at 3:07 PM Lyude Paul wrote: > > 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=1 warnings") > Cc: Benjamin Gaignard > Cc: Sean Paul Reviewed-by: 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_mst_topology_mgr *mgr, > drm_dp_queue_down_tx(mgr, txmsg); > > ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); > - if (ret > 0 && txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) > - ret = -EIO; > + if (ret > 0) { > + if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) > + ret = -EIO; > + else > + ret = size; > + } > > kfree(txmsg); > fail_put: > -- > 2.25.3 >