Received: by 10.192.165.148 with SMTP id m20csp4145264imm; Mon, 30 Apr 2018 12:36:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrg/lVwsfR6Tp4R4BV2BPSmNM12Y54rODEkw4xxadGD5K8oHrncH4h+4CLJXbriz7QMG2dg X-Received: by 10.98.249.9 with SMTP id o9mr7396127pfh.256.1525116978869; Mon, 30 Apr 2018 12:36:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525116978; cv=none; d=google.com; s=arc-20160816; b=HDiqzhN3ivdAhF/6yPI43l8V3uv/pvzCIBiJhgjai6tJq9wVsKKD4IOsUY0ymxRiKZ tMVD3StL6JylnC6kE4bWin5fKOmK57mhjOfsdCi3NZ3aiutWs4wGWLthOVTRCwVbkVGT x6G0Yifb/Q3zd6wt7W+t3UiDFM0fTCP5eRS5zMrH/r1wmwZgEI+5IfB3Bzq2VBOZ6dUr OC8pER808aUJ7iP3Bt5gpw3GnK4Lvzrxt9X6XUXv+iK3n6t0IP1/ODln2kjiuV6mx9Yi QtUbCc1d883hifYQ4Ad3WawI1xDreTtBBOa1yDjcA7chFU4QljMuSqA61D/cgwIyksZT LFdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=ljBc5jdW2RvKl08Ae5c3ViUSTA2GyrCfzKcEQS8ATgo=; b=V1FXyP7ECGVXvIwdp1iI0VaP2jV5E9QBCzJurCz0KIUpjlad92CfO9hncxajKfslYZ HWARL+mjjATVuJMGFfBk6r2lbbm36nCSz12pD1Bab2HAinFJqv8GLNIT4Hf63xZ5w8w7 TeZPTf78EyP9G0sXTfukPNrGKoIIeJIdmD3ASqtjC3hYKUBescwnOibLCCD5j1KsEy6I y/YWzwxW7R+8H1ZQFLbtV3ByRNV9EKuulxyHe9qjVB0Ve7r2Wo5J58MXcerHwSwqtplT 7eDxXcTEWgi8gkeGTReoxx1uYcLbM2yXj/3PoevfbCBMrCTEO/Sm5rqr86uINNPgMrYy DSjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11-v6si8214836plt.284.2018.04.30.12.36.04; Mon, 30 Apr 2018 12:36:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756615AbeD3TeO (ORCPT + 99 others); Mon, 30 Apr 2018 15:34:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:37138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755980AbeD3T2x (ORCPT ); Mon, 30 Apr 2018 15:28:53 -0400 Received: from localhost (unknown [104.132.1.102]) (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 5F50F22DCC; Mon, 30 Apr 2018 19:28:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F50F22DCC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harry Wentland , Tony Cheng , Alex Deucher Subject: [PATCH 4.16 104/113] drm/amd/display: Dont read EDID in atomic_check Date: Mon, 30 Apr 2018 12:25:15 -0700 Message-Id: <20180430184019.596757596@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Harry Wentland commit c7b8de00384be49dc1617a838b0ce89a0235f319 upstream. We shouldn't attempt to read EDID in atomic_check. We really shouldn't even be modifying the connector object, or any other non-state object, but this is a start at least. Moving EDID cleanup to dm_dp_mst_connector_destroy from dm_dp_destroy_mst_connector to ensure the EDID is still available for headless mode. Signed-off-by: Harry Wentland Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 32 +++--------- 1 file changed, 10 insertions(+), 22 deletions(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -157,6 +157,11 @@ dm_dp_mst_connector_destroy(struct drm_c struct amdgpu_dm_connector *amdgpu_dm_connector = to_amdgpu_dm_connector(connector); struct amdgpu_encoder *amdgpu_encoder = amdgpu_dm_connector->mst_encoder; + if (amdgpu_dm_connector->edid) { + kfree(amdgpu_dm_connector->edid); + amdgpu_dm_connector->edid = NULL; + } + drm_encoder_cleanup(&amdgpu_encoder->base); kfree(amdgpu_encoder); drm_connector_cleanup(connector); @@ -183,28 +188,22 @@ static int dm_connector_update_modes(str void dm_dp_mst_dc_sink_create(struct drm_connector *connector) { struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector); - struct edid *edid; struct dc_sink *dc_sink; struct dc_sink_init_data init_params = { .link = aconnector->dc_link, .sink_signal = SIGNAL_TYPE_DISPLAY_PORT_MST }; + /* FIXME none of this is safe. we shouldn't touch aconnector here in + * atomic_check + */ + /* * TODO: Need to further figure out why ddc.algo is NULL while MST port exists */ if (!aconnector->port || !aconnector->port->aux.ddc.algo) return; - edid = drm_dp_mst_get_edid(connector, &aconnector->mst_port->mst_mgr, aconnector->port); - - if (!edid) { - drm_mode_connector_update_edid_property( - &aconnector->base, - NULL); - return; - } - - aconnector->edid = edid; + ASSERT(aconnector->edid); dc_sink = dc_link_add_remote_sink( aconnector->dc_link, @@ -217,9 +216,6 @@ void dm_dp_mst_dc_sink_create(struct drm amdgpu_dm_add_sink_to_freesync_module( connector, aconnector->edid); - - drm_mode_connector_update_edid_property( - &aconnector->base, aconnector->edid); } static int dm_dp_mst_get_modes(struct drm_connector *connector) @@ -426,14 +422,6 @@ static void dm_dp_destroy_mst_connector( dc_sink_release(aconnector->dc_sink); aconnector->dc_sink = NULL; } - if (aconnector->edid) { - kfree(aconnector->edid); - aconnector->edid = NULL; - } - - drm_mode_connector_update_edid_property( - &aconnector->base, - NULL); aconnector->mst_connected = false; }