Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1529125imu; Thu, 13 Dec 2018 17:28:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/We6xqLSecMqJeeBs7JK3xeR5FZFxeoRwLNZulqQTjvh39eXpq2gPaIFmQbZbXMNln9yr92 X-Received: by 2002:a17:902:e085:: with SMTP id cb5mr1050535plb.24.1544750926330; Thu, 13 Dec 2018 17:28:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544750926; cv=none; d=google.com; s=arc-20160816; b=opdCzw/9AMZ7vdtjHrfpY6id8ryapDAreLgh/dhEuCIZMCxuWcsir6dl6pVG/SfFtU dctiIyESrQdDz04yaizSBHpEJVZXp9VSwa5Zm5qYiWoX8exC7MtpvBN3VCDO55DXP3t/ OjbDtOfm5DNVoqNruQme9AGERRq3xJD5oJ5pmqP0X3lBEbdWcVwL493XU50fY0TKESPZ bdTDXVKBcLRN8qZn4IqqIUKMpMLvhkxpsvrG4r0CAyFyS4AThNIwofcXfFm57L19YS68 izA21Gn2gzmXgnZjTo70v5TbJ3lbP+cwOmlRtXcPE4YXvGKiaRVxN0OPRCMHCEHTdCX+ Kxxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=S2hsTtXIhMUd4WBrxVR2Hc3I0SPQQV5X0f8xN0RnVZc=; b=hDwSX0GNrneYH1AXffGI4iGVBWLuvBL44LiQwBhqhicj+7+WJpmFPHm2JyvnveGR+7 532cBzdffeU8zdW4S/xVascfLN6z6EoZtPZlEEN2F+LUDBwJTsR9AR637mLMI4Cx/Gn6 +M/MhbdwxbrTF63eGhUefdYYl4/v97/WrWdBamrodBfP+ZMt6vtC9IdvZG88IF0k/oZg nCIihczoCzDw1WMMARaEWhY/C4LfvSH6cf1PFlKQ9pk+0GfY9weHuEa1P/5GBRkIUUmt oxtvWen76MvDgUZ8XznHSS6B/ToOLWcrFdlBSG1tOYlDVzEY1j62sFdFaMrRv8FnEDBo S8fw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3si2652559plk.424.2018.12.13.17.28.31; Thu, 13 Dec 2018 17:28:46 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729520AbeLNB1B (ORCPT + 99 others); Thu, 13 Dec 2018 20:27:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38692 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729377AbeLNB0p (ORCPT ); Thu, 13 Dec 2018 20:26:45 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A530230001E1; Fri, 14 Dec 2018 01:26:44 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-11.bss.redhat.com [10.20.1.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 446EF6012B; Fri, 14 Dec 2018 01:26:43 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Cc: Daniel Vetter , Dave Airlie , Harry Wentland , Jerry Zuo , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , linux-kernel@vger.kernel.org Subject: [WIP PATCH 06/15] drm/i915: Keep malloc references to MST ports Date: Thu, 13 Dec 2018 20:25:35 -0500 Message-Id: <20181214012604.13746-7-lyude@redhat.com> In-Reply-To: <20181214012604.13746-1-lyude@redhat.com> References: <20181214012604.13746-1-lyude@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 14 Dec 2018 01:26:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org So that the ports stay around until we've destroyed the connectors, in order to ensure that we don't pass an invalid pointer to any MST helpers once we introduce the new MST VCPI helpers. Signed-off-by: Lyude Paul --- drivers/gpu/drm/i915/intel_connector.c | 4 ++++ drivers/gpu/drm/i915/intel_dp_mst.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_connector.c b/drivers/gpu/drm/i915/intel_connector.c index 18e370f607bc..37d2c644f4b8 100644 --- a/drivers/gpu/drm/i915/intel_connector.c +++ b/drivers/gpu/drm/i915/intel_connector.c @@ -95,6 +95,10 @@ void intel_connector_destroy(struct drm_connector *connector) intel_panel_fini(&intel_connector->panel); drm_connector_cleanup(connector); + + if (intel_connector->port) + drm_dp_mst_put_port_malloc(intel_connector->port); + kfree(connector); } diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index f05427b74e34..4d6ced34d465 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c @@ -484,6 +484,8 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo if (ret) goto err; + drm_dp_mst_get_port_malloc(port); + return connector; err: -- 2.19.2