From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3E525674A; Mon, 22 Jan 2024 14:58:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935517; cv=none; b=qu/EfkaoCIdVpOjAxf3QkHGHJ9ODhtcT4NYKKs3v3+H3/RlP7igA2ieI77S8omh7IQRTeaSNtdZ95Wpo0kEup5ENcZQ0m4x1/qGvxn26PU04maxgWZ7wnMYsh1WqZN3IyXbE/rmcuth3sDQ4FreDbZIRPG+ucQ+Kz6ocZXsKFrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935517; c=relaxed/simple; bh=jtO6UF+XHw8oFtbNzzs5I5mOWLfh1gzjsh/xhUz5oy4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L+KxqsubjQ+6k16Rl5H1T6ghh2K+55fSsEAAtpQCFbSwcpi/s9CGabXxkl2V3WMb0RW1RTZgVe4kBZsTmrfFIbpbHwQ0pgZEhOuuGNJavli4jmhxZN0nLKfVCvlQwoB83wfjhyG7iJcH1vBKNjwlFxaymHQ35BaqhQGLSf0taqg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f0JsRr0G; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f0JsRr0G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 890CCC43394; Mon, 22 Jan 2024 14:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935517; bh=jtO6UF+XHw8oFtbNzzs5I5mOWLfh1gzjsh/xhUz5oy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f0JsRr0GzwEy5Zb2C2Zf0zXfYjVQBaZNqJUkduf1vP0RJgxYT10ODilV5kY4FwCDZ NSyIEM/Q9pIFwgaRYJDyqIm74Usx8jLzm1ECHKzrHbIIIdkG901mMH03RAbnZlDv6+ g9ODKkluxI2mHEyFG67eiPs3bmfH6n2wOlSxEluGf/mCq5iT4Rl/DIuVymGQRQKX/n NX2tO7Ua1ZxhUGEw16BWf7uINnThJ/kj+Jl4tJT523DyJznmy+5YvOYvh3lAojjX/k rftqUqnfVywzWbPLzuv9TY7YMfhPE/uLlNmxmnIvKocveu7kU49LKqiPVRqAHG/+Ug okn/1hD8ZB4LA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Douglas Anderson , Maxime Ripard , Marek Szyprowski , Inki Dae , Sasha Levin , sw0312.kim@samsung.com, kyungmin.park@samsung.com, airlied@gmail.com, daniel@ffwll.ch, krzysztof.kozlowski@linaro.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH AUTOSEL 6.7 44/88] drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time Date: Mon, 22 Jan 2024 09:51:17 -0500 Message-ID: <20240122145608.990137-44-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 Content-Transfer-Encoding: 8bit From: Douglas Anderson [ Upstream commit 16ac5b21b31b439f03cdf44c153c5f5af94fb3eb ] Based on grepping through the source code this driver appears to be missing a call to drm_atomic_helper_shutdown() at system shutdown time and at driver unbind time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart and at driver remove (or unbind) time comes straight out of the kernel doc "driver instance overview" in drm_drv.c. A few notes about this fix: - When adding drm_atomic_helper_shutdown() to the unbind path, I added it after drm_kms_helper_poll_fini() since that's when other drivers seemed to have it. - Technically with a previous patch, ("drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop"), we don't actually need to check to see if our "drm" pointer is NULL before calling drm_atomic_helper_shutdown(). We'll leave the "if" test in, though, so that this patch can land without any dependencies. It could potentially be removed later. - This patch also makes sure to set the drvdata to NULL in the case of bind errors to make sure that shutdown can't access freed data. Suggested-by: Maxime Ripard Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson Tested-by: Marek Szyprowski Reviewed-by: Marek Szyprowski Signed-off-by: Inki Dae Signed-off-by: Sasha Levin --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 8399256cb5c9..5380fb6c55ae 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -300,6 +300,7 @@ static int exynos_drm_bind(struct device *dev) drm_mode_config_cleanup(drm); exynos_drm_cleanup_dma(drm); kfree(private); + dev_set_drvdata(dev, NULL); err_free_drm: drm_dev_put(drm); @@ -313,6 +314,7 @@ static void exynos_drm_unbind(struct device *dev) drm_dev_unregister(drm); drm_kms_helper_poll_fini(drm); + drm_atomic_helper_shutdown(drm); component_unbind_all(drm->dev, drm); drm_mode_config_cleanup(drm); @@ -350,9 +352,18 @@ static int exynos_drm_platform_remove(struct platform_device *pdev) return 0; } +static void exynos_drm_platform_shutdown(struct platform_device *pdev) +{ + struct drm_device *drm = platform_get_drvdata(pdev); + + if (drm) + drm_atomic_helper_shutdown(drm); +} + static struct platform_driver exynos_drm_platform_driver = { .probe = exynos_drm_platform_probe, .remove = exynos_drm_platform_remove, + .shutdown = exynos_drm_platform_shutdown, .driver = { .name = "exynos-drm", .pm = &exynos_drm_pm_ops, -- 2.43.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E326AC47DAF for ; Mon, 22 Jan 2024 16:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v3m+9JXpvvvilYvLPW6T0yHB2KdgMNrvM58+8Rr7LxU=; b=j+BlXX48XainQ5 +sP5ALSI+CF6SDziDsCRI2PArjEf9QpXk1Av3XH322pNE2snfXmTtokqTesl+ovj9uNTmHGvOKTk9 kkOEE7LMeZgLp9XLP6OfY2Y4z2Hn+IaQWQ/REG7Gop1o/+9ypmC8ITF52HveSR7i6ZSUXif/eaEAO pKSwTcpw9OzjHr5dFo8410fnaEUV5dlM/XS6GatM2QdpSAWjjJQ1vidDaUBeZEPIKrfFj5UM3cy18 jIpHNCmFtbIGP/fSKuCIhGtiHSmRCdJx7sjBnTpNlQQJdVxk/CgQ5goICYJ3DhUd49QAgfGpPlfPf +PRQMVPw7H2l6Q3bm2yQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rRwio-00CqZb-30; Mon, 22 Jan 2024 16:00:26 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rRvlY-00CX7s-34 for linux-arm-kernel@bombadil.infradead.org; Mon, 22 Jan 2024 14:59:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=s5ioWc/MMu+1cVhk2vVkE95v/ejOpm7SpaOVZyV3HJk=; b=C3IjCLutwA+PuYraGiCH7xCUXF C1DjRiSCUj3pJRAXCP/Wlgxq9t11G+xPXwXqAAwM9CUDZQ8JHR8fooYbzvL95O6c/5aVmHs1v6+KJ pHxhb1wn5LDRWRBOMDrtzM+xWeU1Wf4Fk8l+UjuWQn88EvLvUWf15ujBeu3MFi44fuNdV538cKmxr ubuXecgTDKYvIRfD022948F15tDfyfh4m249mk3uin+JgUlJfrumKDn2EJThm1h6dd4aPYnPdRlkF k4oetldluHm+EkcIkne7fhxATXRK/EUT6FNbhDImWRTohHY4btP29ktWkw5ecvdB6zGC65IiwCYdC sFH4jK+g==; Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rRvlV-00000003LQ9-0vSn for linux-arm-kernel@lists.infradead.org; Mon, 22 Jan 2024 14:59:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5B203611C5; Mon, 22 Jan 2024 14:58:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 890CCC43394; Mon, 22 Jan 2024 14:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935517; bh=jtO6UF+XHw8oFtbNzzs5I5mOWLfh1gzjsh/xhUz5oy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f0JsRr0GzwEy5Zb2C2Zf0zXfYjVQBaZNqJUkduf1vP0RJgxYT10ODilV5kY4FwCDZ NSyIEM/Q9pIFwgaRYJDyqIm74Usx8jLzm1ECHKzrHbIIIdkG901mMH03RAbnZlDv6+ g9ODKkluxI2mHEyFG67eiPs3bmfH6n2wOlSxEluGf/mCq5iT4Rl/DIuVymGQRQKX/n NX2tO7Ua1ZxhUGEw16BWf7uINnThJ/kj+Jl4tJT523DyJznmy+5YvOYvh3lAojjX/k rftqUqnfVywzWbPLzuv9TY7YMfhPE/uLlNmxmnIvKocveu7kU49LKqiPVRqAHG/+Ug okn/1hD8ZB4LA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Douglas Anderson , Maxime Ripard , Marek Szyprowski , Inki Dae , Sasha Levin , sw0312.kim@samsung.com, kyungmin.park@samsung.com, airlied@gmail.com, daniel@ffwll.ch, krzysztof.kozlowski@linaro.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH AUTOSEL 6.7 44/88] drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time Date: Mon, 22 Jan 2024 09:51:17 -0500 Message-ID: <20240122145608.990137-44-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240122_145909_604300_A20DF552 X-CRM114-Status: GOOD ( 19.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Douglas Anderson [ Upstream commit 16ac5b21b31b439f03cdf44c153c5f5af94fb3eb ] Based on grepping through the source code this driver appears to be missing a call to drm_atomic_helper_shutdown() at system shutdown time and at driver unbind time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart and at driver remove (or unbind) time comes straight out of the kernel doc "driver instance overview" in drm_drv.c. A few notes about this fix: - When adding drm_atomic_helper_shutdown() to the unbind path, I added it after drm_kms_helper_poll_fini() since that's when other drivers seemed to have it. - Technically with a previous patch, ("drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop"), we don't actually need to check to see if our "drm" pointer is NULL before calling drm_atomic_helper_shutdown(). We'll leave the "if" test in, though, so that this patch can land without any dependencies. It could potentially be removed later. - This patch also makes sure to set the drvdata to NULL in the case of bind errors to make sure that shutdown can't access freed data. Suggested-by: Maxime Ripard Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson Tested-by: Marek Szyprowski Reviewed-by: Marek Szyprowski Signed-off-by: Inki Dae Signed-off-by: Sasha Levin --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 8399256cb5c9..5380fb6c55ae 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -300,6 +300,7 @@ static int exynos_drm_bind(struct device *dev) drm_mode_config_cleanup(drm); exynos_drm_cleanup_dma(drm); kfree(private); + dev_set_drvdata(dev, NULL); err_free_drm: drm_dev_put(drm); @@ -313,6 +314,7 @@ static void exynos_drm_unbind(struct device *dev) drm_dev_unregister(drm); drm_kms_helper_poll_fini(drm); + drm_atomic_helper_shutdown(drm); component_unbind_all(drm->dev, drm); drm_mode_config_cleanup(drm); @@ -350,9 +352,18 @@ static int exynos_drm_platform_remove(struct platform_device *pdev) return 0; } +static void exynos_drm_platform_shutdown(struct platform_device *pdev) +{ + struct drm_device *drm = platform_get_drvdata(pdev); + + if (drm) + drm_atomic_helper_shutdown(drm); +} + static struct platform_driver exynos_drm_platform_driver = { .probe = exynos_drm_platform_probe, .remove = exynos_drm_platform_remove, + .shutdown = exynos_drm_platform_shutdown, .driver = { .name = "exynos-drm", .pm = &exynos_drm_pm_ops, -- 2.43.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5747DC47DAF for ; Mon, 22 Jan 2024 14:59:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5EDD510F2AA; Mon, 22 Jan 2024 14:59:09 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id F38C610F2A3 for ; Mon, 22 Jan 2024 14:59:07 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5B203611C5; Mon, 22 Jan 2024 14:58:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 890CCC43394; Mon, 22 Jan 2024 14:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935517; bh=jtO6UF+XHw8oFtbNzzs5I5mOWLfh1gzjsh/xhUz5oy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f0JsRr0GzwEy5Zb2C2Zf0zXfYjVQBaZNqJUkduf1vP0RJgxYT10ODilV5kY4FwCDZ NSyIEM/Q9pIFwgaRYJDyqIm74Usx8jLzm1ECHKzrHbIIIdkG901mMH03RAbnZlDv6+ g9ODKkluxI2mHEyFG67eiPs3bmfH6n2wOlSxEluGf/mCq5iT4Rl/DIuVymGQRQKX/n NX2tO7Ua1ZxhUGEw16BWf7uINnThJ/kj+Jl4tJT523DyJznmy+5YvOYvh3lAojjX/k rftqUqnfVywzWbPLzuv9TY7YMfhPE/uLlNmxmnIvKocveu7kU49LKqiPVRqAHG/+Ug okn/1hD8ZB4LA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.7 44/88] drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time Date: Mon, 22 Jan 2024 09:51:17 -0500 Message-ID: <20240122145608.990137-44-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , linux-samsung-soc@vger.kernel.org, sw0312.kim@samsung.com, Douglas Anderson , Maxime Ripard , krzysztof.kozlowski@linaro.org, kyungmin.park@samsung.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, airlied@gmail.com, linux-arm-kernel@lists.infradead.org, Marek Szyprowski Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Douglas Anderson [ Upstream commit 16ac5b21b31b439f03cdf44c153c5f5af94fb3eb ] Based on grepping through the source code this driver appears to be missing a call to drm_atomic_helper_shutdown() at system shutdown time and at driver unbind time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart and at driver remove (or unbind) time comes straight out of the kernel doc "driver instance overview" in drm_drv.c. A few notes about this fix: - When adding drm_atomic_helper_shutdown() to the unbind path, I added it after drm_kms_helper_poll_fini() since that's when other drivers seemed to have it. - Technically with a previous patch, ("drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop"), we don't actually need to check to see if our "drm" pointer is NULL before calling drm_atomic_helper_shutdown(). We'll leave the "if" test in, though, so that this patch can land without any dependencies. It could potentially be removed later. - This patch also makes sure to set the drvdata to NULL in the case of bind errors to make sure that shutdown can't access freed data. Suggested-by: Maxime Ripard Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson Tested-by: Marek Szyprowski Reviewed-by: Marek Szyprowski Signed-off-by: Inki Dae Signed-off-by: Sasha Levin --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 8399256cb5c9..5380fb6c55ae 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -300,6 +300,7 @@ static int exynos_drm_bind(struct device *dev) drm_mode_config_cleanup(drm); exynos_drm_cleanup_dma(drm); kfree(private); + dev_set_drvdata(dev, NULL); err_free_drm: drm_dev_put(drm); @@ -313,6 +314,7 @@ static void exynos_drm_unbind(struct device *dev) drm_dev_unregister(drm); drm_kms_helper_poll_fini(drm); + drm_atomic_helper_shutdown(drm); component_unbind_all(drm->dev, drm); drm_mode_config_cleanup(drm); @@ -350,9 +352,18 @@ static int exynos_drm_platform_remove(struct platform_device *pdev) return 0; } +static void exynos_drm_platform_shutdown(struct platform_device *pdev) +{ + struct drm_device *drm = platform_get_drvdata(pdev); + + if (drm) + drm_atomic_helper_shutdown(drm); +} + static struct platform_driver exynos_drm_platform_driver = { .probe = exynos_drm_platform_probe, .remove = exynos_drm_platform_remove, + .shutdown = exynos_drm_platform_shutdown, .driver = { .name = "exynos-drm", .pm = &exynos_drm_pm_ops, -- 2.43.0