From patchwork Sun Aug 5 14:09:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Bergas X-Patchwork-Id: 10556151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6044313AC for ; Sun, 5 Aug 2018 14:11:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F61529886 for ; Sun, 5 Aug 2018 14:11:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 432CB29889; Sun, 5 Aug 2018 14:11:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDF0229886 for ; Sun, 5 Aug 2018 14:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=OkqcGvCaZKmUMimLEs6Fy3GiBsJM6xqd8x+makLLtTY=; b=tMU3sJXKkVYS7vnGajg2mMi2JM 4FENc8bKT9Bg0hTDxbCX50aQ5u9a2X8A7RtgPQOnxiiVrJTPS2+woCSE6UOsY/X5iQgbHQQUimuKD q1w3sV00v/Xvs00tDgLuPX7pnmzAQxVaUjCzkUeGlvTBmwlr6aRGr4EQvj17OkjwG1t/tAn7eioT5 5ZxJYvYSoiQrLLRJMnC30WJW9tot6/3EmgBTWebb138zxxEswKj5PCn6Lclk7eXGX8IU6tslDIqi4 ZRbIoENQt69C0vX+k8NqM4AxCbmeBWeK8PcOxEdtmLbfFqK1vq+0nDjorr/6CzfUQbqmvGBcHL8Dd MiHiEARA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmJkJ-00016q-56; Sun, 05 Aug 2018 14:10:59 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmJkG-00016D-NN for linux-rockchip@lists.infradead.org; Sun, 05 Aug 2018 14:10:58 +0000 Received: by mail-ed1-x541.google.com with SMTP id f23-v6so3826639edr.11 for ; Sun, 05 Aug 2018 07:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2WWuR4xTcP4SYU0l/OmNp8rnqEaqwQZthODjvO9ttn4=; b=ckh50vjsZykmC5LsImBQjtqiKxvfv9VS0e6dXgR4SeEzUapcdRC+KejRKXLktDHTbf 0rROLKRRvk8Xsd0TkAMTARPqiL8tqttKPDmIuXOGT1GswaOKZCxLV4mem2NZSp7iPhcN Brzt6mDmcnVimyPPQf63Z0P4Q3O6zxqRngE5xZpd5FnsALENdg7kAgTFXntDeXwKYtOe YK0iG+lV0xrNyRjyo1lFvJ9brMYienBP3LXO7me0HkCgPw0N36a2xrzr526BA5AfltGs BP/ru6QqDyziQYwwNs6BmQ0NRvTNev+0KYLW9NbIGpCAfQTAbUAOHTgKdzhGYhyBCNWv ZttQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2WWuR4xTcP4SYU0l/OmNp8rnqEaqwQZthODjvO9ttn4=; b=hckMtO7aQ/Wg8LpkT4zdPaTOSlJGBzqmWAS/tIvRIWKEwDfJxwz5tpo4gZ3cxp5R8F BIdu3yF9kGGOmcoGJe8niSjU5MXkVoOmdfN1zYek6zoGYZGSv4SJTPnstp5ZFoR59DDk 4vg4y6FZGTIeD+OIrmINqEnHqC/02vnO5PZ15wKZFE5C2HyGxg7k9ZPW731OoEic4nEW tKKa2Y2zWz4zdNN3+ZBfJaQOlBfLmpsgDDYa8BOczvQA8YuGsg/Wq+Khpw2GXm7ikwW8 ei1f5zMGb9DugQ3CUsGo7VhxchqtF1E8n8AzmSjXlQEb0ua5WrXZ5Pnj27HiwyR5aqjO Qo1Q== X-Gm-Message-State: AOUpUlG0HLqdY2Dv0uvSOIZzOFketsayvm44ElR0rPy2Tq14StNUriKJ 0KtcOq6970FF2bfL42yYK8g= X-Google-Smtp-Source: AAOMgpfq1TAJxVZGjNAK1RemGXQ4U/7X1HvjtN4XFe0o10uqb5cw+t5QfxOmncmL2nXgs38tPpf+/Q== X-Received: by 2002:a50:a305:: with SMTP id 5-v6mr15043368edn.57.1533478244822; Sun, 05 Aug 2018 07:10:44 -0700 (PDT) Received: from localhost.localdomain (80-198-72-241-cable.dk.customer.tdc.net. [80.198.72.241]) by smtp.gmail.com with ESMTPSA id x8-v6sm3993038edr.24.2018.08.05.07.10.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Aug 2018 07:10:44 -0700 (PDT) From: Vicente Bergas To: JeffyChen , Robin Murphy , Heiko Stuebner , Marc Zyngier , Tomasz Figa , linux-rockchip@lists.infradead.org Subject: [PATCH] drm/rockchip: shutdown drm subsystem on shutdown Date: Sun, 5 Aug 2018 16:09:11 +0200 Message-Id: <20180805140911.19205-1-vicencb@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <5B20F5F0.9090101@rock-chips.com> References: <5B20F5F0.9090101@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180805_071056_763031_63E355B1 X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vicente Bergas MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Suggested-by: JeffyChen Suggested-by: Robin Murphy Signed-off-by: Vicente Bergas Tested-by: Vicente Bergas --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index f814d37b1db2..00a06768edb2 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -442,6 +442,14 @@ static int rockchip_drm_platform_remove(struct platform_device *pdev) 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 */ }, @@ -451,6 +459,7 @@ MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ids); 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,