Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751650AbdF2WeJ (ORCPT ); Thu, 29 Jun 2017 18:34:09 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:37060 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751333AbdF2WeI (ORCPT ); Thu, 29 Jun 2017 18:34:08 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 760E960794 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 Subject: Re: [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method To: Will Deacon , Robin Murphy , Joerg Roedel , linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <1498774696-16037-1-git-send-email-nwatters@codeaurora.org> From: Nate Watterson Message-ID: Date: Thu, 29 Jun 2017 18:34:05 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1498774696-16037-1-git-send-email-nwatters@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2407 Lines: 72 I should have removed the '-v3' since this revision of the patch adds shutdown to arm-smmu.c as well. I'll fix that in a subsequent version after waiting to see if there are additional changes that need to be made. On 6/29/2017 6:18 PM, Nate Watterson wrote: > 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); > > -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.