Skip to contentSkip to conversation

pinctrl: samsung: modularize samsung pinctrl driver

PATCH In review 구현기 3 participants 6 messages Nov 21, 2019 – Nov 27, 2019 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20191121072643epcas2p452071a503725c7764acf5084d24425b1@epcas2p4.samsung.com

구현기

author
#1 lore raw

PATCH 1/1 pinctrl: samsung: modularize samsung pinctrl driver

Enable samsung pinctrl driver to be compiled as modules.

Change-Id I92a9953c92831a316f7f50146898ff19831549ec
---
 drivers/pinctrl/samsung/Kconfig                |  5 +----
 drivers/pinctrl/samsung/Makefile               | 13 +++++++------
 drivers/pinctrl/samsung/pinctrl-exynos-arm.c   |  2 ++
 drivers/pinctrl/samsung/pinctrl-exynos-arm64.c |  2 ++
 drivers/pinctrl/samsung/pinctrl-exynos.c       |  2 ++
 drivers/pinctrl/samsung/pinctrl-samsung.c      | 13 +++++++++++++
 6 files changed, 27 insertions(+), 10 deletions(-)
(quoted diff) +0 -0

b/drivers/pinctrl/samsung/Kconfig
index 425fadd6c346..25e16984ef23 100644

drivers/pinctrl/samsung/Kconfig +1 -4
@@ -3,14 +3,13 @@
 # Samsung Pin control drivers
 #
 config PINCTRL_SAMSUNG
-	bool
+	tristate "Pinctrl driver data for Samsung SoCs"
 	select PINMUX
 	select PINCONF
 
 config PINCTRL_EXYNOS
 	bool "Pinctrl driver data for Samsung EXYNOS SoCs"
 	depends on OF && GPIOLIB && (ARCH_EXYNOS || ARCH_S5PV210)
-	select PINCTRL_SAMSUNG
 	select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
 	select PINCTRL_EXYNOS_ARM64 if ARM64 && ARCH_EXYNOS
 
@@ -25,9 +24,7 @@ config PINCTRL_EXYNOS_ARM64
 config PINCTRL_S3C24XX
 	bool "Samsung S3C24XX SoC pinctrl driver"
 	depends on ARCH_S3C24XX && OF
-	select PINCTRL_SAMSUNG
 
 config PINCTRL_S3C64XX
 	bool "Samsung S3C64XX SoC pinctrl driver"
 	depends on ARCH_S3C64XX
-	select PINCTRL_SAMSUNG
(quoted diff) +0 -0

b/drivers/pinctrl/samsung/Makefile
index ed951df6a112..b3ac01838b8a 100644

drivers/pinctrl/samsung/Makefile +4 -6
@@ -1,9 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 # Samsung pin control drivers
 
-obj-$(CONFIG_PINCTRL_SAMSUNG)	+= pinctrl-samsung.o
-obj-$(CONFIG_PINCTRL_EXYNOS)	+= pinctrl-exynos.o
-obj-$(CONFIG_PINCTRL_EXYNOS_ARM)	+= pinctrl-exynos-arm.o
-obj-$(CONFIG_PINCTRL_EXYNOS_ARM64)	+= pinctrl-exynos-arm64.o
-obj-$(CONFIG_PINCTRL_S3C24XX)	+= pinctrl-s3c24xx.o
-obj-$(CONFIG_PINCTRL_S3C64XX)	+= pinctrl-s3c64xx.o
+obj-$(CONFIG_PINCTRL_SAMSUNG)	+= pinctrl-samsung-super.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_SAMSUNG)	+= pinctrl-samsung.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS)	+= pinctrl-exynos.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS_ARM)	+= pinctrl-exynos-

arm.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS_ARM64) += pinctrl-exynos-
arm64.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_S3C24XX) += pinctrl-s3c24xx.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_S3C64XX) += pinctrl-s3c64xx.o

(quoted diff) +0 -0

b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c
index 85ddf49a5188..28906bf213c4 100644

drivers/pinctrl/samsung/pinctrl-exynos-arm.c +1 -0
@@ -14,6 +14,7 @@
 // external gpio and wakeup interrupt support.
 
 #include <linux/device.h>
+#include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/slab.h>
 #include <linux/err.h>
@@ -891,3 +892,4 @@ const struct samsung_pinctrl_of_match_data

exynos5420_of_data __initconst = {
.ctrl = exynos5420_pin_ctrl,
.num_ctrl = ARRAY_SIZE(exynos5420_pin_ctrl),
};
+MODULE_LICENSE("GPL");

(quoted diff) +0 -0

b/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
index b6e56422a700..2b19476ad5ff 100644

drivers/pinctrl/samsung/pinctrl-exynos-arm64.c +1 -0
@@ -14,6 +14,7 @@
 // external gpio and wakeup interrupt support.
 
 #include <linux/slab.h>
+#include <linux/module.h>
 #include <linux/soc/samsung/exynos-regs-pmu.h>
 
 #include "pinctrl-samsung.h"
@@ -422,3 +423,4 @@ const struct samsung_pinctrl_of_match_data

exynos7_of_data __initconst = {
.ctrl = exynos7_pin_ctrl,
.num_ctrl = ARRAY_SIZE(exynos7_pin_ctrl),
};
+MODULE_LICENSE("GPL");

(quoted diff) +0 -0

b/drivers/pinctrl/samsung/pinctrl-exynos.c
index ebc27b06718c..630d606330f1 100644

drivers/pinctrl/samsung/pinctrl-exynos.c +1 -0
@@ -18,6 +18,7 @@
 #include <linux/irqdomain.h>
 #include <linux/irq.h>
 #include <linux/irqchip/chained_irq.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_irq.h>
 #include <linux/slab.h>
@@ -713,3 +714,4 @@ exynos_retention_init(struct samsung_pinctrl_drv_data

*drvdata,

return ctrl;
}
+MODULE_LICENSE("GPL");

(quoted diff) +0 -0

b/drivers/pinctrl/samsung/pinctrl-samsung.c
index de0477bb469d..4483eaed27f8 100644

drivers/pinctrl/samsung/pinctrl-samsung.c +0 -0
@@ -15,6 +15,7 @@
 // but provides extensions to which platform specific implementation of

the gpio
// and wakeup interrupts can be hooked to.

+#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/io.h>
@@ -1275,6 +1276,7 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = {
#endif
{},
};
+MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match);

static const struct dev_pm_ops samsung_pinctrl_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(samsung_pinctrl_suspend,
@@ -1296,3 +1298,14 @@ static int __init samsung_pinctrl_drv_register(void)
return platform_driver_register(&samsung_pinctrl_driver);
}
postcore_initcall(samsung_pinctrl_drv_register);
+
+static void __exit samsung_pinctrl_drv_unregister(void)
+{
+ platform_driver_unregister(&samsung_pinctrl_driver);
+}
+module_exit(samsung_pinctrl_drv_unregister);
+
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Hyunki Koo <[email protected]>"); +MODULE_DESCRIPTION("Samsung Exynos PINCTRL driver");

Signature · 1 line
2.15.0.rc1
#2 lore raw

Hi,

Thanks for the patch. Few comments below:

Quoted 2 lines · 구현기

Enable samsung pinctrl driver to be compiled as modules.

Why? What's the benefit? Are platforms capable of such boot? Pinctrl is needed early - even before mounting rootfs...
What about module unloading? Is it reasonable?
Please answer to all this also in commit message.

Quoted 2 lines

Change-Id: I92a9953c92831a316f7f50146898ff19831549ec

This does not belong to Git.

Quoted 1 line

You "From" name is different than written here in Signed-off-by. They should match and I do not know Korean to be able to tell whether they really match or not :).
How about using Latin transliteration also in "From" field?

Quoted 62 lines
---
 drivers/pinctrl/samsung/Kconfig                |  5 +----
 drivers/pinctrl/samsung/Makefile               | 13 +++++++------
 drivers/pinctrl/samsung/pinctrl-exynos-arm.c   |  2 ++
 drivers/pinctrl/samsung/pinctrl-exynos-arm64.c |  2 ++
 drivers/pinctrl/samsung/pinctrl-exynos.c       |  2 ++
 drivers/pinctrl/samsung/pinctrl-samsung.c      | 13 +++++++++++++
 6 files changed, 27 insertions(+), 10 deletions(-)
drivers/pinctrl/samsung/Kconfig +1 -4
index 425fadd6c346..25e16984ef23 100644
@@ -3,14 +3,13 @@
 # Samsung Pin control drivers
 #
 config PINCTRL_SAMSUNG
-       bool
+       tristate "Pinctrl driver data for Samsung SoCs"
        select PINMUX
        select PINCONF
 
 config PINCTRL_EXYNOS
        bool "Pinctrl driver data for Samsung EXYNOS SoCs"
        depends on OF && GPIOLIB && (ARCH_EXYNOS || ARCH_S5PV210)
-       select PINCTRL_SAMSUNG
        select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
        select PINCTRL_EXYNOS_ARM64 if ARM64 && ARCH_EXYNOS
 
@@ -25,9 +24,7 @@ config PINCTRL_EXYNOS_ARM64
 config PINCTRL_S3C24XX
        bool "Samsung S3C24XX SoC pinctrl driver"
        depends on ARCH_S3C24XX && OF
-       select PINCTRL_SAMSUNG
 
 config PINCTRL_S3C64XX
        bool "Samsung S3C64XX SoC pinctrl driver"
        depends on ARCH_S3C64XX
-       select PINCTRL_SAMSUNG
drivers/pinctrl/samsung/Makefile +4 -6
index ed951df6a112..b3ac01838b8a 100644
@@ -1,9 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 # Samsung pin control drivers
 
-obj-$(CONFIG_PINCTRL_SAMSUNG)  += pinctrl-samsung.o
-obj-$(CONFIG_PINCTRL_EXYNOS)   += pinctrl-exynos.o
-obj-$(CONFIG_PINCTRL_EXYNOS_ARM)       += pinctrl-exynos-arm.o
-obj-$(CONFIG_PINCTRL_EXYNOS_ARM64)     += pinctrl-exynos-arm64.o
-obj-$(CONFIG_PINCTRL_S3C24XX)  += pinctrl-s3c24xx.o
-obj-$(CONFIG_PINCTRL_S3C64XX)  += pinctrl-s3c64xx.o
+obj-$(CONFIG_PINCTRL_SAMSUNG)  += pinctrl-samsung-super.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_SAMSUNG)        += pinctrl-samsung.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS) += pinctrl-exynos.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS_ARM)     += pinctrl-exynos-

arm.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS_ARM64) += pinctrl-exynos-
arm64.o

drivers/pinctrl/samsung/Makefile

Quoted 2 lines
drivers/pinctrl/samsung/Makefile +2 -0
+pinctrl-samsung-super-$(CONFIG_PINCTRL_S3C24XX)        += pinctrl-s3c24xx.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_S3C64XX)        += pinctrl-s3c64xx.o

I don't get why you need to rename obj to pinctrl-samsung-super?

Quoted 81 lines
drivers/pinctrl/samsung/pinctrl-exynos-arm.c +2 -0
index 85ddf49a5188..28906bf213c4 100644
@@ -14,6 +14,7 @@
 // external gpio and wakeup interrupt support.
 
 #include <linux/device.h>
+#include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/slab.h>
 #include <linux/err.h>
@@ -891,3 +892,4 @@ const struct samsung_pinctrl_of_match_data
 exynos5420_of_data __initconst = {
        .ctrl           = exynos5420_pin_ctrl,
        .num_ctrl       = ARRAY_SIZE(exynos5420_pin_ctrl),
 };
+MODULE_LICENSE("GPL");
drivers/pinctrl/samsung/pinctrl-exynos-arm64.c +2 -0
index b6e56422a700..2b19476ad5ff 100644
@@ -14,6 +14,7 @@
 // external gpio and wakeup interrupt support.
 
 #include <linux/slab.h>
+#include <linux/module.h>
 #include <linux/soc/samsung/exynos-regs-pmu.h>
 
 #include "pinctrl-samsung.h"
@@ -422,3 +423,4 @@ const struct samsung_pinctrl_of_match_data
 exynos7_of_data __initconst = {
        .ctrl           = exynos7_pin_ctrl,
        .num_ctrl       = ARRAY_SIZE(exynos7_pin_ctrl),
 };
+MODULE_LICENSE("GPL");
drivers/pinctrl/samsung/pinctrl-exynos.c +2 -0
index ebc27b06718c..630d606330f1 100644
@@ -18,6 +18,7 @@
 #include <linux/irqdomain.h>
 #include <linux/irq.h>
 #include <linux/irqchip/chained_irq.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_irq.h>
 #include <linux/slab.h>
@@ -713,3 +714,4 @@ exynos_retention_init(struct samsung_pinctrl_drv_data
 *drvdata,
 
        return ctrl;
 }
+MODULE_LICENSE("GPL");
drivers/pinctrl/samsung/pinctrl-samsung.c +0 -0
index de0477bb469d..4483eaed27f8 100644
@@ -15,6 +15,7 @@
 // but provides extensions to which platform specific implementation of

the gpio
// and wakeup interrupts can be hooked to.

drivers/pinctrl/samsung/pinctrl-samsung.c +2 -0
+#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
@@ -1275,6 +1276,7 @@ static const struct of_device_id
 samsung_pinctrl_dt_match[] = {
 #endif
        {},
 };
+MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match);
 
 static const struct dev_pm_ops samsung_pinctrl_pm_ops = {

SET_LATE_SYSTEM_SLEEP_PM_OPS(samsung_pinctrl_suspend,

drivers/pinctrl/samsung/pinctrl-samsung.c static int __init samsung_pinctrl_drv_register(void) · line 1306

Quoted 9 lines
drivers/pinctrl/samsung/pinctrl-samsung.c +6 -0
@@ -1296,3 +1298,14 @@ static int __init samsung_pinctrl_drv_register(void)
        return platform_driver_register(&samsung_pinctrl_driver);
 }
 postcore_initcall(samsung_pinctrl_drv_register);
+
+static void __exit samsung_pinctrl_drv_unregister(void)
+{
+       platform_driver_unregister(&samsung_pinctrl_driver);
+}
+module_exit(samsung_pinctrl_drv_unregister);

Since .suppress_bind_attrs are defined, I find it weird to be able to unload module... Another warning sign...

drivers/pinctrl/samsung/pinctrl-samsung.c static int __init samsung_pinctrl_drv_register(void) · line 1310

Quoted 4 lines
drivers/pinctrl/samsung/pinctrl-samsung.c +4 -0
+
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Hyunki Koo <[email protected]>");

I cannot find any contributions to this file from you. The author should be the main contributor(s). You need to go through history...

drivers/pinctrl/samsung/pinctrl-samsung.c static int __init samsung_pinctrl_drv_register(void) · line 1311

Quoted 1 line
drivers/pinctrl/samsung/pinctrl-samsung.c +1 -0
+MODULE_DESCRIPTION("Samsung Exynos PINCTRL driver");

That's not Exynos but Samsung-generic part... Samsung Exynos/S3C/S5P pinctrl driver.

Best regards,
Krzysztof

author
#3 lore raw
Quoted 4 lines · Krzysztof Kozlowski

Hi,

Thanks for the patch. Few comments below:

Quoted 8 lines
Quoted 2 lines · 구현기

Enable samsung pinctrl driver to be compiled as modules.

Why? What's the benefit? Are platforms capable of such boot? Pinctrl is needed early - even before mounting rootfs... What about module unloading? Is it reasonable?
Please answer to all this also in commit message.

Sorry to late and Thank you for your comment, I would like to apply GKI on the pinctrl driver So I would like to cut off dependency from ARCH_EXYNOS.
I will split into two part,
First, cut off the dependency with ARCH_EXYNOS in arch/arm64/Kconfig.platform. Second, I will make the pinctrl driver as a module.

Quoted 67 lines
Quoted 2 lines

Change-Id: I92a9953c92831a316f7f50146898ff19831549ec

This does not belong to Git.

Quoted 1 line

You "From" name is different than written here in Signed-off-by. They should match and I do not know Korean to be able to tell whether they really match or not :). How about using Latin transliteration also in "From" field?

Quoted 57 lines
---
 drivers/pinctrl/samsung/Kconfig                |  5 +----
 drivers/pinctrl/samsung/Makefile               | 13 +++++++------
 drivers/pinctrl/samsung/pinctrl-exynos-arm.c   |  2 ++
 drivers/pinctrl/samsung/pinctrl-exynos-arm64.c |  2 ++
 drivers/pinctrl/samsung/pinctrl-exynos.c       |  2 ++
 drivers/pinctrl/samsung/pinctrl-samsung.c      | 13 +++++++++++++
 6 files changed, 27 insertions(+), 10 deletions(-)
(quoted diff) +0 -0

b/drivers/pinctrl/samsung/Kconfig index 425fadd6c346..25e16984ef23 100644

drivers/pinctrl/samsung/Kconfig +1 -4
@@ -3,14 +3,13 @@
 # Samsung Pin control drivers
 #
 config PINCTRL_SAMSUNG
-       bool
+       tristate "Pinctrl driver data for Samsung SoCs"
        select PINMUX
        select PINCONF
 
 config PINCTRL_EXYNOS
        bool "Pinctrl driver data for Samsung EXYNOS SoCs"
        depends on OF && GPIOLIB && (ARCH_EXYNOS || ARCH_S5PV210)
-       select PINCTRL_SAMSUNG
        select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
        select PINCTRL_EXYNOS_ARM64 if ARM64 && ARCH_EXYNOS
 
@@ -25,9 +24,7 @@ config PINCTRL_EXYNOS_ARM64  config PINCTRL_S3C24XX
        bool "Samsung S3C24XX SoC pinctrl driver"
        depends on ARCH_S3C24XX && OF
-       select PINCTRL_SAMSUNG
 
 config PINCTRL_S3C64XX
        bool "Samsung S3C64XX SoC pinctrl driver"
        depends on ARCH_S3C64XX
-       select PINCTRL_SAMSUNG
drivers/pinctrl/samsung/Makefile +3 -6
index ed951df6a112..b3ac01838b8a 100644
@@ -1,9 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 # Samsung pin control drivers
 
-obj-$(CONFIG_PINCTRL_SAMSUNG)  += pinctrl-samsung.o
-obj-$(CONFIG_PINCTRL_EXYNOS)   += pinctrl-exynos.o
-obj-$(CONFIG_PINCTRL_EXYNOS_ARM)       += pinctrl-exynos-arm.o
-obj-$(CONFIG_PINCTRL_EXYNOS_ARM64)     += pinctrl-exynos-arm64.o
-obj-$(CONFIG_PINCTRL_S3C24XX)  += pinctrl-s3c24xx.o
-obj-$(CONFIG_PINCTRL_S3C64XX)  += pinctrl-s3c64xx.o
+obj-$(CONFIG_PINCTRL_SAMSUNG)  += pinctrl-samsung-super.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_SAMSUNG)        += pinctrl-samsung.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS) += pinctrl-exynos.o
Quoted 8 lines

drivers/pinctrl/samsung/Makefile

Quoted 6 lines
drivers/pinctrl/samsung/Makefile +1 -0
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS_ARM)     += pinctrl-exynos-

arm.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS_ARM64) += pinctrl-exynos-
arm64.o

drivers/pinctrl/samsung/Makefile +2 -0
+pinctrl-samsung-super-$(CONFIG_PINCTRL_S3C24XX)        += pinctrl-s3c24xx.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_S3C64XX)        += pinctrl-s3c64xx.o

I don't get why you need to rename obj to pinctrl-samsung-super?

I would like to make pinctrl as a super module. It is many dependency between pinctrl-exynos, pinctr-exynos-arm64 and pinctrl-samsung

Quoted 77 lines
Quoted 77 lines
drivers/pinctrl/samsung/pinctrl-exynos-arm.c +2 -0
index 85ddf49a5188..28906bf213c4 100644
@@ -14,6 +14,7 @@
 // external gpio and wakeup interrupt support.
 
 #include <linux/device.h>
+#include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/slab.h>
 #include <linux/err.h>
@@ -891,3 +892,4 @@ const struct samsung_pinctrl_of_match_data 
 exynos5420_of_data __initconst = {
        .ctrl           = exynos5420_pin_ctrl,
        .num_ctrl       = ARRAY_SIZE(exynos5420_pin_ctrl),
 };
+MODULE_LICENSE("GPL");
drivers/pinctrl/samsung/pinctrl-exynos-arm64.c +2 -0
index b6e56422a700..2b19476ad5ff 100644
@@ -14,6 +14,7 @@
 // external gpio and wakeup interrupt support.
 
 #include <linux/slab.h>
+#include <linux/module.h>
 #include <linux/soc/samsung/exynos-regs-pmu.h>
 
 #include "pinctrl-samsung.h"
@@ -422,3 +423,4 @@ const struct samsung_pinctrl_of_match_data 
 exynos7_of_data __initconst = {
        .ctrl           = exynos7_pin_ctrl,
        .num_ctrl       = ARRAY_SIZE(exynos7_pin_ctrl),
 };
+MODULE_LICENSE("GPL");
drivers/pinctrl/samsung/pinctrl-exynos.c +2 -0
index ebc27b06718c..630d606330f1 100644
@@ -18,6 +18,7 @@
 #include <linux/irqdomain.h>
 #include <linux/irq.h>
 #include <linux/irqchip/chained_irq.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_irq.h>
 #include <linux/slab.h>
@@ -713,3 +714,4 @@ exynos_retention_init(struct 
 samsung_pinctrl_drv_data *drvdata,
 
        return ctrl;
 }
+MODULE_LICENSE("GPL");
drivers/pinctrl/samsung/pinctrl-samsung.c +0 -0
index de0477bb469d..4483eaed27f8 100644
@@ -15,6 +15,7 @@
 // but provides extensions to which platform specific implementation 

of the gpio // and wakeup interrupts can be hooked to.

drivers/pinctrl/samsung/pinctrl-samsung.c +1 -0
+#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
@@ -1275,6 +1276,7 @@ static const struct of_device_id 

samsung_pinctrl_dt_match[] = { #endif

        {},

};
+MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match);

Quoted 14 lines

drivers/pinctrl/samsung/pinctrl-samsung.c static int __init samsung_pinctrl_drv_register(void) · line 1306

Quoted 12 lines

static const struct dev_pm_ops samsung_pinctrl_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(samsung_pinctrl_suspend,

drivers/pinctrl/samsung/pinctrl-samsung.c +6 -0
@@ -1296,3 +1298,14 @@ static int __init samsung_pinctrl_drv_register(void)
        return platform_driver_register(&samsung_pinctrl_driver);
 }
 postcore_initcall(samsung_pinctrl_drv_register);
+
+static void __exit samsung_pinctrl_drv_unregister(void)
+{
+       platform_driver_unregister(&samsung_pinctrl_driver);
+}
+module_exit(samsung_pinctrl_drv_unregister);

Since .suppress_bind_attrs are defined, I find it weird to be able to unload module... Another warning sign...

Okay I will apply your comment

Quoted 8 lines

drivers/pinctrl/samsung/pinctrl-samsung.c static int __init samsung_pinctrl_drv_register(void) · line 1310

Quoted 5 lines
drivers/pinctrl/samsung/pinctrl-samsung.c +4 -0
+
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Hyunki Koo <[email protected]>");

I cannot find any contributions to this file from you. The author should be the main contributor(s). You need to go through history...

Quoted 4 lines

drivers/pinctrl/samsung/pinctrl-samsung.c static int __init samsung_pinctrl_drv_register(void) · line 1311

Quoted 1 line
drivers/pinctrl/samsung/pinctrl-samsung.c +1 -0
+MODULE_DESCRIPTION("Samsung Exynos PINCTRL driver");

That's not Exynos but Samsung-generic part... Samsung Exynos/S3C/S5P pinctrl driver.

Okay I will apply your comment

#4 lore raw
Quoted 10 lines · Hyunki Koo
Quoted 8 lines · Krzysztof Kozlowski

Hi,

Thanks for the patch. Few comments below:

Quoted 2 lines · 구현기

Enable samsung pinctrl driver to be compiled as modules.

Quoted 7 lines
Quoted 4 lines

Why? What's the benefit? Are platforms capable of such boot? Pinctrl is needed early - even before mounting rootfs... What about module unloading? Is it reasonable?
Please answer to all this also in commit message.

Sorry to late and Thank you for your comment, I would like to apply GKI on the pinctrl driver So I would like to cut off dependency from ARCH_EXYNOS.

This is driver for Exynos and S3C so why cutting off the dependency? I mean, wait, it is a driver for Exynos so it cannot work on other boards...

Quoted 3 lines

I will split into two part,
First, cut off the dependency with ARCH_EXYNOS in arch/arm64/Kconfig.platform. Second, I will make the pinctrl driver as a module.

Then you are doing it in wrong order - this patch makes it as a module but you send it as first one.

You did not resolve however my questions about:
1. Will this even work? Will platforms boot?
2. How are you going to handle module unloading since on purpose we added suppress_bind?

Quoted 77 lines
Quoted 68 lines
Quoted 3 lines

Change-Id: I92a9953c92831a316f7f50146898ff19831549ec

This does not belong to Git.

Quoted 1 line

You "From" name is different than written here in Signed-off-by. They should match and I do not know Korean to be able to tell whether they really match or not :). How about using Latin transliteration also in "From" field?

Quoted 57 lines
---
 drivers/pinctrl/samsung/Kconfig                |  5 +----
 drivers/pinctrl/samsung/Makefile               | 13 +++++++------
 drivers/pinctrl/samsung/pinctrl-exynos-arm.c   |  2 ++
 drivers/pinctrl/samsung/pinctrl-exynos-arm64.c |  2 ++
 drivers/pinctrl/samsung/pinctrl-exynos.c       |  2 ++
 drivers/pinctrl/samsung/pinctrl-samsung.c      | 13 +++++++++++++
 6 files changed, 27 insertions(+), 10 deletions(-)
(quoted diff) +0 -0

b/drivers/pinctrl/samsung/Kconfig index 425fadd6c346..25e16984ef23 100644

drivers/pinctrl/samsung/Kconfig +1 -4
@@ -3,14 +3,13 @@
 # Samsung Pin control drivers
 #
 config PINCTRL_SAMSUNG
-       bool
+       tristate "Pinctrl driver data for Samsung SoCs"
        select PINMUX
        select PINCONF
 
 config PINCTRL_EXYNOS
        bool "Pinctrl driver data for Samsung EXYNOS SoCs"
        depends on OF && GPIOLIB && (ARCH_EXYNOS || ARCH_S5PV210)
-       select PINCTRL_SAMSUNG
        select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
        select PINCTRL_EXYNOS_ARM64 if ARM64 && ARCH_EXYNOS
 
@@ -25,9 +24,7 @@ config PINCTRL_EXYNOS_ARM64  config PINCTRL_S3C24XX
        bool "Samsung S3C24XX SoC pinctrl driver"
        depends on ARCH_S3C24XX && OF
-       select PINCTRL_SAMSUNG
 
 config PINCTRL_S3C64XX
        bool "Samsung S3C64XX SoC pinctrl driver"
        depends on ARCH_S3C64XX
-       select PINCTRL_SAMSUNG
drivers/pinctrl/samsung/Makefile +3 -6
index ed951df6a112..b3ac01838b8a 100644
@@ -1,9 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 # Samsung pin control drivers
 
-obj-$(CONFIG_PINCTRL_SAMSUNG)  += pinctrl-samsung.o
-obj-$(CONFIG_PINCTRL_EXYNOS)   += pinctrl-exynos.o
-obj-$(CONFIG_PINCTRL_EXYNOS_ARM)       += pinctrl-exynos-arm.o
-obj-$(CONFIG_PINCTRL_EXYNOS_ARM64)     += pinctrl-exynos-arm64.o
-obj-$(CONFIG_PINCTRL_S3C24XX)  += pinctrl-s3c24xx.o
-obj-$(CONFIG_PINCTRL_S3C64XX)  += pinctrl-s3c64xx.o
+obj-$(CONFIG_PINCTRL_SAMSUNG)  += pinctrl-samsung-super.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_SAMSUNG)        += pinctrl-samsung.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS) += pinctrl-exynos.o
Quoted 8 lines

drivers/pinctrl/samsung/Makefile

Quoted 6 lines
drivers/pinctrl/samsung/Makefile +1 -0
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS_ARM)     += pinctrl-exynos-

arm.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_EXYNOS_ARM64) += pinctrl-exynos-
arm64.o

drivers/pinctrl/samsung/Makefile +2 -0
+pinctrl-samsung-super-$(CONFIG_PINCTRL_S3C24XX)        += pinctrl-s3c24xx.o
+pinctrl-samsung-super-$(CONFIG_PINCTRL_S3C64XX)        += pinctrl-s3c64xx.o

I don't get why you need to rename obj to pinctrl-samsung-super?

Quoted 1 line

I would like to make pinctrl as a super module. It is many dependency between pinctrl-exynos, pinctr-exynos-arm64 and pinctrl-samsung

Might be a stupid question but what is "Super module"?

Second, the dependencies are there because this is a integral part of them.

I think I miss some bigger picture here because I still do not understand what you want to achieve in the end (why doing this)?

Best regards,
Krzysztof

#5 lore raw
Quoted 17 lines · Krzysztof Kozlowski
Quoted 15 lines · Hyunki Koo
Quoted 12 lines · Krzysztof Kozlowski

Hi,

Thanks for the patch. Few comments below:

Quoted 2 lines · 구현기

Enable samsung pinctrl driver to be compiled as modules.

Why? What's the benefit? Are platforms capable of such boot? Pinctrl is needed early - even before mounting rootfs... What about module unloading? Is it reasonable?
Please answer to all this also in commit message.

Quoted 6 lines
Quoted 2 lines

Sorry to late and Thank you for your comment, I would like to apply GKI on the pinctrl driver So I would like to cut off dependency from ARCH_EXYNOS.

This is driver for Exynos and S3C so why cutting off the dependency? I mean, wait, it is a driver for Exynos so it cannot work on other boards...

One more thought about Generic Kernel Image for Android. It implies that vendor stuff will be in modules... but only for out-of-tree code. The Exynos pinctrl driver is already in mainline so moving it into module is not necessary.

As for dependency on ARCH_EXYNOS - I do not get why this is a problem. ARCH_EXYNOS is multiplatform ready so you can boot multi_v7... What would be the benefit of removing this dependency?

Best regards,
Krzysztof

#6 lore raw
In reply to Hyunki Koo
Quoted 2 lines · Hyunki Koo

I would like to apply GKI on the pinctrl driver So I would like to cut off dependency from ARCH_EXYNOS.

If the pins need to be configured for the system to boot that needs to be in the big kernel image anyway. And then it should be bool.

Example: to mount the root filesystem on external flash pin configuration needs to happen.

There is a slight paradigm shift sometimes: in distribution kernels it might be required that necessary modules are included in an initramfs attached to the kernel. I do not know if we want to encourage that type of configuration for embedded ARM.

Yours,
Linus Walleij