Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp89697ybz; Fri, 24 Apr 2020 12:18:46 -0700 (PDT) X-Google-Smtp-Source: APiQypKTv5mZX70KNfQf0kLOtYmsO6LkdMyhKtBa80lD5TtVqhcdBRxb7fD87PaoOfNPL9Fh+Evn X-Received: by 2002:aa7:c497:: with SMTP id m23mr8597543edq.155.1587755926707; Fri, 24 Apr 2020 12:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587755926; cv=none; d=google.com; s=arc-20160816; b=J1MYIiQ1mS2wmzJHeiKvmIrC8VwS5PKZEf+tEckGvQ53k/+D69zSNUIxulYOFSoty8 C/6F/0PLCNeRSFzcw7YG2n/AIhVXVxixzr1Ag0eDA4XG9xTquhnJ1lI4Bi25s7hUrE3R 9x3i5890D/e2n3TGOCwwmHOg7G99vZ7igzHHXSbal7hAT8BSeDbRESDzeMLUr3vtKqgD 0Vzjx+8bEInO4p7dreAu2WvLyUsdLKF5VDQwP/mAg7BNErNHRU+cVTFYE819hyLQmGv4 zdzL/jY/JnXHsvE2MsYpE813c+foLYDoWKZUH7xKfRjreOrhMVNMhDmVFaVy5qD/ROhC lTVw== 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=z8C+l34ylQ/fd4X7uZblckP7QFtPAfaKyL9kDot/4z4=; b=NXBrkBoOJ09OK+531WftmjGaI4ceGf6YCU/xFHvkZwr0emA7pdkLKBZ+S3BefUoLCE PiCFP21FqX8+uRgb3vS6ioRnZ/9YZbq0J390/CYIFotHJSHg6YmcbISbVzoymZ9uLza0 6xsN54gq2XZHuMxXOJ7L1DrjIQ374aCOTQFSmePQGVtobZ6o5TKW1c5BGLKNmqKNMTxx ey4esc9Sy4jk56iX5Ih++hiXD7QmK53NCO14znoDk73KvsNAppPQFcfsAcMNot0UrEXg KYSWephdgj8CPOSGha6ci/aH566cImtUZpeccjxkDk3zYl5dtu72cOKRoc289rPKpMLb 1Weg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hfOZcWCA; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q13si3471011eds.115.2020.04.24.12.18.22; Fri, 24 Apr 2020 12:18:46 -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=@gmail.com header.s=20161025 header.b=hfOZcWCA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728950AbgDXTQ3 (ORCPT + 99 others); Fri, 24 Apr 2020 15:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727022AbgDXTQ3 (ORCPT ); Fri, 24 Apr 2020 15:16:29 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AB4CC09B048 for ; Fri, 24 Apr 2020 12:16:28 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id x25so11855559wmc.0 for ; Fri, 24 Apr 2020 12:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z8C+l34ylQ/fd4X7uZblckP7QFtPAfaKyL9kDot/4z4=; b=hfOZcWCALviq/FPpDxJ2lRmuzD2k7d7BdrAIZwQNcD7ZpG6rqG6beBNBN419L9LgHv qWjU1pqWXZMldct5Op1Mhn56WkPAnuYF8iYsZp1LvlJoAtnoR2IX23+YFb4QHUZQySXu Tun26rsYLpcFezcxPqxzfXbSLofJAa4rioAzb3z7A90I9bDLzeN+dvso/uNDAWd+VjYM HRjr0RMi5xnR/T8UmG9WG58ZA0169rBq20xYx13B4msc5HFIBd+4PsZTOzqNP1siOtH6 4++h0v99wy+7hTEm4DrOPbpy9+BPYqg+ZR3W7N72cnOWqgIVBmHxh32mbCDWUHPN6N44 hYgw== 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=z8C+l34ylQ/fd4X7uZblckP7QFtPAfaKyL9kDot/4z4=; b=rxynrPwdrA9OYkEpPLY3VZrtWdOfEXnwhul3BdYfH6VZ6LtV4HmzwKm4DwHP/xA2M1 8s731UsuhSeDI4D6Y+kVLwSYDN3DV8zfHaIc/apVCOtmKJrS3xEMsW+fnvdqDvyRDzWX clgkiv0Eek19gh/2PhTPQ79yRP8OV/P1YaUEEegxdQLc6+rPtr9SDSQFYxMC43E204pZ iG8Y7+bULoFjQZHERLCrvMDyGPQrVtwRfUb7eMs+yux7+V/4G6dUjoQkxzL56QTfW2Gk BEGG6dIB5VBjO+CUyJFNweCYBuT/bkEkPeF2PC1QiPe7HEhhi8Khq1eT976Dr2/0Xo66 BegA== X-Gm-Message-State: AGi0PuYywtO3dubES6WgM8sUFlHrV7WZdYSQ8L8DKwX3SaGbQDOd4ypL WcaTQZKooNW8PHp7U2CBLm/AWwaBeRzDugK9lGEFFw== X-Received: by 2002:a1c:9d8c:: with SMTP id g134mr12074171wme.79.1587755787069; Fri, 24 Apr 2020 12:16:27 -0700 (PDT) MIME-Version: 1.0 References: <20200424190722.775284-1-lyude@redhat.com> In-Reply-To: <20200424190722.775284-1-lyude@redhat.com> From: Alex Deucher Date: Fri, 24 Apr 2020 15:16:15 -0400 Message-ID: Subject: Re: [PATCH] drm/dp_mst: Fix drm_dp_send_dpcd_write() return code To: Lyude Paul Cc: Maling list - DRI developers , Benjamin Gaignard , David Airlie , LKML , Thomas Zimmermann , Sean Paul 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 Acked-by: Alex Deucher > --- > 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 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel