From patchwork Thu Jun 29 22:18:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nate Watterson X-Patchwork-Id: 9818063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 12C76603D7 for ; Thu, 29 Jun 2017 22:23:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 091C227F85 for ; Thu, 29 Jun 2017 22:23:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F13FC28449; Thu, 29 Jun 2017 22:23:29 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 8AA0C27F85 for ; Thu, 29 Jun 2017 22:23:29 +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: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:In-Reply-To: References:List-Owner; bh=M9Rb7gYYZxyJzJQM5DKZIK1uZ475Upoyp6EUogK+lN0=; b=dKT 34O9UxjINiCp7DZagf7DSTddT7rKwLGYl28UejfBR3zz6SrQLVSXvLcGbshCCsUUhhNzg2GS/Zv+R fhMYYtObYaKOaO4Gavfmvk03qcDXf//iAt3uM8KZReY09WMeB5p7punmxQBhUGPQAoKNLcMREfrjD XFMPsh/oYt+/0EMRkzW7B+HXsIKSUehxJaAzYU3kLmyPenUqqBLjHbKyiZhTl07SfoI+XwMpNVK8d BXVsQ9GeROZ7rJmuurDrMqfom1HHnHwJaHT4HMmOmfvsuLCgdb9+BbpZO7Cc49oqJ+G7EY9PEShsj nbqBSZoGwREt7RXKfXEmJlDZ46pGtdw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dQhqQ-0007JR-Lh; Thu, 29 Jun 2017 22:23:26 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dQhqM-0007Gn-IE for linux-arm-kernel@lists.infradead.org; Thu, 29 Jun 2017 22:23:24 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3D85C60DD7; Thu, 29 Jun 2017 22:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1498774982; bh=QRCxFh/CedEVIXx2SGhdzWXLeQXtX+J7qHvQExSjHS8=; h=From:To:Cc:Subject:Date:From; b=FtoUbwPstwYIMbYWDtn2rmDHKHGf/q8uKEsOn5xfsQ34oTHZz1Ak7aUqv2hAazR+J v4q18p4rMSdhRECzSH4z3SJ8ClHXhtA7klDwvKwJBR1dLVIB7iHUD/0mcEg/y1K6rX iNlMLnVfZV7fdVPB1i9QX/L1uf/HR/QH2mw6H7JU= Received: from ssd-mint172.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: nwatters@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D90F660B7F; Thu, 29 Jun 2017 22:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1498774981; bh=QRCxFh/CedEVIXx2SGhdzWXLeQXtX+J7qHvQExSjHS8=; h=From:To:Cc:Subject:Date:From; b=cgT3a5jT5O0YSi/Vj8NKdqDxebdyOpi55Vp9r7o8LeG/82qid62ACDMTzwqWs3oii XcnHBeVzKbqOSSNg530hgUO/cbhSeK6ZoJicYPxyJyVX9LPeOdaOiwCYrfKNIILMBJ 6El/nrPvc85fMeB7EbLiRR/JpV9Dj/4gj29OQFaw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D90F660B7F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=nwatters@codeaurora.org From: Nate Watterson To: Will Deacon , Robin Murphy , Joerg Roedel , linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method Date: Thu, 29 Jun 2017 18:18:15 -0400 Message-Id: <1498774696-16037-1-git-send-email-nwatters@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170629_152322_768894_22C50B90 X-CRM114-Status: GOOD ( 10.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nate Watterson MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The shutdown method disables the SMMU to avoid corrupting a new kernel started with kexec. Signed-off-by: Nate Watterson --- drivers/iommu/arm-smmu-v3.c | 7 +++++++ drivers/iommu/arm-smmu.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 380969a..3d8ac29 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -2765,9 +2765,15 @@ static int arm_smmu_device_remove(struct platform_device *pdev) struct arm_smmu_device *smmu = platform_get_drvdata(pdev); arm_smmu_device_disable(smmu); + return 0; } +static void arm_smmu_device_shutdown(struct platform_device *pdev) +{ + arm_smmu_device_remove(pdev); +} + static struct of_device_id arm_smmu_of_match[] = { { .compatible = "arm,smmu-v3", }, { }, @@ -2781,6 +2787,7 @@ static int arm_smmu_device_remove(struct platform_device *pdev) }, .probe = arm_smmu_device_probe, .remove = arm_smmu_device_remove, + .shutdown = arm_smmu_device_shutdown, }; module_platform_driver(arm_smmu_driver); diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 7ec30b0..af50bab 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2319,6 +2319,11 @@ static int arm_smmu_device_remove(struct platform_device *pdev) return 0; } +static void arm_smmu_device_shutdown(struct platform_device *pdev) +{ + arm_smmu_device_remove(pdev); +} + static struct platform_driver arm_smmu_driver = { .driver = { .name = "arm-smmu", @@ -2326,6 +2331,7 @@ static int arm_smmu_device_remove(struct platform_device *pdev) }, .probe = arm_smmu_device_probe, .remove = arm_smmu_device_remove, + .shutdown = arm_smmu_device_shutdown, }; module_platform_driver(arm_smmu_driver);