* [PATCH] iommu/exynos: Fix driver initialization sequence
[not found] <CGME20221104115521eucas1p2ef149555574e8f6cbd1bb3df0bdbbb20@eucas1p2.samsung.com>
@ 2022-11-04 11:55 ` Marek Szyprowski
2022-11-04 12:35 ` Sam Protsenko
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Marek Szyprowski @ 2022-11-04 11:55 UTC (permalink / raw)
To: iommu, linux-samsung-soc
Cc: Marek Szyprowski, Joerg Roedel, Will Deacon, Krzysztof Kozlowski,
Alim Akhtar, Sam Protsenko
Registering SYSMMU platform driver might directly trigger initializing
IOMMU domains and performing initial mappings. That time all common
resources for the SYSMMU driver must be already allocated, so move
platform driver registration to the end of exynos_iommu_init() function.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
drivers/iommu/exynos-iommu.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 45fd4850bacb..85a6a775aea5 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1432,12 +1432,6 @@ static int __init exynos_iommu_init(void)
return -ENOMEM;
}
- ret = platform_driver_register(&exynos_sysmmu_driver);
- if (ret) {
- pr_err("%s: Failed to register driver\n", __func__);
- goto err_reg_driver;
- }
-
zero_lv2_table = kmem_cache_zalloc(lv2table_kmem_cache, GFP_KERNEL);
if (zero_lv2_table == NULL) {
pr_err("%s: Failed to allocate zero level2 page table\n",
@@ -1446,10 +1440,16 @@ static int __init exynos_iommu_init(void)
goto err_zero_lv2;
}
+ ret = platform_driver_register(&exynos_sysmmu_driver);
+ if (ret) {
+ pr_err("%s: Failed to register driver\n", __func__);
+ goto err_reg_driver;
+ }
+
return 0;
-err_zero_lv2:
- platform_driver_unregister(&exynos_sysmmu_driver);
err_reg_driver:
+ platform_driver_unregister(&exynos_sysmmu_driver);
+err_zero_lv2:
kmem_cache_destroy(lv2table_kmem_cache);
return ret;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iommu/exynos: Fix driver initialization sequence
2022-11-04 11:55 ` [PATCH] iommu/exynos: Fix driver initialization sequence Marek Szyprowski
@ 2022-11-04 12:35 ` Sam Protsenko
2022-11-04 13:49 ` Krzysztof Kozlowski
2022-11-19 9:15 ` Joerg Roedel
2 siblings, 0 replies; 4+ messages in thread
From: Sam Protsenko @ 2022-11-04 12:35 UTC (permalink / raw)
To: Marek Szyprowski
Cc: iommu, linux-samsung-soc, Joerg Roedel, Will Deacon,
Krzysztof Kozlowski, Alim Akhtar
On Fri, 4 Nov 2022 at 12:55, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>
> Registering SYSMMU platform driver might directly trigger initializing
> IOMMU domains and performing initial mappings. That time all common
> resources for the SYSMMU driver must be already allocated, so move
> platform driver registration to the end of exynos_iommu_init() function.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Please let me know if you want me to rebase my patches on top of this one.
> drivers/iommu/exynos-iommu.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 45fd4850bacb..85a6a775aea5 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1432,12 +1432,6 @@ static int __init exynos_iommu_init(void)
> return -ENOMEM;
> }
>
> - ret = platform_driver_register(&exynos_sysmmu_driver);
> - if (ret) {
> - pr_err("%s: Failed to register driver\n", __func__);
> - goto err_reg_driver;
> - }
> -
> zero_lv2_table = kmem_cache_zalloc(lv2table_kmem_cache, GFP_KERNEL);
> if (zero_lv2_table == NULL) {
> pr_err("%s: Failed to allocate zero level2 page table\n",
> @@ -1446,10 +1440,16 @@ static int __init exynos_iommu_init(void)
> goto err_zero_lv2;
> }
>
> + ret = platform_driver_register(&exynos_sysmmu_driver);
> + if (ret) {
> + pr_err("%s: Failed to register driver\n", __func__);
> + goto err_reg_driver;
> + }
> +
> return 0;
> -err_zero_lv2:
> - platform_driver_unregister(&exynos_sysmmu_driver);
> err_reg_driver:
> + platform_driver_unregister(&exynos_sysmmu_driver);
> +err_zero_lv2:
> kmem_cache_destroy(lv2table_kmem_cache);
> return ret;
> }
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iommu/exynos: Fix driver initialization sequence
2022-11-04 11:55 ` [PATCH] iommu/exynos: Fix driver initialization sequence Marek Szyprowski
2022-11-04 12:35 ` Sam Protsenko
@ 2022-11-04 13:49 ` Krzysztof Kozlowski
2022-11-19 9:15 ` Joerg Roedel
2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-04 13:49 UTC (permalink / raw)
To: Marek Szyprowski, iommu, linux-samsung-soc
Cc: Joerg Roedel, Will Deacon, Alim Akhtar, Sam Protsenko
On 04/11/2022 07:55, Marek Szyprowski wrote:
> Registering SYSMMU platform driver might directly trigger initializing
> IOMMU domains and performing initial mappings. That time all common
> resources for the SYSMMU driver must be already allocated, so move
> platform driver registration to the end of exynos_iommu_init() function.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
How about:
Fixes: 66a7ed84b345 ("iommu/exynos: Apply workaround of caching fault
page table entries")
?
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iommu/exynos: Fix driver initialization sequence
2022-11-04 11:55 ` [PATCH] iommu/exynos: Fix driver initialization sequence Marek Szyprowski
2022-11-04 12:35 ` Sam Protsenko
2022-11-04 13:49 ` Krzysztof Kozlowski
@ 2022-11-19 9:15 ` Joerg Roedel
2 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2022-11-19 9:15 UTC (permalink / raw)
To: Marek Szyprowski
Cc: iommu, linux-samsung-soc, Will Deacon, Krzysztof Kozlowski,
Alim Akhtar, Sam Protsenko
On Fri, Nov 04, 2022 at 12:55:11PM +0100, Marek Szyprowski wrote:
> Registering SYSMMU platform driver might directly trigger initializing
> IOMMU domains and performing initial mappings. That time all common
> resources for the SYSMMU driver must be already allocated, so move
> platform driver registration to the end of exynos_iommu_init() function.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/iommu/exynos-iommu.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-19 9:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20221104115521eucas1p2ef149555574e8f6cbd1bb3df0bdbbb20@eucas1p2.samsung.com>
2022-11-04 11:55 ` [PATCH] iommu/exynos: Fix driver initialization sequence Marek Szyprowski
2022-11-04 12:35 ` Sam Protsenko
2022-11-04 13:49 ` Krzysztof Kozlowski
2022-11-19 9:15 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox