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
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(-)
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(-)
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(+)
From: Krzysztof Kozlowski <krzk@kernel.org> Date: 2021-01-22 21:37:13
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(-)
From: Krzysztof Kozlowski <krzk@kernel.org> Date: 2021-01-22 21:39:18
On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
quoted hunk
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(+)
@@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)returnplatform_register_drivers(smidrivers,ARRAY_SIZE(smidrivers));}module_init(mtk_smi_init);++staticvoid__exitmtk_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
From: Krzysztof Kozlowski <krzk@kernel.org> Date: 2021-01-22 21:39:39
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
quoted hunk
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(-)
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:
quoted
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
quoted
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(-)
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:
quoted
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(+)
From: Krzysztof Kozlowski <krzk@kernel.org> Date: 2021-01-25 08:50:00
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:
quoted
On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
quoted
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(+)
@@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)returnplatform_register_drivers(smidrivers,ARRAY_SIZE(smidrivers));}module_init(mtk_smi_init);++staticvoid__exitmtk_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")
quoted
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
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:
quoted
On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
quoted
On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
quoted
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(+)
@@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)returnplatform_register_drivers(smidrivers,ARRAY_SIZE(smidrivers));}module_init(mtk_smi_init);++staticvoid__exitmtk_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?
quoted
MODULE_ALIAS("platform:MediaTek-smi")
quoted
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?
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:
quoted
On Mon, 2021-01-25 at 09:40 +0100, Krzysztof Kozlowski wrote:
quoted
On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
quoted
On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
quoted
On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
quoted
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(+)
@@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)returnplatform_register_drivers(smidrivers,ARRAY_SIZE(smidrivers));}module_init(mtk_smi_init);++staticvoid__exitmtk_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.
From: Krzysztof Kozlowski <krzk@kernel.org> Date: 2021-01-26 19:45:31
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:
quoted
On Mon, Jan 25, 2021 at 02:49:41PM +0800, Yong Wu wrote:
quoted
On Fri, 2021-01-22 at 22:34 +0100, Krzysztof Kozlowski wrote:
quoted
On Thu, Jan 21, 2021 at 02:24:28PM +0800, Yong Wu wrote:
quoted
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(+)
@@ -597,3 +597,13 @@ static int __init mtk_smi_init(void)returnplatform_register_drivers(smidrivers,ARRAY_SIZE(smidrivers));}module_init(mtk_smi_init);++staticvoid__exitmtk_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
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:
quoted
On Fri, 2021-01-22 at 22:35 +0100, Krzysztof Kozlowski wrote:
quoted
On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
quoted
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.
From: Krzysztof Kozlowski <krzk@kernel.org> Date: 2021-01-26 20:21:18
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:
quoted
On Thu, Jan 21, 2021 at 02:24:29PM +0800, Yong Wu wrote:
quoted
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