Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp471248yba; Wed, 15 May 2019 04:43:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUH2VZ46zdpmcYDFWxc4rsDNjJ11we6P/v/WK+7La/ycDNC1JAs9IvuXxGCYp7mLB5CkZt X-Received: by 2002:a63:7c55:: with SMTP id l21mr19350332pgn.121.1557920596663; Wed, 15 May 2019 04:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920596; cv=none; d=google.com; s=arc-20160816; b=DAB2woqcF/sTkZdHPWLQkRgP8XKtgYNsT+PXEOgrpLABb/YVwTQbAvTbgjDeRzAQtP +2cmNBCutexhIc5LLLIIFIpNWAE/DpcRalUG/RjRWRmgem6lkOYv5cJyXLh5RqTXJ/KI tudChlwvGPSS3mYWqAXNfPVQUz1Np3PVo8cR1ROXwxce2n8vLF3jNjRtZpdkOGI1krKA IFNdgoo5n5QICflPkn5u+4cSOX5GkTqbUK8NFpRL1LAyQa+xEDNCbl/cFSZIKxsmeeVS m6fBPy9y0YxYeEYurIMz1HxvNkYudcgnTePNr6yywXBwoJlXrN576+MsLhYBG78t8JaF oFkA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=99GZtez2DPzEX/e9IseeMDsOYmZGHSh3dfBR3+6B1V8=; b=DmVdprrNJotRDDdziAiO1tJ0Kz9Iu3be2bBRhTEBAi4XYuHHq0/4JJANgG0+sVHRGC Qnqu0SzOQYey0pyxlTbDAqXat2WvNTfPuDPEWrz7NiUrUzWm72vYrLTNoLf37BFqh6iD 1Uu7DKdVw8wzsCFTTIIByUdDfUWf7VjYOrRFv41r7on8/vrMzZmoqZ8Hfg6pjyNO3kGv y2OCvSHR1O6yXBSkawtz/Nu6TqfE5NkVkXdHW1aY4fmL2wR/rqOOi+XYn0f0uANr+wEl leeJVXDcAQVxSYzUGzqxfc2rrMIFVUwbxu0zPsfSqcdiUibi89UOLjrQ9riGPp7MFhGM A/Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QC3RyL28; 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 w24si1529421plq.297.2019.05.15.04.43.02; Wed, 15 May 2019 04:43:16 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QC3RyL28; 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 S1732596AbfEOL3h (ORCPT + 99 others); Wed, 15 May 2019 07:29:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:40854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732589AbfEOL3e (ORCPT ); Wed, 15 May 2019 07:29:34 -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 BB8532084F; Wed, 15 May 2019 11:29:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919773; bh=v8BRTtexhoVzCszqy58/ROLv4LafHU1CamMNCenkLbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QC3RyL28RPpMMFwl8gdt4jaDNyIezOlP15BXWBXSKP5O3X+H1nqz3CddggpIXyJcn QcFKu6NVrZIAE6S+erqnycwIEFv+tWJUhk/w84himixw1VGCQv6QbFk/PDlWi3bdR0 jbYkAbZraqebvj82wnHObi/50KCT56C3n8Y6GE7U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Kocialkowski , Chen-Yu Tsai , Sasha Levin Subject: [PATCH 5.0 089/137] drm/sun4i: Unbind components before releasing DRM and memory Date: Wed, 15 May 2019 12:56:10 +0200 Message-Id: <20190515090659.985825905@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit e02bc29b2cfa7806830d6da8b2322cddd67e8dfe ] Our components may still be using the DRM device driver (if only to access our driver's private data), so make sure to unbind them before the final drm_dev_put. Also release our reserved memory after component unbind instead of before to match reverse creation order. Fixes: f5a9ed867c83 ("drm/sun4i: Fix component unbinding and component master deletion") Signed-off-by: Paul Kocialkowski Reviewed-by: Chen-Yu Tsai Link: https://patchwork.freedesktop.org/patch/msgid/20190424090413.6918-1-paul.kocialkowski@bootlin.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/sun4i/sun4i_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 9a5713fa03b25..f8bf5bbec2df3 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -146,10 +146,11 @@ static void sun4i_drv_unbind(struct device *dev) drm_dev_unregister(drm); drm_kms_helper_poll_fini(drm); drm_mode_config_cleanup(drm); - of_reserved_mem_device_release(dev); - drm_dev_put(drm); component_unbind_all(dev, NULL); + of_reserved_mem_device_release(dev); + + drm_dev_put(drm); } static const struct component_master_ops sun4i_drv_master_ops = { -- 2.20.1