All of lore.kernel.org
 help / color / mirror / Atom feed
* Support MTK_SMI modular
@ 2021-01-21  6:24 ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: Joerg Roedel, Robin Murphy, Will Deacon, Tomasz Figa,
	linux-mediatek, srv_heupstream, linux-kernel, linux-arm-kernel,
	iommu, yong.wu, youlin.pei, Nicolas Boichat, anan.sun, yi.kuo

This patchset mainly support MTK_SMI could be modular. No other function add.
The MTK_IOMMU config will be another patchset.

rebase on v5.11-rc1.

Yong Wu (3):
  memory: mtk-smi: Use platform_register_drivers
  memory: mtk-smi: Add module_exit and module_license
  memory: mtk-smi: Switch MTK_SMI to tristate

 drivers/memory/Kconfig     |  2 +-
 drivers/memory/mtk-smi.c   | 33 +++++++++++++++------------------
 include/soc/mediatek/smi.h |  2 +-
 3 files changed, 17 insertions(+), 20 deletions(-)

-- 
2.18.0



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

* Support MTK_SMI modular
@ 2021-01-21  6:24 ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Will Deacon, linux-arm-kernel

This patchset mainly support MTK_SMI could be modular. No other function add.
The MTK_IOMMU config will be another patchset.

rebase on v5.11-rc1.

Yong Wu (3):
  memory: mtk-smi: Use platform_register_drivers
  memory: mtk-smi: Add module_exit and module_license
  memory: mtk-smi: Switch MTK_SMI to tristate

 drivers/memory/Kconfig     |  2 +-
 drivers/memory/mtk-smi.c   | 33 +++++++++++++++------------------
 include/soc/mediatek/smi.h |  2 +-
 3 files changed, 17 insertions(+), 20 deletions(-)

-- 
2.18.0


_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Support MTK_SMI modular
@ 2021-01-21  6:24 ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, yong.wu, Will Deacon, linux-arm-kernel

This patchset mainly support MTK_SMI could be modular. No other function add.
The MTK_IOMMU config will be another patchset.

rebase on v5.11-rc1.

Yong Wu (3):
  memory: mtk-smi: Use platform_register_drivers
  memory: mtk-smi: Add module_exit and module_license
  memory: mtk-smi: Switch MTK_SMI to tristate

 drivers/memory/Kconfig     |  2 +-
 drivers/memory/mtk-smi.c   | 33 +++++++++++++++------------------
 include/soc/mediatek/smi.h |  2 +-
 3 files changed, 17 insertions(+), 20 deletions(-)

-- 
2.18.0

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Support MTK_SMI modular
@ 2021-01-21  6:24 ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, yong.wu, Will Deacon, linux-arm-kernel

This patchset mainly support MTK_SMI could be modular. No other function add.
The MTK_IOMMU config will be another patchset.

rebase on v5.11-rc1.

Yong Wu (3):
  memory: mtk-smi: Use platform_register_drivers
  memory: mtk-smi: Add module_exit and module_license
  memory: mtk-smi: Switch MTK_SMI to tristate

 drivers/memory/Kconfig     |  2 +-
 drivers/memory/mtk-smi.c   | 33 +++++++++++++++------------------
 include/soc/mediatek/smi.h |  2 +-
 3 files changed, 17 insertions(+), 20 deletions(-)

-- 
2.18.0

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers
  2021-01-21  6:24 ` Yong Wu
  (?)
  (?)
@ 2021-01-21  6:24   ` Yong Wu
  -1 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: Joerg Roedel, Robin Murphy, Will Deacon, Tomasz Figa,
	linux-mediatek, srv_heupstream, linux-kernel, linux-arm-kernel,
	iommu, yong.wu, youlin.pei, Nicolas Boichat, anan.sun, yi.kuo

In this file, we have 2 drivers, smi-common and smi-larb.
Use platform_register_drivers.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
 drivers/memory/mtk-smi.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index ac350f8d1e20..e2aebd2bfa8e 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -587,26 +587,13 @@ static struct platform_driver mtk_smi_common_driver = {
 	}
 };
 
+static struct platform_driver * const smidrivers[] = {
+	&mtk_smi_common_driver,
+	&mtk_smi_larb_driver,
+};
+
 static int __init mtk_smi_init(void)
 {
-	int ret;
-
-	ret = platform_driver_register(&mtk_smi_common_driver);
-	if (ret != 0) {
-		pr_err("Failed to register SMI driver\n");
-		return ret;
-	}
-
-	ret = platform_driver_register(&mtk_smi_larb_driver);
-	if (ret != 0) {
-		pr_err("Failed to register SMI-LARB driver\n");
-		goto err_unreg_smi;
-	}
-	return ret;
-
-err_unreg_smi:
-	platform_driver_unregister(&mtk_smi_common_driver);
-	return ret;
+	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
 }
-
 module_init(mtk_smi_init);
-- 
2.18.0


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

* [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers
@ 2021-01-21  6:24   ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Will Deacon, linux-arm-kernel

In this file, we have 2 drivers, smi-common and smi-larb.
Use platform_register_drivers.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
 drivers/memory/mtk-smi.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index ac350f8d1e20..e2aebd2bfa8e 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -587,26 +587,13 @@ static struct platform_driver mtk_smi_common_driver = {
 	}
 };
 
+static struct platform_driver * const smidrivers[] = {
+	&mtk_smi_common_driver,
+	&mtk_smi_larb_driver,
+};
+
 static int __init mtk_smi_init(void)
 {
-	int ret;
-
-	ret = platform_driver_register(&mtk_smi_common_driver);
-	if (ret != 0) {
-		pr_err("Failed to register SMI driver\n");
-		return ret;
-	}
-
-	ret = platform_driver_register(&mtk_smi_larb_driver);
-	if (ret != 0) {
-		pr_err("Failed to register SMI-LARB driver\n");
-		goto err_unreg_smi;
-	}
-	return ret;
-
-err_unreg_smi:
-	platform_driver_unregister(&mtk_smi_common_driver);
-	return ret;
+	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
 }
-
 module_init(mtk_smi_init);
-- 
2.18.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers
@ 2021-01-21  6:24   ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, yong.wu, Will Deacon, linux-arm-kernel

In this file, we have 2 drivers, smi-common and smi-larb.
Use platform_register_drivers.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
 drivers/memory/mtk-smi.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index ac350f8d1e20..e2aebd2bfa8e 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -587,26 +587,13 @@ static struct platform_driver mtk_smi_common_driver = {
 	}
 };
 
+static struct platform_driver * const smidrivers[] = {
+	&mtk_smi_common_driver,
+	&mtk_smi_larb_driver,
+};
+
 static int __init mtk_smi_init(void)
 {
-	int ret;
-
-	ret = platform_driver_register(&mtk_smi_common_driver);
-	if (ret != 0) {
-		pr_err("Failed to register SMI driver\n");
-		return ret;
-	}
-
-	ret = platform_driver_register(&mtk_smi_larb_driver);
-	if (ret != 0) {
-		pr_err("Failed to register SMI-LARB driver\n");
-		goto err_unreg_smi;
-	}
-	return ret;
-
-err_unreg_smi:
-	platform_driver_unregister(&mtk_smi_common_driver);
-	return ret;
+	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
 }
-
 module_init(mtk_smi_init);
-- 
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers
@ 2021-01-21  6:24   ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, yong.wu, Will Deacon, linux-arm-kernel

In this file, we have 2 drivers, smi-common and smi-larb.
Use platform_register_drivers.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
 drivers/memory/mtk-smi.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index ac350f8d1e20..e2aebd2bfa8e 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -587,26 +587,13 @@ static struct platform_driver mtk_smi_common_driver = {
 	}
 };
 
+static struct platform_driver * const smidrivers[] = {
+	&mtk_smi_common_driver,
+	&mtk_smi_larb_driver,
+};
+
 static int __init mtk_smi_init(void)
 {
-	int ret;
-
-	ret = platform_driver_register(&mtk_smi_common_driver);
-	if (ret != 0) {
-		pr_err("Failed to register SMI driver\n");
-		return ret;
-	}
-
-	ret = platform_driver_register(&mtk_smi_larb_driver);
-	if (ret != 0) {
-		pr_err("Failed to register SMI-LARB driver\n");
-		goto err_unreg_smi;
-	}
-	return ret;
-
-err_unreg_smi:
-	platform_driver_unregister(&mtk_smi_common_driver);
-	return ret;
+	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
 }
-
 module_init(mtk_smi_init);
-- 
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
  2021-01-21  6:24 ` Yong Wu
  (?)
  (?)
@ 2021-01-21  6:24   ` Yong Wu
  -1 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: Joerg Roedel, Robin Murphy, Will Deacon, Tomasz Figa,
	linux-mediatek, srv_heupstream, linux-kernel, linux-arm-kernel,
	iommu, yong.wu, youlin.pei, Nicolas Boichat, anan.sun, yi.kuo

The config MTK_SMI always depends on MTK_IOMMU which is built-in
currently. Thus we don't have module_exit before. This patch adds
module_exit and module_license. It is a preparing patch for supporting
MTK_SMI could been built as a module.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
 drivers/memory/mtk-smi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index e2aebd2bfa8e..aa2a25abf04f 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
 	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
 }
 module_init(mtk_smi_init);
+
+static void __exit mtk_smi_exit(void)
+{
+	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
+}
+module_exit(mtk_smi_exit);
+
+MODULE_DESCRIPTION("MediaTek SMI driver");
+MODULE_ALIAS("platform:MediaTek-SMI");
+MODULE_LICENSE("GPL v2");
-- 
2.18.0


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

* [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-21  6:24   ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Will Deacon, linux-arm-kernel

The config MTK_SMI always depends on MTK_IOMMU which is built-in
currently. Thus we don't have module_exit before. This patch adds
module_exit and module_license. It is a preparing patch for supporting
MTK_SMI could been built as a module.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
 drivers/memory/mtk-smi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index e2aebd2bfa8e..aa2a25abf04f 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
 	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
 }
 module_init(mtk_smi_init);
+
+static void __exit mtk_smi_exit(void)
+{
+	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
+}
+module_exit(mtk_smi_exit);
+
+MODULE_DESCRIPTION("MediaTek SMI driver");
+MODULE_ALIAS("platform:MediaTek-SMI");
+MODULE_LICENSE("GPL v2");
-- 
2.18.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-21  6:24   ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, yong.wu, Will Deacon, linux-arm-kernel

The config MTK_SMI always depends on MTK_IOMMU which is built-in
currently. Thus we don't have module_exit before. This patch adds
module_exit and module_license. It is a preparing patch for supporting
MTK_SMI could been built as a module.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
 drivers/memory/mtk-smi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index e2aebd2bfa8e..aa2a25abf04f 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
 	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
 }
 module_init(mtk_smi_init);
+
+static void __exit mtk_smi_exit(void)
+{
+	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
+}
+module_exit(mtk_smi_exit);
+
+MODULE_DESCRIPTION("MediaTek SMI driver");
+MODULE_ALIAS("platform:MediaTek-SMI");
+MODULE_LICENSE("GPL v2");
-- 
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-21  6:24   ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, yong.wu, Will Deacon, linux-arm-kernel

The config MTK_SMI always depends on MTK_IOMMU which is built-in
currently. Thus we don't have module_exit before. This patch adds
module_exit and module_license. It is a preparing patch for supporting
MTK_SMI could been built as a module.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
 drivers/memory/mtk-smi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index e2aebd2bfa8e..aa2a25abf04f 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
 	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
 }
 module_init(mtk_smi_init);
+
+static void __exit mtk_smi_exit(void)
+{
+	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
+}
+module_exit(mtk_smi_exit);
+
+MODULE_DESCRIPTION("MediaTek SMI driver");
+MODULE_ALIAS("platform:MediaTek-SMI");
+MODULE_LICENSE("GPL v2");
-- 
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
  2021-01-21  6:24 ` Yong Wu
  (?)
  (?)
@ 2021-01-21  6:24   ` Yong Wu
  -1 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: Joerg Roedel, Robin Murphy, Will Deacon, Tomasz Figa,
	linux-mediatek, srv_heupstream, linux-kernel, linux-arm-kernel,
	iommu, yong.wu, youlin.pei, Nicolas Boichat, anan.sun, yi.kuo

This patch switches MTK_SMI to tristate. Support it could be 'm'.

Meanwhile, Fix a build issue while MTK_SMI is built as module.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
This patch has a little conflict with the mt8192 iommu patch which
delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
This patch rebase on the clean v5.11-rc1.
---
 drivers/memory/Kconfig     | 2 +-
 include/soc/mediatek/smi.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index 3ea6913df176..d5f0f4680880 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -173,7 +173,7 @@ config JZ4780_NEMC
 	  memory devices such as NAND and SRAM.
 
 config MTK_SMI
-	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
+	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
 	depends on ARCH_MEDIATEK || COMPILE_TEST
 	help
 	  This driver is for the Memory Controller module in MediaTek SoCs,
diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
index 5a34b87d89e3..29e2fb8f33d6 100644
--- a/include/soc/mediatek/smi.h
+++ b/include/soc/mediatek/smi.h
@@ -9,7 +9,7 @@
 #include <linux/bitops.h>
 #include <linux/device.h>
 
-#ifdef CONFIG_MTK_SMI
+#if IS_ENABLED(CONFIG_MTK_SMI)
 
 #define MTK_LARB_NR_MAX		16
 
-- 
2.18.0


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

* [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-21  6:24   ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Will Deacon, linux-arm-kernel

This patch switches MTK_SMI to tristate. Support it could be 'm'.

Meanwhile, Fix a build issue while MTK_SMI is built as module.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
This patch has a little conflict with the mt8192 iommu patch which
delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
This patch rebase on the clean v5.11-rc1.
---
 drivers/memory/Kconfig     | 2 +-
 include/soc/mediatek/smi.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index 3ea6913df176..d5f0f4680880 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -173,7 +173,7 @@ config JZ4780_NEMC
 	  memory devices such as NAND and SRAM.
 
 config MTK_SMI
-	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
+	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
 	depends on ARCH_MEDIATEK || COMPILE_TEST
 	help
 	  This driver is for the Memory Controller module in MediaTek SoCs,
diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
index 5a34b87d89e3..29e2fb8f33d6 100644
--- a/include/soc/mediatek/smi.h
+++ b/include/soc/mediatek/smi.h
@@ -9,7 +9,7 @@
 #include <linux/bitops.h>
 #include <linux/device.h>
 
-#ifdef CONFIG_MTK_SMI
+#if IS_ENABLED(CONFIG_MTK_SMI)
 
 #define MTK_LARB_NR_MAX		16
 
-- 
2.18.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-21  6:24   ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, yong.wu, Will Deacon, linux-arm-kernel

This patch switches MTK_SMI to tristate. Support it could be 'm'.

Meanwhile, Fix a build issue while MTK_SMI is built as module.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
This patch has a little conflict with the mt8192 iommu patch which
delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
This patch rebase on the clean v5.11-rc1.
---
 drivers/memory/Kconfig     | 2 +-
 include/soc/mediatek/smi.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index 3ea6913df176..d5f0f4680880 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -173,7 +173,7 @@ config JZ4780_NEMC
 	  memory devices such as NAND and SRAM.
 
 config MTK_SMI
-	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
+	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
 	depends on ARCH_MEDIATEK || COMPILE_TEST
 	help
 	  This driver is for the Memory Controller module in MediaTek SoCs,
diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
index 5a34b87d89e3..29e2fb8f33d6 100644
--- a/include/soc/mediatek/smi.h
+++ b/include/soc/mediatek/smi.h
@@ -9,7 +9,7 @@
 #include <linux/bitops.h>
 #include <linux/device.h>
 
-#ifdef CONFIG_MTK_SMI
+#if IS_ENABLED(CONFIG_MTK_SMI)
 
 #define MTK_LARB_NR_MAX		16
 
-- 
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-21  6:24   ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-21  6:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Matthias Brugger
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, yong.wu, Will Deacon, linux-arm-kernel

This patch switches MTK_SMI to tristate. Support it could be 'm'.

Meanwhile, Fix a build issue while MTK_SMI is built as module.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
This patch has a little conflict with the mt8192 iommu patch which
delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
This patch rebase on the clean v5.11-rc1.
---
 drivers/memory/Kconfig     | 2 +-
 include/soc/mediatek/smi.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index 3ea6913df176..d5f0f4680880 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -173,7 +173,7 @@ config JZ4780_NEMC
 	  memory devices such as NAND and SRAM.
 
 config MTK_SMI
-	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
+	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
 	depends on ARCH_MEDIATEK || COMPILE_TEST
 	help
 	  This driver is for the Memory Controller module in MediaTek SoCs,
diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
index 5a34b87d89e3..29e2fb8f33d6 100644
--- a/include/soc/mediatek/smi.h
+++ b/include/soc/mediatek/smi.h
@@ -9,7 +9,7 @@
 #include <linux/bitops.h>
 #include <linux/device.h>
 
-#ifdef CONFIG_MTK_SMI
+#if IS_ENABLED(CONFIG_MTK_SMI)
 
 #define MTK_LARB_NR_MAX		16
 
-- 
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers
  2021-01-21  6:24   ` Yong Wu
  (?)
  (?)
@ 2021-01-22 21:31     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:31 UTC (permalink / raw)
  To: Yong Wu
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Thu, Jan 21, 2021 at 02:24:27PM +0800, Yong Wu wrote:
> In this file, we have 2 drivers, smi-common and smi-larb.
> Use platform_register_drivers.
> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
>  drivers/memory/mtk-smi.c | 25 ++++++-------------------
>  1 file changed, 6 insertions(+), 19 deletions(-)

Thanks, applied.

Best regards,
Krzysztof


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

* Re: [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers
@ 2021-01-22 21:31     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:31 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Thu, Jan 21, 2021 at 02:24:27PM +0800, Yong Wu wrote:
> In this file, we have 2 drivers, smi-common and smi-larb.
> Use platform_register_drivers.
> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
>  drivers/memory/mtk-smi.c | 25 ++++++-------------------
>  1 file changed, 6 insertions(+), 19 deletions(-)

Thanks, applied.

Best regards,
Krzysztof

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers
@ 2021-01-22 21:31     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:31 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Thu, Jan 21, 2021 at 02:24:27PM +0800, Yong Wu wrote:
> In this file, we have 2 drivers, smi-common and smi-larb.
> Use platform_register_drivers.
> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
>  drivers/memory/mtk-smi.c | 25 ++++++-------------------
>  1 file changed, 6 insertions(+), 19 deletions(-)

Thanks, applied.

Best regards,
Krzysztof


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers
@ 2021-01-22 21:31     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:31 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Thu, Jan 21, 2021 at 02:24:27PM +0800, Yong Wu wrote:
> In this file, we have 2 drivers, smi-common and smi-larb.
> Use platform_register_drivers.
> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
>  drivers/memory/mtk-smi.c | 25 ++++++-------------------
>  1 file changed, 6 insertions(+), 19 deletions(-)

Thanks, applied.

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
  2021-01-21  6:24   ` Yong Wu
  (?)
  (?)
@ 2021-01-22 21:34     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:34 UTC (permalink / raw)
  To: Yong Wu
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> The config MTK_SMI always depends on MTK_IOMMU which is built-in
> currently. Thus we don't have module_exit before. This patch adds
> module_exit and module_license. It is a preparing patch for supporting
> MTK_SMI could been built as a module.
> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
>  drivers/memory/mtk-smi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> index e2aebd2bfa8e..aa2a25abf04f 100644
> --- a/drivers/memory/mtk-smi.c
> +++ b/drivers/memory/mtk-smi.c
> @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
>  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
>  }
>  module_init(mtk_smi_init);
> +
> +static void __exit mtk_smi_exit(void)
> +{
> +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> +}
> +module_exit(mtk_smi_exit);
> +
> +MODULE_DESCRIPTION("MediaTek SMI driver");
> +MODULE_ALIAS("platform:MediaTek-SMI");

Drivers do not use capital letters, so I have doubts whether this alias
is correct.

Adding all these should be squashed with changing Kconfig into tristate.
It does not have sense on its own.

Best regards,
Krzysztof

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-22 21:34     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:34 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> The config MTK_SMI always depends on MTK_IOMMU which is built-in
> currently. Thus we don't have module_exit before. This patch adds
> module_exit and module_license. It is a preparing patch for supporting
> MTK_SMI could been built as a module.
> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
>  drivers/memory/mtk-smi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> index e2aebd2bfa8e..aa2a25abf04f 100644
> --- a/drivers/memory/mtk-smi.c
> +++ b/drivers/memory/mtk-smi.c
> @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
>  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
>  }
>  module_init(mtk_smi_init);
> +
> +static void __exit mtk_smi_exit(void)
> +{
> +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> +}
> +module_exit(mtk_smi_exit);
> +
> +MODULE_DESCRIPTION("MediaTek SMI driver");
> +MODULE_ALIAS("platform:MediaTek-SMI");

Drivers do not use capital letters, so I have doubts whether this alias
is correct.

Adding all these should be squashed with changing Kconfig into tristate.
It does not have sense on its own.

Best regards,
Krzysztof
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-22 21:34     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:34 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> The config MTK_SMI always depends on MTK_IOMMU which is built-in
> currently. Thus we don't have module_exit before. This patch adds
> module_exit and module_license. It is a preparing patch for supporting
> MTK_SMI could been built as a module.
> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
>  drivers/memory/mtk-smi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> index e2aebd2bfa8e..aa2a25abf04f 100644
> --- a/drivers/memory/mtk-smi.c
> +++ b/drivers/memory/mtk-smi.c
> @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
>  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
>  }
>  module_init(mtk_smi_init);
> +
> +static void __exit mtk_smi_exit(void)
> +{
> +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> +}
> +module_exit(mtk_smi_exit);
> +
> +MODULE_DESCRIPTION("MediaTek SMI driver");
> +MODULE_ALIAS("platform:MediaTek-SMI");

Drivers do not use capital letters, so I have doubts whether this alias
is correct.

Adding all these should be squashed with changing Kconfig into tristate.
It does not have sense on its own.

Best regards,
Krzysztof

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-22 21:34     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:34 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> The config MTK_SMI always depends on MTK_IOMMU which is built-in
> currently. Thus we don't have module_exit before. This patch adds
> module_exit and module_license. It is a preparing patch for supporting
> MTK_SMI could been built as a module.
> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
>  drivers/memory/mtk-smi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> index e2aebd2bfa8e..aa2a25abf04f 100644
> --- a/drivers/memory/mtk-smi.c
> +++ b/drivers/memory/mtk-smi.c
> @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
>  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
>  }
>  module_init(mtk_smi_init);
> +
> +static void __exit mtk_smi_exit(void)
> +{
> +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> +}
> +module_exit(mtk_smi_exit);
> +
> +MODULE_DESCRIPTION("MediaTek SMI driver");
> +MODULE_ALIAS("platform:MediaTek-SMI");

Drivers do not use capital letters, so I have doubts whether this alias
is correct.

Adding all these should be squashed with changing Kconfig into tristate.
It does not have sense on its own.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
  2021-01-21  6:24   ` Yong Wu
  (?)
  (?)
@ 2021-01-22 21:35     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:35 UTC (permalink / raw)
  To: Yong Wu
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> This patch switches MTK_SMI to tristate. Support it could be 'm'.
> 
> Meanwhile, Fix a build issue while MTK_SMI is built as module.

s/Fix/fix.

What error is being fixed here? How can I reproduce it? Aren't you just
adjusting it to being buildable by module?

Best regards,
Krzysztof


> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
> This patch has a little conflict with the mt8192 iommu patch which
> delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
> This patch rebase on the clean v5.11-rc1.
> ---
>  drivers/memory/Kconfig     | 2 +-
>  include/soc/mediatek/smi.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> index 3ea6913df176..d5f0f4680880 100644
> --- a/drivers/memory/Kconfig
> +++ b/drivers/memory/Kconfig
> @@ -173,7 +173,7 @@ config JZ4780_NEMC
>  	  memory devices such as NAND and SRAM.
>  
>  config MTK_SMI
> -	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> +	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
>  	depends on ARCH_MEDIATEK || COMPILE_TEST
>  	help
>  	  This driver is for the Memory Controller module in MediaTek SoCs,
> diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
> index 5a34b87d89e3..29e2fb8f33d6 100644
> --- a/include/soc/mediatek/smi.h
> +++ b/include/soc/mediatek/smi.h
> @@ -9,7 +9,7 @@
>  #include <linux/bitops.h>
>  #include <linux/device.h>
>  
> -#ifdef CONFIG_MTK_SMI
> +#if IS_ENABLED(CONFIG_MTK_SMI)

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-22 21:35     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:35 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> This patch switches MTK_SMI to tristate. Support it could be 'm'.
> 
> Meanwhile, Fix a build issue while MTK_SMI is built as module.

s/Fix/fix.

What error is being fixed here? How can I reproduce it? Aren't you just
adjusting it to being buildable by module?

Best regards,
Krzysztof


> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
> This patch has a little conflict with the mt8192 iommu patch which
> delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
> This patch rebase on the clean v5.11-rc1.
> ---
>  drivers/memory/Kconfig     | 2 +-
>  include/soc/mediatek/smi.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> index 3ea6913df176..d5f0f4680880 100644
> --- a/drivers/memory/Kconfig
> +++ b/drivers/memory/Kconfig
> @@ -173,7 +173,7 @@ config JZ4780_NEMC
>  	  memory devices such as NAND and SRAM.
>  
>  config MTK_SMI
> -	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> +	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
>  	depends on ARCH_MEDIATEK || COMPILE_TEST
>  	help
>  	  This driver is for the Memory Controller module in MediaTek SoCs,
> diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
> index 5a34b87d89e3..29e2fb8f33d6 100644
> --- a/include/soc/mediatek/smi.h
> +++ b/include/soc/mediatek/smi.h
> @@ -9,7 +9,7 @@
>  #include <linux/bitops.h>
>  #include <linux/device.h>
>  
> -#ifdef CONFIG_MTK_SMI
> +#if IS_ENABLED(CONFIG_MTK_SMI)
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-22 21:35     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:35 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> This patch switches MTK_SMI to tristate. Support it could be 'm'.
> 
> Meanwhile, Fix a build issue while MTK_SMI is built as module.

s/Fix/fix.

What error is being fixed here? How can I reproduce it? Aren't you just
adjusting it to being buildable by module?

Best regards,
Krzysztof


> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
> This patch has a little conflict with the mt8192 iommu patch which
> delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
> This patch rebase on the clean v5.11-rc1.
> ---
>  drivers/memory/Kconfig     | 2 +-
>  include/soc/mediatek/smi.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> index 3ea6913df176..d5f0f4680880 100644
> --- a/drivers/memory/Kconfig
> +++ b/drivers/memory/Kconfig
> @@ -173,7 +173,7 @@ config JZ4780_NEMC
>  	  memory devices such as NAND and SRAM.
>  
>  config MTK_SMI
> -	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> +	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
>  	depends on ARCH_MEDIATEK || COMPILE_TEST
>  	help
>  	  This driver is for the Memory Controller module in MediaTek SoCs,
> diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
> index 5a34b87d89e3..29e2fb8f33d6 100644
> --- a/include/soc/mediatek/smi.h
> +++ b/include/soc/mediatek/smi.h
> @@ -9,7 +9,7 @@
>  #include <linux/bitops.h>
>  #include <linux/device.h>
>  
> -#ifdef CONFIG_MTK_SMI
> +#if IS_ENABLED(CONFIG_MTK_SMI)

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-22 21:35     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-22 21:35 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> This patch switches MTK_SMI to tristate. Support it could be 'm'.
> 
> Meanwhile, Fix a build issue while MTK_SMI is built as module.

s/Fix/fix.

What error is being fixed here? How can I reproduce it? Aren't you just
adjusting it to being buildable by module?

Best regards,
Krzysztof


> 
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> ---
> This patch has a little conflict with the mt8192 iommu patch which
> delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
> This patch rebase on the clean v5.11-rc1.
> ---
>  drivers/memory/Kconfig     | 2 +-
>  include/soc/mediatek/smi.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> index 3ea6913df176..d5f0f4680880 100644
> --- a/drivers/memory/Kconfig
> +++ b/drivers/memory/Kconfig
> @@ -173,7 +173,7 @@ config JZ4780_NEMC
>  	  memory devices such as NAND and SRAM.
>  
>  config MTK_SMI
> -	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> +	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
>  	depends on ARCH_MEDIATEK || COMPILE_TEST
>  	help
>  	  This driver is for the Memory Controller module in MediaTek SoCs,
> diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
> index 5a34b87d89e3..29e2fb8f33d6 100644
> --- a/include/soc/mediatek/smi.h
> +++ b/include/soc/mediatek/smi.h
> @@ -9,7 +9,7 @@
>  #include <linux/bitops.h>
>  #include <linux/device.h>
>  
> -#ifdef CONFIG_MTK_SMI
> +#if IS_ENABLED(CONFIG_MTK_SMI)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
  2021-01-22 21:34     ` Krzysztof Kozlowski
  (?)
  (?)
@ 2021-01-25  6:49       ` Yong Wu
  -1 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  6:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > currently. Thus we don't have module_exit before. This patch adds
> > module_exit and module_license. It is a preparing patch for supporting
> > MTK_SMI could been built as a module.
> > 
> > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > ---
> >  drivers/memory/mtk-smi.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > index e2aebd2bfa8e..aa2a25abf04f 100644
> > --- a/drivers/memory/mtk-smi.c
> > +++ b/drivers/memory/mtk-smi.c
> > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> >  }
> >  module_init(mtk_smi_init);
> > +
> > +static void __exit mtk_smi_exit(void)
> > +{
> > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > +}
> > +module_exit(mtk_smi_exit);
> > +
> > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > +MODULE_ALIAS("platform:MediaTek-SMI");
> 
> Drivers do not use capital letters, so I have doubts whether this alias
> is correct.

I didn't care the upper/lower-case. I will change to lower case in next
time.

MODULE_ALIAS("platform:MediaTek-smi")

> 
> Adding all these should be squashed with changing Kconfig into tristate.
> It does not have sense on its own.

Thanks  very much for review.

Only confirm: Squash whole this patch or only squash the MODULE_x into
the next patch?

> 
> Best regards,
> Krzysztof


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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25  6:49       ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  6:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > currently. Thus we don't have module_exit before. This patch adds
> > module_exit and module_license. It is a preparing patch for supporting
> > MTK_SMI could been built as a module.
> > 
> > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > ---
> >  drivers/memory/mtk-smi.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > index e2aebd2bfa8e..aa2a25abf04f 100644
> > --- a/drivers/memory/mtk-smi.c
> > +++ b/drivers/memory/mtk-smi.c
> > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> >  }
> >  module_init(mtk_smi_init);
> > +
> > +static void __exit mtk_smi_exit(void)
> > +{
> > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > +}
> > +module_exit(mtk_smi_exit);
> > +
> > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > +MODULE_ALIAS("platform:MediaTek-SMI");
> 
> Drivers do not use capital letters, so I have doubts whether this alias
> is correct.

I didn't care the upper/lower-case. I will change to lower case in next
time.

MODULE_ALIAS("platform:MediaTek-smi")

> 
> Adding all these should be squashed with changing Kconfig into tristate.
> It does not have sense on its own.

Thanks  very much for review.

Only confirm: Squash whole this patch or only squash the MODULE_x into
the next patch?

> 
> Best regards,
> Krzysztof

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25  6:49       ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  6:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > currently. Thus we don't have module_exit before. This patch adds
> > module_exit and module_license. It is a preparing patch for supporting
> > MTK_SMI could been built as a module.
> > 
> > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > ---
> >  drivers/memory/mtk-smi.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > index e2aebd2bfa8e..aa2a25abf04f 100644
> > --- a/drivers/memory/mtk-smi.c
> > +++ b/drivers/memory/mtk-smi.c
> > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> >  }
> >  module_init(mtk_smi_init);
> > +
> > +static void __exit mtk_smi_exit(void)
> > +{
> > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > +}
> > +module_exit(mtk_smi_exit);
> > +
> > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > +MODULE_ALIAS("platform:MediaTek-SMI");
> 
> Drivers do not use capital letters, so I have doubts whether this alias
> is correct.

I didn't care the upper/lower-case. I will change to lower case in next
time.

MODULE_ALIAS("platform:MediaTek-smi")

> 
> Adding all these should be squashed with changing Kconfig into tristate.
> It does not have sense on its own.

Thanks  very much for review.

Only confirm: Squash whole this patch or only squash the MODULE_x into
the next patch?

> 
> Best regards,
> Krzysztof

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25  6:49       ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  6:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > currently. Thus we don't have module_exit before. This patch adds
> > module_exit and module_license. It is a preparing patch for supporting
> > MTK_SMI could been built as a module.
> > 
> > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > ---
> >  drivers/memory/mtk-smi.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > index e2aebd2bfa8e..aa2a25abf04f 100644
> > --- a/drivers/memory/mtk-smi.c
> > +++ b/drivers/memory/mtk-smi.c
> > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> >  }
> >  module_init(mtk_smi_init);
> > +
> > +static void __exit mtk_smi_exit(void)
> > +{
> > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > +}
> > +module_exit(mtk_smi_exit);
> > +
> > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > +MODULE_ALIAS("platform:MediaTek-SMI");
> 
> Drivers do not use capital letters, so I have doubts whether this alias
> is correct.

I didn't care the upper/lower-case. I will change to lower case in next
time.

MODULE_ALIAS("platform:MediaTek-smi")

> 
> Adding all these should be squashed with changing Kconfig into tristate.
> It does not have sense on its own.

Thanks  very much for review.

Only confirm: Squash whole this patch or only squash the MODULE_x into
the next patch?

> 
> Best regards,
> Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
  2021-01-22 21:35     ` Krzysztof Kozlowski
  (?)
  (?)
@ 2021-01-25  6:49       ` Yong Wu
  -1 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  6:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > 
> > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> 
> s/Fix/fix.
> 
> What error is being fixed here? How can I reproduce it? Aren't you just
> adjusting it to being buildable by module?

Sorry, I didn't copy the fail log here. This is the build log:

In file included from .../drivers/iommu/mtk_iommu.c:34:0:
.../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
element type 'struct mtk_smi_larb_iommu'
  struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];

Our iommu driver will use this structure. but it was contained by
"#ifdef CONFIG_MTK_SMI". thus I change it to "#if
IS_ENABLED(CONFIG_MTK_SMI)"

If reproducing it, we should change mtk-iommu to module_init[1]. and
switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
to m. we could get the fail log.

In this case, Should I squash this change into this patch? I though this
is a preparing patch and the fail is caused by MTK_SMI. thus I squash
that into this patch. or change it as a independent patch and send when
I change MTK_IOMMU to tristate?

[1]
https://lore.kernel.org/linux-mediatek/1590826218-23653-14-git-send-email-yong.wu@mediatek.com/


> 
> Best regards,
> Krzysztof
> 
> 
> > 
> > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > ---
> > This patch has a little conflict with the mt8192 iommu patch which
> > delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
> > This patch rebase on the clean v5.11-rc1.
> > ---
> >  drivers/memory/Kconfig     | 2 +-
> >  include/soc/mediatek/smi.h | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> > index 3ea6913df176..d5f0f4680880 100644
> > --- a/drivers/memory/Kconfig
> > +++ b/drivers/memory/Kconfig
> > @@ -173,7 +173,7 @@ config JZ4780_NEMC
> >  	  memory devices such as NAND and SRAM.
> >  
> >  config MTK_SMI
> > -	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> > +	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> >  	depends on ARCH_MEDIATEK || COMPILE_TEST
> >  	help
> >  	  This driver is for the Memory Controller module in MediaTek SoCs,
> > diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
> > index 5a34b87d89e3..29e2fb8f33d6 100644
> > --- a/include/soc/mediatek/smi.h
> > +++ b/include/soc/mediatek/smi.h
> > @@ -9,7 +9,7 @@
> >  #include <linux/bitops.h>
> >  #include <linux/device.h>
> >  
> > -#ifdef CONFIG_MTK_SMI
> > +#if IS_ENABLED(CONFIG_MTK_SMI)


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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-25  6:49       ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  6:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > 
> > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> 
> s/Fix/fix.
> 
> What error is being fixed here? How can I reproduce it? Aren't you just
> adjusting it to being buildable by module?

Sorry, I didn't copy the fail log here. This is the build log:

In file included from .../drivers/iommu/mtk_iommu.c:34:0:
.../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
element type 'struct mtk_smi_larb_iommu'
  struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];

Our iommu driver will use this structure. but it was contained by
"#ifdef CONFIG_MTK_SMI". thus I change it to "#if
IS_ENABLED(CONFIG_MTK_SMI)"

If reproducing it, we should change mtk-iommu to module_init[1]. and
switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
to m. we could get the fail log.

In this case, Should I squash this change into this patch? I though this
is a preparing patch and the fail is caused by MTK_SMI. thus I squash
that into this patch. or change it as a independent patch and send when
I change MTK_IOMMU to tristate?

[1]
https://lore.kernel.org/linux-mediatek/1590826218-23653-14-git-send-email-yong.wu@mediatek.com/


> 
> Best regards,
> Krzysztof
> 
> 
> > 
> > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > ---
> > This patch has a little conflict with the mt8192 iommu patch which
> > delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
> > This patch rebase on the clean v5.11-rc1.
> > ---
> >  drivers/memory/Kconfig     | 2 +-
> >  include/soc/mediatek/smi.h | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> > index 3ea6913df176..d5f0f4680880 100644
> > --- a/drivers/memory/Kconfig
> > +++ b/drivers/memory/Kconfig
> > @@ -173,7 +173,7 @@ config JZ4780_NEMC
> >  	  memory devices such as NAND and SRAM.
> >  
> >  config MTK_SMI
> > -	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> > +	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> >  	depends on ARCH_MEDIATEK || COMPILE_TEST
> >  	help
> >  	  This driver is for the Memory Controller module in MediaTek SoCs,
> > diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
> > index 5a34b87d89e3..29e2fb8f33d6 100644
> > --- a/include/soc/mediatek/smi.h
> > +++ b/include/soc/mediatek/smi.h
> > @@ -9,7 +9,7 @@
> >  #include <linux/bitops.h>
> >  #include <linux/device.h>
> >  
> > -#ifdef CONFIG_MTK_SMI
> > +#if IS_ENABLED(CONFIG_MTK_SMI)

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-25  6:49       ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  6:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > 
> > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> 
> s/Fix/fix.
> 
> What error is being fixed here? How can I reproduce it? Aren't you just
> adjusting it to being buildable by module?

Sorry, I didn't copy the fail log here. This is the build log:

In file included from .../drivers/iommu/mtk_iommu.c:34:0:
.../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
element type 'struct mtk_smi_larb_iommu'
  struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];

Our iommu driver will use this structure. but it was contained by
"#ifdef CONFIG_MTK_SMI". thus I change it to "#if
IS_ENABLED(CONFIG_MTK_SMI)"

If reproducing it, we should change mtk-iommu to module_init[1]. and
switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
to m. we could get the fail log.

In this case, Should I squash this change into this patch? I though this
is a preparing patch and the fail is caused by MTK_SMI. thus I squash
that into this patch. or change it as a independent patch and send when
I change MTK_IOMMU to tristate?

[1]
https://lore.kernel.org/linux-mediatek/1590826218-23653-14-git-send-email-yong.wu@mediatek.com/


> 
> Best regards,
> Krzysztof
> 
> 
> > 
> > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > ---
> > This patch has a little conflict with the mt8192 iommu patch which
> > delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
> > This patch rebase on the clean v5.11-rc1.
> > ---
> >  drivers/memory/Kconfig     | 2 +-
> >  include/soc/mediatek/smi.h | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> > index 3ea6913df176..d5f0f4680880 100644
> > --- a/drivers/memory/Kconfig
> > +++ b/drivers/memory/Kconfig
> > @@ -173,7 +173,7 @@ config JZ4780_NEMC
> >  	  memory devices such as NAND and SRAM.
> >  
> >  config MTK_SMI
> > -	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> > +	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> >  	depends on ARCH_MEDIATEK || COMPILE_TEST
> >  	help
> >  	  This driver is for the Memory Controller module in MediaTek SoCs,
> > diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
> > index 5a34b87d89e3..29e2fb8f33d6 100644
> > --- a/include/soc/mediatek/smi.h
> > +++ b/include/soc/mediatek/smi.h
> > @@ -9,7 +9,7 @@
> >  #include <linux/bitops.h>
> >  #include <linux/device.h>
> >  
> > -#ifdef CONFIG_MTK_SMI
> > +#if IS_ENABLED(CONFIG_MTK_SMI)

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-25  6:49       ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  6:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > 
> > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> 
> s/Fix/fix.
> 
> What error is being fixed here? How can I reproduce it? Aren't you just
> adjusting it to being buildable by module?

Sorry, I didn't copy the fail log here. This is the build log:

In file included from .../drivers/iommu/mtk_iommu.c:34:0:
.../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
element type 'struct mtk_smi_larb_iommu'
  struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];

Our iommu driver will use this structure. but it was contained by
"#ifdef CONFIG_MTK_SMI". thus I change it to "#if
IS_ENABLED(CONFIG_MTK_SMI)"

If reproducing it, we should change mtk-iommu to module_init[1]. and
switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
to m. we could get the fail log.

In this case, Should I squash this change into this patch? I though this
is a preparing patch and the fail is caused by MTK_SMI. thus I squash
that into this patch. or change it as a independent patch and send when
I change MTK_IOMMU to tristate?

[1]
https://lore.kernel.org/linux-mediatek/1590826218-23653-14-git-send-email-yong.wu@mediatek.com/


> 
> Best regards,
> Krzysztof
> 
> 
> > 
> > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > ---
> > This patch has a little conflict with the mt8192 iommu patch which
> > delete the MTK_LARB_NR_MAX in smi.h(It's still reviewing).
> > This patch rebase on the clean v5.11-rc1.
> > ---
> >  drivers/memory/Kconfig     | 2 +-
> >  include/soc/mediatek/smi.h | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> > index 3ea6913df176..d5f0f4680880 100644
> > --- a/drivers/memory/Kconfig
> > +++ b/drivers/memory/Kconfig
> > @@ -173,7 +173,7 @@ config JZ4780_NEMC
> >  	  memory devices such as NAND and SRAM.
> >  
> >  config MTK_SMI
> > -	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> > +	tristate "Mediatek SoC Memory Controller driver" if COMPILE_TEST
> >  	depends on ARCH_MEDIATEK || COMPILE_TEST
> >  	help
> >  	  This driver is for the Memory Controller module in MediaTek SoCs,
> > diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h
> > index 5a34b87d89e3..29e2fb8f33d6 100644
> > --- a/include/soc/mediatek/smi.h
> > +++ b/include/soc/mediatek/smi.h
> > @@ -9,7 +9,7 @@
> >  #include <linux/bitops.h>
> >  #include <linux/device.h>
> >  
> > -#ifdef CONFIG_MTK_SMI
> > +#if IS_ENABLED(CONFIG_MTK_SMI)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
  2021-01-25  6:49       ` Yong Wu
  (?)
  (?)
@ 2021-01-25  8:40         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25  8:40 UTC (permalink / raw)
  To: Yong Wu
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > currently. Thus we don't have module_exit before. This patch adds
> > > module_exit and module_license. It is a preparing patch for supporting
> > > MTK_SMI could been built as a module.
> > > 
> > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > ---
> > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > > 
> > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > --- a/drivers/memory/mtk-smi.c
> > > +++ b/drivers/memory/mtk-smi.c
> > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > >  }
> > >  module_init(mtk_smi_init);
> > > +
> > > +static void __exit mtk_smi_exit(void)
> > > +{
> > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > +}
> > > +module_exit(mtk_smi_exit);
> > > +
> > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > 
> > Drivers do not use capital letters, so I have doubts whether this alias
> > is correct.
> 
> I didn't care the upper/lower-case. I will change to lower case in next
> time.

Then why do you need the alias? The name does not match driver name, so
what's the purpose of this alias/

> 
> MODULE_ALIAS("platform:MediaTek-smi")
> 
> > 
> > Adding all these should be squashed with changing Kconfig into tristate.
> > It does not have sense on its own.
> 
> Thanks  very much for review.
> 
> Only confirm: Squash whole this patch or only squash the MODULE_x into
> the next patch?

This entire patch 2/3 should be with 3/3.

Best regards,
Krzysztof

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25  8:40         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25  8:40 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > currently. Thus we don't have module_exit before. This patch adds
> > > module_exit and module_license. It is a preparing patch for supporting
> > > MTK_SMI could been built as a module.
> > > 
> > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > ---
> > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > > 
> > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > --- a/drivers/memory/mtk-smi.c
> > > +++ b/drivers/memory/mtk-smi.c
> > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > >  }
> > >  module_init(mtk_smi_init);
> > > +
> > > +static void __exit mtk_smi_exit(void)
> > > +{
> > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > +}
> > > +module_exit(mtk_smi_exit);
> > > +
> > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > 
> > Drivers do not use capital letters, so I have doubts whether this alias
> > is correct.
> 
> I didn't care the upper/lower-case. I will change to lower case in next
> time.

Then why do you need the alias? The name does not match driver name, so
what's the purpose of this alias/

> 
> MODULE_ALIAS("platform:MediaTek-smi")
> 
> > 
> > Adding all these should be squashed with changing Kconfig into tristate.
> > It does not have sense on its own.
> 
> Thanks  very much for review.
> 
> Only confirm: Squash whole this patch or only squash the MODULE_x into
> the next patch?

This entire patch 2/3 should be with 3/3.

Best regards,
Krzysztof
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25  8:40         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25  8:40 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > currently. Thus we don't have module_exit before. This patch adds
> > > module_exit and module_license. It is a preparing patch for supporting
> > > MTK_SMI could been built as a module.
> > > 
> > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > ---
> > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > > 
> > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > --- a/drivers/memory/mtk-smi.c
> > > +++ b/drivers/memory/mtk-smi.c
> > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > >  }
> > >  module_init(mtk_smi_init);
> > > +
> > > +static void __exit mtk_smi_exit(void)
> > > +{
> > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > +}
> > > +module_exit(mtk_smi_exit);
> > > +
> > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > 
> > Drivers do not use capital letters, so I have doubts whether this alias
> > is correct.
> 
> I didn't care the upper/lower-case. I will change to lower case in next
> time.

Then why do you need the alias? The name does not match driver name, so
what's the purpose of this alias/

> 
> MODULE_ALIAS("platform:MediaTek-smi")
> 
> > 
> > Adding all these should be squashed with changing Kconfig into tristate.
> > It does not have sense on its own.
> 
> Thanks  very much for review.
> 
> Only confirm: Squash whole this patch or only squash the MODULE_x into
> the next patch?

This entire patch 2/3 should be with 3/3.

Best regards,
Krzysztof

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25  8:40         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25  8:40 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > currently. Thus we don't have module_exit before. This patch adds
> > > module_exit and module_license. It is a preparing patch for supporting
> > > MTK_SMI could been built as a module.
> > > 
> > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > ---
> > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > > 
> > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > --- a/drivers/memory/mtk-smi.c
> > > +++ b/drivers/memory/mtk-smi.c
> > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > >  }
> > >  module_init(mtk_smi_init);
> > > +
> > > +static void __exit mtk_smi_exit(void)
> > > +{
> > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > +}
> > > +module_exit(mtk_smi_exit);
> > > +
> > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > 
> > Drivers do not use capital letters, so I have doubts whether this alias
> > is correct.
> 
> I didn't care the upper/lower-case. I will change to lower case in next
> time.

Then why do you need the alias? The name does not match driver name, so
what's the purpose of this alias/

> 
> MODULE_ALIAS("platform:MediaTek-smi")
> 
> > 
> > Adding all these should be squashed with changing Kconfig into tristate.
> > It does not have sense on its own.
> 
> Thanks  very much for review.
> 
> Only confirm: Squash whole this patch or only squash the MODULE_x into
> the next patch?

This entire patch 2/3 should be with 3/3.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
  2021-01-25  6:49       ` Yong Wu
  (?)
  (?)
@ 2021-01-25  8:44         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25  8:44 UTC (permalink / raw)
  To: Yong Wu
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Mon, Jan 25, 2021 at 02:49:44PM +0800, Yong Wu wrote:
> On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> > On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > > 
> > > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> > 
> > s/Fix/fix.
> > 
> > What error is being fixed here? How can I reproduce it? Aren't you just
> > adjusting it to being buildable by module?
> 
> Sorry, I didn't copy the fail log here. This is the build log:
> 
> In file included from .../drivers/iommu/mtk_iommu.c:34:0:
> .../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
> element type 'struct mtk_smi_larb_iommu'
>   struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
> 
> Our iommu driver will use this structure. but it was contained by
> "#ifdef CONFIG_MTK_SMI". thus I change it to "#if
> IS_ENABLED(CONFIG_MTK_SMI)"
> 
> If reproducing it, we should change mtk-iommu to module_init[1]. and
> switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
> to m. we could get the fail log.
> 
> In this case, Should I squash this change into this patch? I though this
> is a preparing patch and the fail is caused by MTK_SMI. thus I squash
> that into this patch. or change it as a independent patch and send when
> I change MTK_IOMMU to tristate?

If I understand correctly, there is no error before this patch. In such
case just don't mention the error to fix, because it is simply part of
making things modular.

Best regards,
Krzysztof


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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-25  8:44         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25  8:44 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Mon, Jan 25, 2021 at 02:49:44PM +0800, Yong Wu wrote:
> On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> > On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > > 
> > > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> > 
> > s/Fix/fix.
> > 
> > What error is being fixed here? How can I reproduce it? Aren't you just
> > adjusting it to being buildable by module?
> 
> Sorry, I didn't copy the fail log here. This is the build log:
> 
> In file included from .../drivers/iommu/mtk_iommu.c:34:0:
> .../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
> element type 'struct mtk_smi_larb_iommu'
>   struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
> 
> Our iommu driver will use this structure. but it was contained by
> "#ifdef CONFIG_MTK_SMI". thus I change it to "#if
> IS_ENABLED(CONFIG_MTK_SMI)"
> 
> If reproducing it, we should change mtk-iommu to module_init[1]. and
> switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
> to m. we could get the fail log.
> 
> In this case, Should I squash this change into this patch? I though this
> is a preparing patch and the fail is caused by MTK_SMI. thus I squash
> that into this patch. or change it as a independent patch and send when
> I change MTK_IOMMU to tristate?

If I understand correctly, there is no error before this patch. In such
case just don't mention the error to fix, because it is simply part of
making things modular.

Best regards,
Krzysztof

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-25  8:44         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25  8:44 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, Jan 25, 2021 at 02:49:44PM +0800, Yong Wu wrote:
> On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> > On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > > 
> > > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> > 
> > s/Fix/fix.
> > 
> > What error is being fixed here? How can I reproduce it? Aren't you just
> > adjusting it to being buildable by module?
> 
> Sorry, I didn't copy the fail log here. This is the build log:
> 
> In file included from .../drivers/iommu/mtk_iommu.c:34:0:
> .../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
> element type 'struct mtk_smi_larb_iommu'
>   struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
> 
> Our iommu driver will use this structure. but it was contained by
> "#ifdef CONFIG_MTK_SMI". thus I change it to "#if
> IS_ENABLED(CONFIG_MTK_SMI)"
> 
> If reproducing it, we should change mtk-iommu to module_init[1]. and
> switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
> to m. we could get the fail log.
> 
> In this case, Should I squash this change into this patch? I though this
> is a preparing patch and the fail is caused by MTK_SMI. thus I squash
> that into this patch. or change it as a independent patch and send when
> I change MTK_IOMMU to tristate?

If I understand correctly, there is no error before this patch. In such
case just don't mention the error to fix, because it is simply part of
making things modular.

Best regards,
Krzysztof


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-25  8:44         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25  8:44 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, Jan 25, 2021 at 02:49:44PM +0800, Yong Wu wrote:
> On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> > On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > > 
> > > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> > 
> > s/Fix/fix.
> > 
> > What error is being fixed here? How can I reproduce it? Aren't you just
> > adjusting it to being buildable by module?
> 
> Sorry, I didn't copy the fail log here. This is the build log:
> 
> In file included from .../drivers/iommu/mtk_iommu.c:34:0:
> .../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
> element type 'struct mtk_smi_larb_iommu'
>   struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
> 
> Our iommu driver will use this structure. but it was contained by
> "#ifdef CONFIG_MTK_SMI". thus I change it to "#if
> IS_ENABLED(CONFIG_MTK_SMI)"
> 
> If reproducing it, we should change mtk-iommu to module_init[1]. and
> switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
> to m. we could get the fail log.
> 
> In this case, Should I squash this change into this patch? I though this
> is a preparing patch and the fail is caused by MTK_SMI. thus I squash
> that into this patch. or change it as a independent patch and send when
> I change MTK_IOMMU to tristate?

If I understand correctly, there is no error before this patch. In such
case just don't mention the error to fix, because it is simply part of
making things modular.

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
  2021-01-25  8:40         ` Krzysztof Kozlowski
  (?)
  (?)
@ 2021-01-25  9:28           ` Yong Wu
  -1 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  9:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > currently. Thus we don't have module_exit before. This patch adds
> > > > module_exit and module_license. It is a preparing patch for supporting
> > > > MTK_SMI could been built as a module.
> > > > 
> > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > ---
> > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > >  1 file changed, 10 insertions(+)
> > > > 
> > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > --- a/drivers/memory/mtk-smi.c
> > > > +++ b/drivers/memory/mtk-smi.c
> > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > >  }
> > > >  module_init(mtk_smi_init);
> > > > +
> > > > +static void __exit mtk_smi_exit(void)
> > > > +{
> > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > +}
> > > > +module_exit(mtk_smi_exit);
> > > > +
> > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > 
> > > Drivers do not use capital letters, so I have doubts whether this alias
> > > is correct.
> > 
> > I didn't care the upper/lower-case. I will change to lower case in next
> > time.
> 
> Then why do you need the alias? The name does not match driver name, so
> what's the purpose of this alias/

I think it is not so necessary for us. I will delete this line in next
version.

Only curious what's alias is fit in our case? normally it should be the
file name: mtk-smi?

> 
> > 
> > MODULE_ALIAS("platform:MediaTek-smi")
> > 
> > > 
> > > Adding all these should be squashed with changing Kconfig into tristate.
> > > It does not have sense on its own.
> > 
> > Thanks  very much for review.
> > 
> > Only confirm: Squash whole this patch or only squash the MODULE_x into
> > the next patch?
> 
> This entire patch 2/3 should be with 3/3.

Thanks for the confirm.

> 
> Best regards,
> Krzysztof


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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25  9:28           ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  9:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > currently. Thus we don't have module_exit before. This patch adds
> > > > module_exit and module_license. It is a preparing patch for supporting
> > > > MTK_SMI could been built as a module.
> > > > 
> > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > ---
> > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > >  1 file changed, 10 insertions(+)
> > > > 
> > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > --- a/drivers/memory/mtk-smi.c
> > > > +++ b/drivers/memory/mtk-smi.c
> > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > >  }
> > > >  module_init(mtk_smi_init);
> > > > +
> > > > +static void __exit mtk_smi_exit(void)
> > > > +{
> > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > +}
> > > > +module_exit(mtk_smi_exit);
> > > > +
> > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > 
> > > Drivers do not use capital letters, so I have doubts whether this alias
> > > is correct.
> > 
> > I didn't care the upper/lower-case. I will change to lower case in next
> > time.
> 
> Then why do you need the alias? The name does not match driver name, so
> what's the purpose of this alias/

I think it is not so necessary for us. I will delete this line in next
version.

Only curious what's alias is fit in our case? normally it should be the
file name: mtk-smi?

> 
> > 
> > MODULE_ALIAS("platform:MediaTek-smi")
> > 
> > > 
> > > Adding all these should be squashed with changing Kconfig into tristate.
> > > It does not have sense on its own.
> > 
> > Thanks  very much for review.
> > 
> > Only confirm: Squash whole this patch or only squash the MODULE_x into
> > the next patch?
> 
> This entire patch 2/3 should be with 3/3.

Thanks for the confirm.

> 
> Best regards,
> Krzysztof

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25  9:28           ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  9:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > currently. Thus we don't have module_exit before. This patch adds
> > > > module_exit and module_license. It is a preparing patch for supporting
> > > > MTK_SMI could been built as a module.
> > > > 
> > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > ---
> > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > >  1 file changed, 10 insertions(+)
> > > > 
> > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > --- a/drivers/memory/mtk-smi.c
> > > > +++ b/drivers/memory/mtk-smi.c
> > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > >  }
> > > >  module_init(mtk_smi_init);
> > > > +
> > > > +static void __exit mtk_smi_exit(void)
> > > > +{
> > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > +}
> > > > +module_exit(mtk_smi_exit);
> > > > +
> > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > 
> > > Drivers do not use capital letters, so I have doubts whether this alias
> > > is correct.
> > 
> > I didn't care the upper/lower-case. I will change to lower case in next
> > time.
> 
> Then why do you need the alias? The name does not match driver name, so
> what's the purpose of this alias/

I think it is not so necessary for us. I will delete this line in next
version.

Only curious what's alias is fit in our case? normally it should be the
file name: mtk-smi?

> 
> > 
> > MODULE_ALIAS("platform:MediaTek-smi")
> > 
> > > 
> > > Adding all these should be squashed with changing Kconfig into tristate.
> > > It does not have sense on its own.
> > 
> > Thanks  very much for review.
> > 
> > Only confirm: Squash whole this patch or only squash the MODULE_x into
> > the next patch?
> 
> This entire patch 2/3 should be with 3/3.

Thanks for the confirm.

> 
> Best regards,
> Krzysztof

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25  9:28           ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25  9:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > currently. Thus we don't have module_exit before. This patch adds
> > > > module_exit and module_license. It is a preparing patch for supporting
> > > > MTK_SMI could been built as a module.
> > > > 
> > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > ---
> > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > >  1 file changed, 10 insertions(+)
> > > > 
> > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > --- a/drivers/memory/mtk-smi.c
> > > > +++ b/drivers/memory/mtk-smi.c
> > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > >  }
> > > >  module_init(mtk_smi_init);
> > > > +
> > > > +static void __exit mtk_smi_exit(void)
> > > > +{
> > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > +}
> > > > +module_exit(mtk_smi_exit);
> > > > +
> > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > 
> > > Drivers do not use capital letters, so I have doubts whether this alias
> > > is correct.
> > 
> > I didn't care the upper/lower-case. I will change to lower case in next
> > time.
> 
> Then why do you need the alias? The name does not match driver name, so
> what's the purpose of this alias/

I think it is not so necessary for us. I will delete this line in next
version.

Only curious what's alias is fit in our case? normally it should be the
file name: mtk-smi?

> 
> > 
> > MODULE_ALIAS("platform:MediaTek-smi")
> > 
> > > 
> > > Adding all these should be squashed with changing Kconfig into tristate.
> > > It does not have sense on its own.
> > 
> > Thanks  very much for review.
> > 
> > Only confirm: Squash whole this patch or only squash the MODULE_x into
> > the next patch?
> 
> This entire patch 2/3 should be with 3/3.

Thanks for the confirm.

> 
> Best regards,
> Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
  2021-01-25  8:44         ` Krzysztof Kozlowski
  (?)
  (?)
@ 2021-01-25 10:11           ` Yong Wu
  -1 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25 10:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Mon, 2021-01-25 at 09:44 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 02:49:44PM +0800, Yong Wu wrote:
> > On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> > > On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > > > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > > > 
> > > > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> > > 
> > > s/Fix/fix.
> > > 
> > > What error is being fixed here? How can I reproduce it? Aren't you just
> > > adjusting it to being buildable by module?
> > 
> > Sorry, I didn't copy the fail log here. This is the build log:
> > 
> > In file included from .../drivers/iommu/mtk_iommu.c:34:0:
> > .../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
> > element type 'struct mtk_smi_larb_iommu'
> >   struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
> > 
> > Our iommu driver will use this structure. but it was contained by
> > "#ifdef CONFIG_MTK_SMI". thus I change it to "#if
> > IS_ENABLED(CONFIG_MTK_SMI)"
> > 
> > If reproducing it, we should change mtk-iommu to module_init[1]. and
> > switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
> > to m. we could get the fail log.
> > 
> > In this case, Should I squash this change into this patch? I though this
> > is a preparing patch and the fail is caused by MTK_SMI. thus I squash
> > that into this patch. or change it as a independent patch and send when
> > I change MTK_IOMMU to tristate?
> 
> If I understand correctly, there is no error before this patch. In such
> case just don't mention the error to fix, because it is simply part of
> making things modular.

Yes. No error before this patch.

Appreciate for your help. I will remove this in the comment message in
the next version.

> 
> Best regards,
> Krzysztof
> 


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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-25 10:11           ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25 10:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Mon, 2021-01-25 at 09:44 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 02:49:44PM +0800, Yong Wu wrote:
> > On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> > > On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > > > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > > > 
> > > > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> > > 
> > > s/Fix/fix.
> > > 
> > > What error is being fixed here? How can I reproduce it? Aren't you just
> > > adjusting it to being buildable by module?
> > 
> > Sorry, I didn't copy the fail log here. This is the build log:
> > 
> > In file included from .../drivers/iommu/mtk_iommu.c:34:0:
> > .../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
> > element type 'struct mtk_smi_larb_iommu'
> >   struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
> > 
> > Our iommu driver will use this structure. but it was contained by
> > "#ifdef CONFIG_MTK_SMI". thus I change it to "#if
> > IS_ENABLED(CONFIG_MTK_SMI)"
> > 
> > If reproducing it, we should change mtk-iommu to module_init[1]. and
> > switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
> > to m. we could get the fail log.
> > 
> > In this case, Should I squash this change into this patch? I though this
> > is a preparing patch and the fail is caused by MTK_SMI. thus I squash
> > that into this patch. or change it as a independent patch and send when
> > I change MTK_IOMMU to tristate?
> 
> If I understand correctly, there is no error before this patch. In such
> case just don't mention the error to fix, because it is simply part of
> making things modular.

Yes. No error before this patch.

Appreciate for your help. I will remove this in the comment message in
the next version.

> 
> Best regards,
> Krzysztof
> 

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-25 10:11           ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25 10:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, 2021-01-25 at 09:44 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 02:49:44PM +0800, Yong Wu wrote:
> > On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> > > On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > > > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > > > 
> > > > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> > > 
> > > s/Fix/fix.
> > > 
> > > What error is being fixed here? How can I reproduce it? Aren't you just
> > > adjusting it to being buildable by module?
> > 
> > Sorry, I didn't copy the fail log here. This is the build log:
> > 
> > In file included from .../drivers/iommu/mtk_iommu.c:34:0:
> > .../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
> > element type 'struct mtk_smi_larb_iommu'
> >   struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
> > 
> > Our iommu driver will use this structure. but it was contained by
> > "#ifdef CONFIG_MTK_SMI". thus I change it to "#if
> > IS_ENABLED(CONFIG_MTK_SMI)"
> > 
> > If reproducing it, we should change mtk-iommu to module_init[1]. and
> > switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
> > to m. we could get the fail log.
> > 
> > In this case, Should I squash this change into this patch? I though this
> > is a preparing patch and the fail is caused by MTK_SMI. thus I squash
> > that into this patch. or change it as a independent patch and send when
> > I change MTK_IOMMU to tristate?
> 
> If I understand correctly, there is no error before this patch. In such
> case just don't mention the error to fix, because it is simply part of
> making things modular.

Yes. No error before this patch.

Appreciate for your help. I will remove this in the comment message in
the next version.

> 
> Best regards,
> Krzysztof
> 

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate
@ 2021-01-25 10:11           ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-25 10:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, 2021-01-25 at 09:44 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 02:49:44PM +0800, Yong Wu wrote:
> > On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
> > > On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
> > > > This patch switches MTK_SMI to tristate. Support it could be 'm'.
> > > > 
> > > > Meanwhile, Fix a build issue while MTK_SMI is built as module.
> > > 
> > > s/Fix/fix.
> > > 
> > > What error is being fixed here? How can I reproduce it? Aren't you just
> > > adjusting it to being buildable by module?
> > 
> > Sorry, I didn't copy the fail log here. This is the build log:
> > 
> > In file included from .../drivers/iommu/mtk_iommu.c:34:0:
> > .../drivers/iommu/mtk_iommu.h:84:28: error: array type has incomplete
> > element type 'struct mtk_smi_larb_iommu'
> >   struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
> > 
> > Our iommu driver will use this structure. but it was contained by
> > "#ifdef CONFIG_MTK_SMI". thus I change it to "#if
> > IS_ENABLED(CONFIG_MTK_SMI)"
> > 
> > If reproducing it, we should change mtk-iommu to module_init[1]. and
> > switch kconfig MTK_IOMMU to tristate, then change the CONFIG_MTK_IOMMU
> > to m. we could get the fail log.
> > 
> > In this case, Should I squash this change into this patch? I though this
> > is a preparing patch and the fail is caused by MTK_SMI. thus I squash
> > that into this patch. or change it as a independent patch and send when
> > I change MTK_IOMMU to tristate?
> 
> If I understand correctly, there is no error before this patch. In such
> case just don't mention the error to fix, because it is simply part of
> making things modular.

Yes. No error before this patch.

Appreciate for your help. I will remove this in the comment message in
the next version.

> 
> Best regards,
> Krzysztof
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
  2021-01-25  9:28           ` Yong Wu
  (?)
  (?)
@ 2021-01-25 10:40             ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25 10:40 UTC (permalink / raw)
  To: Yong Wu
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Mon, Jan 25, 2021 at 05:28:05PM +0800, Yong Wu wrote:
> On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> > On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > > currently. Thus we don't have module_exit before. This patch adds
> > > > > module_exit and module_license. It is a preparing patch for supporting
> > > > > MTK_SMI could been built as a module.
> > > > > 
> > > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > > ---
> > > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > > >  1 file changed, 10 insertions(+)
> > > > > 
> > > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > > --- a/drivers/memory/mtk-smi.c
> > > > > +++ b/drivers/memory/mtk-smi.c
> > > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > >  }
> > > > >  module_init(mtk_smi_init);
> > > > > +
> > > > > +static void __exit mtk_smi_exit(void)
> > > > > +{
> > > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > +}
> > > > > +module_exit(mtk_smi_exit);
> > > > > +
> > > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > > 
> > > > Drivers do not use capital letters, so I have doubts whether this alias
> > > > is correct.
> > > 
> > > I didn't care the upper/lower-case. I will change to lower case in next
> > > time.
> > 
> > Then why do you need the alias? The name does not match driver name, so
> > what's the purpose of this alias/
> 
> I think it is not so necessary for us. I will delete this line in next
> version.
> 
> Only curious what's alias is fit in our case? normally it should be the
> file name: mtk-smi?

If autoloading of your module works, then remove it. The alias is
necessary for some cases when a device table is missing (e.g. platform
driver is matched via devicetree but not having the platform_device_id
table) or matching is done via different method (e.g. driver is matched
from MFD via devicetree compatible even though there is a
platform_device_id table).

Best regards,
Krzysztof

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25 10:40             ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25 10:40 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Mon, Jan 25, 2021 at 05:28:05PM +0800, Yong Wu wrote:
> On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> > On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > > currently. Thus we don't have module_exit before. This patch adds
> > > > > module_exit and module_license. It is a preparing patch for supporting
> > > > > MTK_SMI could been built as a module.
> > > > > 
> > > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > > ---
> > > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > > >  1 file changed, 10 insertions(+)
> > > > > 
> > > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > > --- a/drivers/memory/mtk-smi.c
> > > > > +++ b/drivers/memory/mtk-smi.c
> > > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > >  }
> > > > >  module_init(mtk_smi_init);
> > > > > +
> > > > > +static void __exit mtk_smi_exit(void)
> > > > > +{
> > > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > +}
> > > > > +module_exit(mtk_smi_exit);
> > > > > +
> > > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > > 
> > > > Drivers do not use capital letters, so I have doubts whether this alias
> > > > is correct.
> > > 
> > > I didn't care the upper/lower-case. I will change to lower case in next
> > > time.
> > 
> > Then why do you need the alias? The name does not match driver name, so
> > what's the purpose of this alias/
> 
> I think it is not so necessary for us. I will delete this line in next
> version.
> 
> Only curious what's alias is fit in our case? normally it should be the
> file name: mtk-smi?

If autoloading of your module works, then remove it. The alias is
necessary for some cases when a device table is missing (e.g. platform
driver is matched via devicetree but not having the platform_device_id
table) or matching is done via different method (e.g. driver is matched
from MFD via devicetree compatible even though there is a
platform_device_id table).

Best regards,
Krzysztof
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25 10:40             ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25 10:40 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, Jan 25, 2021 at 05:28:05PM +0800, Yong Wu wrote:
> On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> > On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > > currently. Thus we don't have module_exit before. This patch adds
> > > > > module_exit and module_license. It is a preparing patch for supporting
> > > > > MTK_SMI could been built as a module.
> > > > > 
> > > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > > ---
> > > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > > >  1 file changed, 10 insertions(+)
> > > > > 
> > > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > > --- a/drivers/memory/mtk-smi.c
> > > > > +++ b/drivers/memory/mtk-smi.c
> > > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > >  }
> > > > >  module_init(mtk_smi_init);
> > > > > +
> > > > > +static void __exit mtk_smi_exit(void)
> > > > > +{
> > > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > +}
> > > > > +module_exit(mtk_smi_exit);
> > > > > +
> > > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > > 
> > > > Drivers do not use capital letters, so I have doubts whether this alias
> > > > is correct.
> > > 
> > > I didn't care the upper/lower-case. I will change to lower case in next
> > > time.
> > 
> > Then why do you need the alias? The name does not match driver name, so
> > what's the purpose of this alias/
> 
> I think it is not so necessary for us. I will delete this line in next
> version.
> 
> Only curious what's alias is fit in our case? normally it should be the
> file name: mtk-smi?

If autoloading of your module works, then remove it. The alias is
necessary for some cases when a device table is missing (e.g. platform
driver is matched via devicetree but not having the platform_device_id
table) or matching is done via different method (e.g. driver is matched
from MFD via devicetree compatible even though there is a
platform_device_id table).

Best regards,
Krzysztof

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-25 10:40             ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-25 10:40 UTC (permalink / raw)
  To: Yong Wu
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, Jan 25, 2021 at 05:28:05PM +0800, Yong Wu wrote:
> On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> > On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > > currently. Thus we don't have module_exit before. This patch adds
> > > > > module_exit and module_license. It is a preparing patch for supporting
> > > > > MTK_SMI could been built as a module.
> > > > > 
> > > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > > ---
> > > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > > >  1 file changed, 10 insertions(+)
> > > > > 
> > > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > > --- a/drivers/memory/mtk-smi.c
> > > > > +++ b/drivers/memory/mtk-smi.c
> > > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > >  }
> > > > >  module_init(mtk_smi_init);
> > > > > +
> > > > > +static void __exit mtk_smi_exit(void)
> > > > > +{
> > > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > +}
> > > > > +module_exit(mtk_smi_exit);
> > > > > +
> > > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > > 
> > > > Drivers do not use capital letters, so I have doubts whether this alias
> > > > is correct.
> > > 
> > > I didn't care the upper/lower-case. I will change to lower case in next
> > > time.
> > 
> > Then why do you need the alias? The name does not match driver name, so
> > what's the purpose of this alias/
> 
> I think it is not so necessary for us. I will delete this line in next
> version.
> 
> Only curious what's alias is fit in our case? normally it should be the
> file name: mtk-smi?

If autoloading of your module works, then remove it. The alias is
necessary for some cases when a device table is missing (e.g. platform
driver is matched via devicetree but not having the platform_device_id
table) or matching is done via different method (e.g. driver is matched
from MFD via devicetree compatible even though there is a
platform_device_id table).

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
  2021-01-25 10:40             ` Krzysztof Kozlowski
  (?)
  (?)
@ 2021-01-26  6:12               ` Yong Wu
  -1 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-26  6:12 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Matthias Brugger, Joerg Roedel, Robin Murphy, Will Deacon,
	Tomasz Figa, linux-mediatek, srv_heupstream, linux-kernel,
	linux-arm-kernel, iommu, youlin.pei, Nicolas Boichat, anan.sun,
	yi.kuo

On Mon, 2021-01-25 at 11:40 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 05:28:05PM +0800, Yong Wu wrote:
> > On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> > > On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > > > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > > > currently. Thus we don't have module_exit before. This patch adds
> > > > > > module_exit and module_license. It is a preparing patch for supporting
> > > > > > MTK_SMI could been built as a module.
> > > > > > 
> > > > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > > > ---
> > > > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > > > >  1 file changed, 10 insertions(+)
> > > > > > 
> > > > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > > > --- a/drivers/memory/mtk-smi.c
> > > > > > +++ b/drivers/memory/mtk-smi.c
> > > > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > >  }
> > > > > >  module_init(mtk_smi_init);
> > > > > > +
> > > > > > +static void __exit mtk_smi_exit(void)
> > > > > > +{
> > > > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > > +}
> > > > > > +module_exit(mtk_smi_exit);
> > > > > > +
> > > > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > > > 
> > > > > Drivers do not use capital letters, so I have doubts whether this alias
> > > > > is correct.
> > > > 
> > > > I didn't care the upper/lower-case. I will change to lower case in next
> > > > time.
> > > 
> > > Then why do you need the alias? The name does not match driver name, so
> > > what's the purpose of this alias/
> > 
> > I think it is not so necessary for us. I will delete this line in next
> > version.
> > 
> > Only curious what's alias is fit in our case? normally it should be the
> > file name: mtk-smi?
> 
> If autoloading of your module works, then remove it. The alias is
> necessary for some cases when a device table is missing (e.g. platform
> driver is matched via devicetree but not having the platform_device_id
> table) or matching is done via different method (e.g. driver is matched
> from MFD via devicetree compatible even though there is a
> platform_device_id table).

Thanks for explaination so detailly. v2 is sent just now.

> 
> Best regards,
> Krzysztof


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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-26  6:12               ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-26  6:12 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, linux-kernel, yi.kuo, Tomasz Figa, iommu,
	linux-mediatek, Matthias Brugger, Will Deacon, linux-arm-kernel

On Mon, 2021-01-25 at 11:40 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 05:28:05PM +0800, Yong Wu wrote:
> > On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> > > On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > > > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > > > currently. Thus we don't have module_exit before. This patch adds
> > > > > > module_exit and module_license. It is a preparing patch for supporting
> > > > > > MTK_SMI could been built as a module.
> > > > > > 
> > > > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > > > ---
> > > > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > > > >  1 file changed, 10 insertions(+)
> > > > > > 
> > > > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > > > --- a/drivers/memory/mtk-smi.c
> > > > > > +++ b/drivers/memory/mtk-smi.c
> > > > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > >  }
> > > > > >  module_init(mtk_smi_init);
> > > > > > +
> > > > > > +static void __exit mtk_smi_exit(void)
> > > > > > +{
> > > > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > > +}
> > > > > > +module_exit(mtk_smi_exit);
> > > > > > +
> > > > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > > > 
> > > > > Drivers do not use capital letters, so I have doubts whether this alias
> > > > > is correct.
> > > > 
> > > > I didn't care the upper/lower-case. I will change to lower case in next
> > > > time.
> > > 
> > > Then why do you need the alias? The name does not match driver name, so
> > > what's the purpose of this alias/
> > 
> > I think it is not so necessary for us. I will delete this line in next
> > version.
> > 
> > Only curious what's alias is fit in our case? normally it should be the
> > file name: mtk-smi?
> 
> If autoloading of your module works, then remove it. The alias is
> necessary for some cases when a device table is missing (e.g. platform
> driver is matched via devicetree but not having the platform_device_id
> table) or matching is done via different method (e.g. driver is matched
> from MFD via devicetree compatible even though there is a
> platform_device_id table).

Thanks for explaination so detailly. v2 is sent just now.

> 
> Best regards,
> Krzysztof

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-26  6:12               ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-26  6:12 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, 2021-01-25 at 11:40 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 05:28:05PM +0800, Yong Wu wrote:
> > On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> > > On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > > > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > > > currently. Thus we don't have module_exit before. This patch adds
> > > > > > module_exit and module_license. It is a preparing patch for supporting
> > > > > > MTK_SMI could been built as a module.
> > > > > > 
> > > > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > > > ---
> > > > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > > > >  1 file changed, 10 insertions(+)
> > > > > > 
> > > > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > > > --- a/drivers/memory/mtk-smi.c
> > > > > > +++ b/drivers/memory/mtk-smi.c
> > > > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > >  }
> > > > > >  module_init(mtk_smi_init);
> > > > > > +
> > > > > > +static void __exit mtk_smi_exit(void)
> > > > > > +{
> > > > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > > +}
> > > > > > +module_exit(mtk_smi_exit);
> > > > > > +
> > > > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > > > 
> > > > > Drivers do not use capital letters, so I have doubts whether this alias
> > > > > is correct.
> > > > 
> > > > I didn't care the upper/lower-case. I will change to lower case in next
> > > > time.
> > > 
> > > Then why do you need the alias? The name does not match driver name, so
> > > what's the purpose of this alias/
> > 
> > I think it is not so necessary for us. I will delete this line in next
> > version.
> > 
> > Only curious what's alias is fit in our case? normally it should be the
> > file name: mtk-smi?
> 
> If autoloading of your module works, then remove it. The alias is
> necessary for some cases when a device table is missing (e.g. platform
> driver is matched via devicetree but not having the platform_device_id
> table) or matching is done via different method (e.g. driver is matched
> from MFD via devicetree compatible even though there is a
> platform_device_id table).

Thanks for explaination so detailly. v2 is sent just now.

> 
> Best regards,
> Krzysztof

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license
@ 2021-01-26  6:12               ` Yong Wu
  0 siblings, 0 replies; 60+ messages in thread
From: Yong Wu @ 2021-01-26  6:12 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: youlin.pei, anan.sun, Nicolas Boichat, srv_heupstream,
	Robin Murphy, Joerg Roedel, linux-kernel, yi.kuo, Tomasz Figa,
	iommu, linux-mediatek, Matthias Brugger, Will Deacon,
	linux-arm-kernel

On Mon, 2021-01-25 at 11:40 +0100, Krzysztof Kozlowski wrote:
> On Mon, Jan 25, 2021 at 05:28:05PM +0800, Yong Wu wrote:
> > On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
> > > On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
> > > > On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
> > > > > On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
> > > > > > The config MTK_SMI always depends on MTK_IOMMU which is built-in
> > > > > > currently. Thus we don't have module_exit before. This patch adds
> > > > > > module_exit and module_license. It is a preparing patch for supporting
> > > > > > MTK_SMI could been built as a module.
> > > > > > 
> > > > > > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > > > > > ---
> > > > > >  drivers/memory/mtk-smi.c | 10 ++++++++++
> > > > > >  1 file changed, 10 insertions(+)
> > > > > > 
> > > > > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> > > > > > index e2aebd2bfa8e..aa2a25abf04f 100644
> > > > > > --- a/drivers/memory/mtk-smi.c
> > > > > > +++ b/drivers/memory/mtk-smi.c
> > > > > > @@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)
> > > > > >  	return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > >  }
> > > > > >  module_init(mtk_smi_init);
> > > > > > +
> > > > > > +static void __exit mtk_smi_exit(void)
> > > > > > +{
> > > > > > +	platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
> > > > > > +}
> > > > > > +module_exit(mtk_smi_exit);
> > > > > > +
> > > > > > +MODULE_DESCRIPTION("MediaTek SMI driver");
> > > > > > +MODULE_ALIAS("platform:MediaTek-SMI");
> > > > > 
> > > > > Drivers do not use capital letters, so I have doubts whether this alias
> > > > > is correct.
> > > > 
> > > > I didn't care the upper/lower-case. I will change to lower case in next
> > > > time.
> > > 
> > > Then why do you need the alias? The name does not match driver name, so
> > > what's the purpose of this alias/
> > 
> > I think it is not so necessary for us. I will delete this line in next
> > version.
> > 
> > Only curious what's alias is fit in our case? normally it should be the
> > file name: mtk-smi?
> 
> If autoloading of your module works, then remove it. The alias is
> necessary for some cases when a device table is missing (e.g. platform
> driver is matched via devicetree but not having the platform_device_id
> table) or matching is done via different method (e.g. driver is matched
> from MFD via devicetree compatible even though there is a
> platform_device_id table).

Thanks for explaination so detailly. v2 is sent just now.

> 
> Best regards,
> Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-01-26 20:21 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21  6:24 Support MTK_SMI modular Yong Wu
2021-01-21  6:24 ` Yong Wu
2021-01-21  6:24 ` Yong Wu
2021-01-21  6:24 ` Yong Wu
2021-01-21  6:24 ` [PATCH 1/3] memory: mtk-smi: Use platform_register_drivers Yong Wu
2021-01-21  6:24   ` Yong Wu
2021-01-21  6:24   ` Yong Wu
2021-01-21  6:24   ` Yong Wu
2021-01-22 21:31   ` Krzysztof Kozlowski
2021-01-22 21:31     ` Krzysztof Kozlowski
2021-01-22 21:31     ` Krzysztof Kozlowski
2021-01-22 21:31     ` Krzysztof Kozlowski
2021-01-21  6:24 ` [PATCH 2/3] memory: mtk-smi: Add module_exit and module_license Yong Wu
2021-01-21  6:24   ` Yong Wu
2021-01-21  6:24   ` Yong Wu
2021-01-21  6:24   ` Yong Wu
2021-01-22 21:34   ` Krzysztof Kozlowski
2021-01-22 21:34     ` Krzysztof Kozlowski
2021-01-22 21:34     ` Krzysztof Kozlowski
2021-01-22 21:34     ` Krzysztof Kozlowski
2021-01-25  6:49     ` Yong Wu
2021-01-25  6:49       ` Yong Wu
2021-01-25  6:49       ` Yong Wu
2021-01-25  6:49       ` Yong Wu
2021-01-25  8:40       ` Krzysztof Kozlowski
2021-01-25  8:40         ` Krzysztof Kozlowski
2021-01-25  8:40         ` Krzysztof Kozlowski
2021-01-25  8:40         ` Krzysztof Kozlowski
2021-01-25  9:28         ` Yong Wu
2021-01-25  9:28           ` Yong Wu
2021-01-25  9:28           ` Yong Wu
2021-01-25  9:28           ` Yong Wu
2021-01-25 10:40           ` Krzysztof Kozlowski
2021-01-25 10:40             ` Krzysztof Kozlowski
2021-01-25 10:40             ` Krzysztof Kozlowski
2021-01-25 10:40             ` Krzysztof Kozlowski
2021-01-26  6:12             ` Yong Wu
2021-01-26  6:12               ` Yong Wu
2021-01-26  6:12               ` Yong Wu
2021-01-26  6:12               ` Yong Wu
2021-01-21  6:24 ` [PATCH 3/3] memory: mtk-smi: Switch MTK_SMI to tristate Yong Wu
2021-01-21  6:24   ` Yong Wu
2021-01-21  6:24   ` Yong Wu
2021-01-21  6:24   ` Yong Wu
2021-01-22 21:35   ` Krzysztof Kozlowski
2021-01-22 21:35     ` Krzysztof Kozlowski
2021-01-22 21:35     ` Krzysztof Kozlowski
2021-01-22 21:35     ` Krzysztof Kozlowski
2021-01-25  6:49     ` Yong Wu
2021-01-25  6:49       ` Yong Wu
2021-01-25  6:49       ` Yong Wu
2021-01-25  6:49       ` Yong Wu
2021-01-25  8:44       ` Krzysztof Kozlowski
2021-01-25  8:44         ` Krzysztof Kozlowski
2021-01-25  8:44         ` Krzysztof Kozlowski
2021-01-25  8:44         ` Krzysztof Kozlowski
2021-01-25 10:11         ` Yong Wu
2021-01-25 10:11           ` Yong Wu
2021-01-25 10:11           ` Yong Wu
2021-01-25 10:11           ` Yong Wu

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.