Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp345991ybi; Fri, 7 Jun 2019 09:00:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzk6g+lSkjIVaImc4GodMIAdfeP3Xl6WNHrqY865cytZ/IcwktibOwMnL+d/MpPQePmutN6 X-Received: by 2002:a65:5302:: with SMTP id m2mr3407482pgq.369.1559923225503; Fri, 07 Jun 2019 09:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559923225; cv=none; d=google.com; s=arc-20160816; b=vA18c0gWhPc3spqJDrlPMP2P1HK0m0oSApnYCq2tOgu6PfMHSYCE7TrTlwKnEXAX1C DQ48BvUlwwvf7T1CYSLNEsdEw+2Hxi3nsjGLgc/ZIdCzuwADt+4uJvRpAgVpNk71qHkK 97uee6SY9W5sYrnXAZqu2JycmEPMegLEZ0mXgb4DRWt+FtBhcQUfcPdCoNtxeVOMEsB5 Aj0+y2uDrh4NqdMOrj3HGFur7lFt8f7ZkuNZbvYttI2E0sqGVtJPnvlx+1PDgYaxhA+A FLCMS17Lhhj6kNOfgPXkB7J08K9PvugYMdTFMGswBixWVxe4QNOkIF90V29pCCoowlsC UCwg== 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=TSOAPCxr+Afhoe+YrZgjStfV3qsKAFHEpGe103YsnhA=; b=thdY5TFQn0nn+zMr4CxJZSlA4uL6t69/0YjCKjVkQvmf0q+EGjcb5JqTtYdCUgJCJW cPMFhBKqZYNFNDVFvPfntDahCXZ58hES35DTDrQrwMeug40rRarSmvTyBGDXzpKUupQO xY6PFC+zxp0dKwgxmtHXE2wNd8NFR/zLHgCQxL1TeSfdUcAC9fd+ELdwEepfCYuF4gYX NppAc+m3YThm8nEtpoYhbptuEoX2YY+NULRaCLTuq0RpIEvPzwxklmVsIHtWQXKzdlW4 V0kGUFyMcGNxIlEhXZqfDMhUlzpy7+WYiIFmz8/Ngr+psEfTXRqa55CyMWJQ4i6my1+L cheQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KSgtU2zz; 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 i11si2105394pfa.240.2019.06.07.09.00.08; Fri, 07 Jun 2019 09:00:25 -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=KSgtU2zz; 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 S1730739AbfFGPnC (ORCPT + 99 others); Fri, 7 Jun 2019 11:43:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:53826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730700AbfFGPm4 (ORCPT ); Fri, 7 Jun 2019 11:42:56 -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 EB0292146E; Fri, 7 Jun 2019 15:42:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559922175; bh=3de85AOfx0eQ4s/eIx9LLJEkQ43wcwNNs3tYwmb0X9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KSgtU2zz0WdvKopZ/mkAWLzliWUBOpGyHgGXF95FbBMVqOFyqskDrFdk0CeEorqQs AjEEKO95lfx64XMi8bbwjR4WxrtzDpketwJUIuGtkGqgad755U+RWkuXMOgsgmbdYN M9SofejRrfCEhOhadFt1o0KPst8tzsexbZS23FfI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeffy Chen , Robin Murphy , Marc Zyngier , Brian Norris , Doug Anderson , Vicente Bergas , Heiko Stuebner Subject: [PATCH 4.14 63/69] drm/rockchip: shutdown drm subsystem on shutdown Date: Fri, 7 Jun 2019 17:39:44 +0200 Message-Id: <20190607153855.738108376@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190607153848.271562617@linuxfoundation.org> References: <20190607153848.271562617@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 From: Vicente Bergas commit b8f9d7f37b6af829c34c49d1a4f73ce6ed58e403 upstream. As explained by Robin Murphy: > the IOMMU shutdown disables paging, so if the VOP is still > scanning out then that will result in whatever IOVAs it was using now going > straight out onto the bus as physical addresses. We had a more radical approach before in commit 7f3ef5dedb14 ("drm/rockchip: Allow driver to be shutdown on reboot/kexec") but that resulted in new warnings and oopses on shutdown on rk3399 chromeos devices. So second try is resurrecting Vicentes shutdown change which should achieve the same result but in a less drastic way. Fixes: 63238173b2fa ("Revert "drm/rockchip: Allow driver to be shutdown on reboot/kexec"") Cc: Jeffy Chen Cc: Robin Murphy Cc: Marc Zyngier Cc: Brian Norris Cc: Doug Anderson Cc: stable@vger.kernel.org Suggested-by: JeffyChen Suggested-by: Robin Murphy Signed-off-by: Vicente Bergas [adapted commit message to explain the history] Signed-off-by: Heiko Stuebner Tested-by: Brian Norris Tested-by: Douglas Anderson Acked-by: Marc Zyngier Link: https://patchwork.freedesktop.org/patch/msgid/20190402113753.10118-1-heiko@sntech.de Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -425,6 +425,14 @@ static int rockchip_drm_platform_remove( return 0; } +static void rockchip_drm_platform_shutdown(struct platform_device *pdev) +{ + struct drm_device *drm = platform_get_drvdata(pdev); + + if (drm) + drm_atomic_helper_shutdown(drm); +} + static const struct of_device_id rockchip_drm_dt_ids[] = { { .compatible = "rockchip,display-subsystem", }, { /* sentinel */ }, @@ -434,6 +442,7 @@ MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ static struct platform_driver rockchip_drm_platform_driver = { .probe = rockchip_drm_platform_probe, .remove = rockchip_drm_platform_remove, + .shutdown = rockchip_drm_platform_shutdown, .driver = { .name = "rockchip-drm", .of_match_table = rockchip_drm_dt_ids,