All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method
@ 2017-06-29 22:18 ` Nate Watterson
  0 siblings, 0 replies; 9+ messages in thread
From: Nate Watterson @ 2017-06-29 22:18 UTC (permalink / raw)
  To: Will Deacon, Robin Murphy, Joerg Roedel, linux-arm-kernel, iommu,
	linux-kernel
  Cc: Nate Watterson

The shutdown method disables the SMMU to avoid corrupting a new kernel
started with kexec.

Signed-off-by: Nate Watterson <nwatters@codeaurora.org>
---
 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, Inc. on behalf of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux
Foundation Collaborative Project.

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method
@ 2017-06-29 22:18 ` Nate Watterson
  0 siblings, 0 replies; 9+ messages in thread
From: Nate Watterson @ 2017-06-29 22:18 UTC (permalink / raw)
  To: Will Deacon, Robin Murphy, Joerg Roedel,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

The shutdown method disables the SMMU to avoid corrupting a new kernel
started with kexec.

Signed-off-by: Nate Watterson <nwatters-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
---
 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, Inc. on behalf of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux
Foundation Collaborative Project.

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method
@ 2017-06-29 22:18 ` Nate Watterson
  0 siblings, 0 replies; 9+ messages in thread
From: Nate Watterson @ 2017-06-29 22:18 UTC (permalink / raw)
  To: linux-arm-kernel

The shutdown method disables the SMMU to avoid corrupting a new kernel
started with kexec.

Signed-off-by: Nate Watterson <nwatters@codeaurora.org>
---
 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, Inc. on behalf of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux
Foundation Collaborative Project.

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method
@ 2017-06-29 22:34   ` Nate Watterson
  0 siblings, 0 replies; 9+ messages in thread
From: Nate Watterson @ 2017-06-29 22:34 UTC (permalink / raw)
  To: Will Deacon, Robin Murphy, Joerg Roedel, linux-arm-kernel, iommu,
	linux-kernel

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 <nwatters@codeaurora.org>
> ---
>   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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method
@ 2017-06-29 22:34   ` Nate Watterson
  0 siblings, 0 replies; 9+ messages in thread
From: Nate Watterson @ 2017-06-29 22:34 UTC (permalink / raw)
  To: Will Deacon, Robin Murphy, Joerg Roedel,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

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 <nwatters-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> ---
>   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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method
@ 2017-06-29 22:34   ` Nate Watterson
  0 siblings, 0 replies; 9+ messages in thread
From: Nate Watterson @ 2017-06-29 22:34 UTC (permalink / raw)
  To: linux-arm-kernel

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 <nwatters@codeaurora.org>
> ---
>   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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method
@ 2017-06-30 17:11   ` Will Deacon
  0 siblings, 0 replies; 9+ messages in thread
From: Will Deacon @ 2017-06-30 17:11 UTC (permalink / raw)
  To: Nate Watterson
  Cc: Robin Murphy, Joerg Roedel, linux-arm-kernel, iommu, linux-kernel

On Thu, Jun 29, 2017 at 06:18:15PM -0400, Nate Watterson wrote:
> The shutdown method disables the SMMU to avoid corrupting a new kernel
> started with kexec.
> 
> Signed-off-by: Nate Watterson <nwatters@codeaurora.org>
> ---
>  drivers/iommu/arm-smmu-v3.c | 7 +++++++
>  drivers/iommu/arm-smmu.c    | 6 ++++++
>  2 files changed, 13 insertions(+)

Aha, I didn't see you'd dropped the IRQ changes here :)

In which case, this looks fine to me, thanks!

Will

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method
@ 2017-06-30 17:11   ` Will Deacon
  0 siblings, 0 replies; 9+ messages in thread
From: Will Deacon @ 2017-06-30 17:11 UTC (permalink / raw)
  To: Nate Watterson
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Thu, Jun 29, 2017 at 06:18:15PM -0400, Nate Watterson wrote:
> The shutdown method disables the SMMU to avoid corrupting a new kernel
> started with kexec.
> 
> Signed-off-by: Nate Watterson <nwatters-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> ---
>  drivers/iommu/arm-smmu-v3.c | 7 +++++++
>  drivers/iommu/arm-smmu.c    | 6 ++++++
>  2 files changed, 13 insertions(+)

Aha, I didn't see you'd dropped the IRQ changes here :)

In which case, this looks fine to me, thanks!

Will

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method
@ 2017-06-30 17:11   ` Will Deacon
  0 siblings, 0 replies; 9+ messages in thread
From: Will Deacon @ 2017-06-30 17:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 29, 2017 at 06:18:15PM -0400, Nate Watterson wrote:
> The shutdown method disables the SMMU to avoid corrupting a new kernel
> started with kexec.
> 
> Signed-off-by: Nate Watterson <nwatters@codeaurora.org>
> ---
>  drivers/iommu/arm-smmu-v3.c | 7 +++++++
>  drivers/iommu/arm-smmu.c    | 6 ++++++
>  2 files changed, 13 insertions(+)

Aha, I didn't see you'd dropped the IRQ changes here :)

In which case, this looks fine to me, thanks!

Will

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-06-30 17:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29 22:18 [PATCH v2] iommu/arm-smmu-v3: Implement shutdown method Nate Watterson
2017-06-29 22:18 ` Nate Watterson
2017-06-29 22:18 ` Nate Watterson
2017-06-29 22:34 ` Nate Watterson
2017-06-29 22:34   ` Nate Watterson
2017-06-29 22:34   ` Nate Watterson
2017-06-30 17:11 ` Will Deacon
2017-06-30 17:11   ` Will Deacon
2017-06-30 17:11   ` Will Deacon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.