From patchwork Mon Aug 27 08:07:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10576601 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3315C1390 for ; Mon, 27 Aug 2018 08:07:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F08A298C4 for ; Mon, 27 Aug 2018 08:07:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12D8A298D5; Mon, 27 Aug 2018 08:07:48 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham 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 CC969298C4 for ; Mon, 27 Aug 2018 08:07:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F5816E1ED; Mon, 27 Aug 2018 08:07:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb1-smtp-cloud8.xs4all.net (lb1-smtp-cloud8.xs4all.net [194.109.24.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 183606E077; Mon, 27 Aug 2018 08:07:44 +0000 (UTC) Received: from [IPv6:2001:983:e9a7:1:8960:b49d:3b62:6d25] ([IPv6:2001:983:e9a7:1:8960:b49d:3b62:6d25]) by smtp-cloud8.xs4all.net with ESMTPA id uCYofy11eoj71uCYpfrUUe; Mon, 27 Aug 2018 10:07:43 +0200 Subject: [PATCHv2 3/5] drm_dp_mst_topology: fix broken drm_dp_sideband_parse_remote_dpcd_read() From: Hans Verkuil To: linux-media@vger.kernel.org References: <20180827075820.41109-1-hverkuil@xs4all.nl> <20180827075820.41109-3-hverkuil@xs4all.nl> Message-ID: Date: Mon, 27 Aug 2018 10:07:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180827075820.41109-3-hverkuil@xs4all.nl> Content-Language: en-US X-CMAE-Envelope: MS4wfDGAVCl/LPUxVgU3OzgHSH6GmI+fR6I3WcaFLRtuhMkuPv5/+xZjwQuqahux4PwftUqLuEZ5ieSVImXqSk/aAo/hVl8jNIrdl3J4tFCGYEENdoHCH3lS mg8JBbVUe1Y/f55fuQSqNAf4RGCuvEYjwBjN9pz4oO6CztWfqTJOwKOYwKt5TDs+UVM/N3FpuJLzUcTBYZYYv5oKdiIUdtf7Xxe10UN1PcAZ7QBOEL8186lx ygVGZbKhrFjUhnN2Yobp6huf2laL8MN+LSiJ7WKI44fFdhmqXhPJGzpw/Cn+4TN/NeE1auGfkrIGONXunhvKrHMlM28PCYGKObpr/cObvBZXN76QEB0NSgt4 MlE5w+HaZo3Lisu0nE8RySdm46Zb3w2+DmNY+wz+lZUTpLtJJh+of8YZbRagGBhbfAjgaDCVvh7+XovgmUCaAX1zYrLEEg== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Hans Verkuil , Maling list - DRI developers , amd-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When parsing the reply of a DP_REMOTE_DPCD_READ DPCD command the result is wrong due to a missing idx increment. This was never noticed since DP_REMOTE_DPCD_READ is currently not used, but if you enable it, then it is all wrong. Signed-off-by: Hans Verkuil Reviewed-by: Lyude Paul Acked-by: Alex Deucher --- drivers/gpu/drm/drm_dp_mst_topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 7780567aa669..5ff1d79b86c4 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -439,6 +439,7 @@ static bool drm_dp_sideband_parse_remote_dpcd_read(struct drm_dp_sideband_msg_rx if (idx > raw->curlen) goto fail_len; repmsg->u.remote_dpcd_read_ack.num_bytes = raw->msg[idx]; + idx++; if (idx > raw->curlen) goto fail_len;