From patchwork Tue May 26 18:53:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225366 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36CABC433E1 for ; Tue, 26 May 2020 19:07:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 119C4208A7 for ; Tue, 26 May 2020 19:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520068; bh=vVCIltNcz/8Jdr774CvbyozkDPjMp8YtsaGVK8ZabrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=YFaO0BhAMMJVJdg7KGjMpZ+b/anIBRz5piaZu9HS3j4xLW2L0Fh9mbNwjV4X4D2Ie loY5W5jpSotQgyDeKd4AXJU4LguIb1dR+Eb0LiEpTJOf9oRPI4kd+NJ4ANqIrYDfZu cP3weDQqhO6KLerKrM6Y3M9XBKS7jXpR8o3pTM/c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391716AbgEZTHm (ORCPT ); Tue, 26 May 2020 15:07:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:36484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390824AbgEZTHl (ORCPT ); Tue, 26 May 2020 15:07:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DAAA720776; Tue, 26 May 2020 19:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520061; bh=vVCIltNcz/8Jdr774CvbyozkDPjMp8YtsaGVK8ZabrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GXP1YY71utGVaHbg0bJcraWdmybeCV86LkQk640SPImMJBqR6KAeqkMuxMgBoxxNa URR6fm8fWn4RViFE4geKyHSaxGi4Qc/Fv8U+0VMXTowlsSoL27camRRbwcQye7/xPE NrjSxgqjXSCzx1odgzXXYbm1HKZqkr3mAxXA0qm4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aurabindo Pillai , Harry Wentland , Alex Deucher , Sasha Levin Subject: [PATCH 5.4 044/111] drm/amd/display: Prevent dpcd reads with passive dongles Date: Tue, 26 May 2020 20:53:02 +0200 Message-Id: <20200526183937.105105322@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183932.245016380@linuxfoundation.org> References: <20200526183932.245016380@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Aurabindo Pillai [ Upstream commit e6142dd511425cb827b5db869f489eb81f5f994d ] [why] During hotplug, a DP port may be connected to the sink through passive adapter which does not support DPCD reads. Issuing reads without checking for this condition will result in errors [how] Ensure the link is in aux_mode before initiating operation that result in a DPCD read. Signed-off-by: Aurabindo Pillai Reviewed-by: Harry Wentland Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 99906435dcf7..9f30343262f3 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1422,17 +1422,22 @@ amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector) dc_sink_retain(aconnector->dc_sink); if (sink->dc_edid.length == 0) { aconnector->edid = NULL; - drm_dp_cec_unset_edid(&aconnector->dm_dp_aux.aux); + if (aconnector->dc_link->aux_mode) { + drm_dp_cec_unset_edid( + &aconnector->dm_dp_aux.aux); + } } else { aconnector->edid = - (struct edid *) sink->dc_edid.raw_edid; - + (struct edid *)sink->dc_edid.raw_edid; drm_connector_update_edid_property(connector, - aconnector->edid); - drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux, - aconnector->edid); + aconnector->edid); + + if (aconnector->dc_link->aux_mode) + drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux, + aconnector->edid); } + amdgpu_dm_update_freesync_caps(connector, aconnector->edid); } else {