From 9b4428f7b6dac45541175d89a2693032c6bb31d0 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Thu, 30 Apr 2020 09:58:16 +0800 Subject: [PATCH 01/34] clocksource: Call clocksource_done_booting() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y Make sure subsys initcall fast. Change-Id: Ib197b79477afaa6af6b35aeefab53137ee9f6749 Signed-off-by: Tao Huang --- kernel/time/clocksource.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index a3650699463b..a0a8370e06b6 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -1073,7 +1073,11 @@ static int __init clocksource_done_booting(void) mutex_unlock(&clocksource_mutex); return 0; } +#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT +pure_initcall(clocksource_done_booting); +#else fs_initcall(clocksource_done_booting); +#endif /* * Enqueue the clocksource sorted by rating From 936063c3326b91ac24ff649012b7986bb91a01c7 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sun, 26 Apr 2020 20:51:27 +0800 Subject: [PATCH 02/34] iio: adc: rockchip_saradc: Call rockchip_saradc_driver_init() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y Moving rockchip_saradc_driver_init() to the fs_initcall level. Before adc_keys_driver_init(). Change-Id: I63ec4bd84ba1c9bd63359b2efc9559949d6311c7 Signed-off-by: Tao Huang --- drivers/iio/adc/rockchip_saradc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c index c90aeddd5e9f..57e2f3b082ca 100644 --- a/drivers/iio/adc/rockchip_saradc.c +++ b/drivers/iio/adc/rockchip_saradc.c @@ -981,7 +981,21 @@ static struct platform_driver rockchip_saradc_driver = { }, }; +#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT +static int __init rockchip_saradc_driver_init(void) +{ + return platform_driver_register(&rockchip_saradc_driver); +} +fs_initcall(rockchip_saradc_driver_init); + +static void __exit rockchip_saradc_driver_exit(void) +{ + platform_driver_unregister(&rockchip_saradc_driver); +} +module_exit(rockchip_saradc_driver_exit); +#else module_platform_driver(rockchip_saradc_driver); +#endif MODULE_AUTHOR("Heiko Stuebner "); MODULE_DESCRIPTION("Rockchip SARADC driver"); From a22a2f016fd19dedb5fcce032af03904612114ae Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sun, 26 Apr 2020 20:38:09 +0800 Subject: [PATCH 03/34] regulator: pwm: Call pwm_regulator_driver_init() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y Regulator init on subsys_initcall_sync level. Change-Id: I477e8282dfb4582ac29f1b789a286c5d5ed7c60c Signed-off-by: Tao Huang --- drivers/regulator/pwm-regulator.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c index cfae5de4dfcb..3a458c3bb02b 100644 --- a/drivers/regulator/pwm-regulator.c +++ b/drivers/regulator/pwm-regulator.c @@ -416,7 +416,21 @@ static struct platform_driver pwm_regulator_driver = { .probe = pwm_regulator_probe, }; +#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT +static int __init pwm_regulator_driver_init(void) +{ + return platform_driver_register(&pwm_regulator_driver); +} +subsys_initcall_sync(pwm_regulator_driver_init); + +static void __exit pwm_regulator_driver_exit(void) +{ + platform_driver_unregister(&pwm_regulator_driver); +} +module_exit(pwm_regulator_driver_exit); +#else module_platform_driver(pwm_regulator_driver); +#endif MODULE_LICENSE("GPL"); MODULE_AUTHOR("Lee Jones "); From 0ec605a38307cdcbdb96b90c2ee04b9531b3546f Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 15 Apr 2025 15:39:08 +0800 Subject: [PATCH 04/34] iommu/rockchip: Call rk_iommu_init() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y Moving rk_iommu_init() to the subsys_initcall level. Before rga_init() etc. Change-Id: I050b96eb93f1fcb0fe12e12cbf95eb778678f44c Signed-off-by: Tao Huang --- drivers/iommu/rockchip-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index c48af6b2d865..f53b2041518e 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1827,7 +1827,7 @@ static struct platform_driver rk_iommu_driver = { }, }; -#ifdef CONFIG_VIDEO_REVERSE_IMAGE +#if defined(CONFIG_VIDEO_REVERSE_IMAGE) || defined(CONFIG_ROCKCHIP_THUNDER_BOOT) static int __init rk_iommu_init(void) { return platform_driver_register(&rk_iommu_driver); From 439b8b9cc8e2810571eb4957d500212cfbdb7c02 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Thu, 23 Apr 2020 19:58:06 +0800 Subject: [PATCH 05/34] drm/panel: simple: Call panel_simple_init() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y Moving panel_simple_init() to the rootfs_initcall level. Before rockchip_drm_init(). Change-Id: If74f0888e0120189b58c8eb96485eb3c9ada7e4f Signed-off-by: Tao Huang --- drivers/gpu/drm/panel/panel-simple.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index a36e83a0c913..6b8e7f3faba0 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -5312,7 +5312,11 @@ err_did_platform_register: return err; } +#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT +rootfs_initcall(panel_simple_init); +#else module_init(panel_simple_init); +#endif static void __exit panel_simple_exit(void) { From 081aacf209eaf1c6061f0db4c1f936ec3770a2e3 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 16 Apr 2025 17:02:13 +0800 Subject: [PATCH 06/34] dmaengine: rockchip-dma: Call rk_pdma_driver_init() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y Moving rk_pdma_driver_init() to the arch_initcall_sync level. Before rk3x_i2c_driver_init() etc. Change-Id: Iafcb84b1537453ffb295bb7722d4455e75657e9c Signed-off-by: Tao Huang --- drivers/dma/rockchip-dma.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/dma/rockchip-dma.c b/drivers/dma/rockchip-dma.c index e38820e4b780..bb0cecc562fe 100644 --- a/drivers/dma/rockchip-dma.c +++ b/drivers/dma/rockchip-dma.c @@ -1353,7 +1353,21 @@ static struct platform_driver rk_pdma_driver = { .remove = rk_dma_remove, }; +#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT +static int __init rk_pdma_driver_init(void) +{ + return platform_driver_register(&rk_pdma_driver); +} +arch_initcall_sync(rk_pdma_driver_init); + +static void __exit rk_pdma_driver_exit(void) +{ + platform_driver_unregister(&rk_pdma_driver); +} +module_exit(rk_pdma_driver_exit); +#else module_platform_driver(rk_pdma_driver); +#endif MODULE_DESCRIPTION("Rockchip DMA Driver"); MODULE_AUTHOR("Sugar.Zhang@rock-chips.com"); From 688b53c7af9d2e250b493589a4e8336cdfbed26d Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sun, 26 Apr 2020 20:30:02 +0800 Subject: [PATCH 07/34] pwm: Call pwm_sysfs_init() early when CONFIG_INITCALL_ASYNC=y rockchip_pwm_driver_init() -> rockchip_pwm_probe() -> devm_pwmchip_add() -> pwmchip_add() -> pwmchip_sysfs_export() pwmchip_sysfs_export() depends on pwm_sysfs_init() to init pwm_class. But rockchip_pwm_driver_init() and pwm_sysfs_init() are both in the same subsys_initcall level. Fix this by move pwm_sysfs_init() to the postcore_initcall level. Change-Id: If865768904be463732a5d2cb9f6ee2e9b333c0b3 Signed-off-by: Tao Huang --- drivers/pwm/sysfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c index aa0a16351a14..245250ee3c45 100644 --- a/drivers/pwm/sysfs.c +++ b/drivers/pwm/sysfs.c @@ -660,4 +660,8 @@ static int __init pwm_sysfs_init(void) { return class_register(&pwm_class); } +#ifdef CONFIG_INITCALL_ASYNC +postcore_initcall(pwm_sysfs_init); +#else subsys_initcall(pwm_sysfs_init); +#endif From a7f5880658a25c6507bc85f456b60eae4a1190f3 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 17 Mar 2020 19:46:41 +0800 Subject: [PATCH 08/34] kernel/ksysfs.c: Call ksysfs_init() early when CONFIG_INITCALL_ASYNC=y configfs_init()/debugfs_init() depends on ksysfs_init() to init kernel_kobj. But configfs_init()/debugfs_init() and ksysfs_init() are both in the same core_initcall level. Fix this by move ksysfs_init() to the pure_initcall level. Change-Id: Iaa23a25a59b3a133f3cecb396fc69dd7e65d45ad Signed-off-by: Tao Huang --- kernel/ksysfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index 65dba9076f31..4f1f9b40f714 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c @@ -270,4 +270,8 @@ exit: return error; } +#ifdef CONFIG_INITCALL_ASYNC +pure_initcall(ksysfs_init); +#else core_initcall(ksysfs_init); +#endif From 5eb9313c1659fed3dbf939fec13aa16ab4059369 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 1 Apr 2025 16:46:02 +0800 Subject: [PATCH 09/34] genetlink: Call genl_init() later when CONFIG_INITCALL_ASYNC=y genl_init() depends on netlink_proto_init() to init nl_table. But genl_init() and netlink_proto_init() are both in the same core_initcall level. Fix this by moving genl_init() to the core_initcall_sync level, which is earlier than thermal_init(). Change-Id: Id4c85ea069c6ce3ebcb632856b695018bcc1e981 Signed-off-by: Tao Huang --- net/netlink/genetlink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index fd3c1f1ca6ea..5b2ae536075d 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@ -1494,7 +1494,11 @@ problem: panic("GENL: Cannot register controller: %d\n", err); } +#ifdef CONFIG_INITCALL_ASYNC +core_initcall_sync(genl_init); +#else core_initcall(genl_init); +#endif static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group) { From 69fc4dcdb99e136e342c80945401f228aa7d3193 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 1 Apr 2025 16:53:47 +0800 Subject: [PATCH 10/34] net: socket: Call sock_init() early when CONFIG_INITCALL_ASYNC=y netlink_proto_init() depends on sock_init() to init sock_mnt. But netlink_proto_init() and sock_init() are both in the same core_initcall level. Fix this by moving sock_init() to the pure_initcall level. Change-Id: I201d52a23f17e895ee9e961514f9a6b42f96cd40 Signed-off-by: Tao Huang --- net/socket.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/socket.c b/net/socket.c index bd438b89e698..90987c81dc0f 100644 --- a/net/socket.c +++ b/net/socket.c @@ -3243,7 +3243,11 @@ out_mount: goto out; } +#ifdef CONFIG_INITCALL_ASYNC +pure_initcall(sock_init); /* early initcall */ +#else core_initcall(sock_init); /* early initcall */ +#endif #ifdef CONFIG_PROC_FS void socket_seq_show(struct seq_file *seq) From 341c62647473c73119edcf687043c5680d321ce0 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 17 Mar 2020 19:38:39 +0800 Subject: [PATCH 11/34] kernel/params.c: Call param_sysfs_init() early when CONFIG_INITCALL_ASYNC=y usb_init() depends on param_sysfs_init() to init module_kset. But usb_init() and param_sysfs_init() are both in the same subsys_initcall level. Fix this by move param_sysfs_init() to the arch_initcall_sync level. Change-Id: Iccc44152c716959d98ed97ea379e0fc4378e185d Signed-off-by: Tao Huang --- kernel/params.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/params.c b/kernel/params.c index 5b92310425c5..fbe43d5acc3d 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -971,6 +971,10 @@ static int __init param_sysfs_init(void) return 0; } +#ifdef CONFIG_INITCALL_ASYNC +arch_initcall_sync(param_sysfs_init); +#else subsys_initcall(param_sysfs_init); +#endif #endif /* CONFIG_SYSFS */ From 1b259eab60874c85b7a70554f3357963e248e1e3 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 17 Mar 2020 19:11:23 +0800 Subject: [PATCH 12/34] ARM: alignment: Call alignment_init() later when CONFIG_INITCALL_ASYNC=y alignment_init() create proc file "cpu/alignment" at the fs_initcall level. While "cpu" dir is created on proc_cpu_init() at the same initcall level too. Fix this by move alignment_init() to the fs_initcall_sync level. Change-Id: I8a8831f103b6729f57a8a70ff1bf5672fdf98810 Signed-off-by: Tao Huang --- arch/arm/mm/alignment.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index f8dd0b3cc8e0..27bda26119cc 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c @@ -1049,4 +1049,8 @@ static int __init alignment_init(void) return 0; } +#ifdef CONFIG_INITCALL_ASYNC +fs_initcall_sync(alignment_init); +#else fs_initcall(alignment_init); +#endif From 14b1dd27381c60bafb1a5624d2b18d214dbb0d64 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Thu, 19 Mar 2020 08:54:27 +0800 Subject: [PATCH 13/34] char: misc: Call misc_init() early when CONFIG_INITCALL_ASYNC=y rfkill_init() depends on misc_init() to init misc_class. But rfkill_init() and misc_init() are both in the same subsys_initcall level. Fix this by move misc_init() to the arch_initcall_sync level. Change-Id: I7266c2787c04a42886816b0ef11f3ed968ebf557 Signed-off-by: Tao Huang --- drivers/char/misc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/char/misc.c b/drivers/char/misc.c index cba19bfdc44d..da6fcf81ec2b 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -290,4 +290,8 @@ fail_remove: remove_proc_entry("misc", NULL); return err; } +#ifdef CONFIG_INITCALL_ASYNC +arch_initcall_sync(misc_init); +#else subsys_initcall(misc_init); +#endif From 199e598fa847cd810913749cc729f2e22621d141 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Fri, 10 Apr 2020 10:48:39 +0800 Subject: [PATCH 14/34] phy: core: Call phy_core_init() early when CONFIG_INITCALL_ASYNC=y ohci_platform_init()/ehci_platform_init depends on phy_core_init() to init phy_class. But ohci_platform_init()/ehci_platform_init and phy_core_init() are both in the same device_initcall/module_init level. Fix this by moving phy_core_init() to the subsys_initcall level. Change-Id: I0bbe2e1a02001e2ba97c9dc8be96d651984784ef Signed-off-by: Tao Huang --- drivers/phy/phy-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index d93ddf1262c5..e56bc020f695 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -1235,4 +1235,8 @@ static int __init phy_core_init(void) return 0; } +#ifdef CONFIG_INITCALL_ASYNC +subsys_initcall(phy_core_init); +#else device_initcall(phy_core_init); +#endif From b6512873ea4ec0b09c4ae375b2630477d050c633 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sat, 4 Apr 2020 15:47:58 +0800 Subject: [PATCH 15/34] pinctrl: core: Call pinctrl_init() later when CONFIG_INITCALL_ASYNC=y pinctrl_init() depends on debugfs_init() to register debugfs filesystem. But pinctrl_init() and debugfs_init() are both in the same core_initcall level. Fix this by moving pinctrl_init() to the core_initcall_sync level. Change-Id: I3b0741b8d32c6b05c7b15e20da6c410d26245745 Signed-off-by: Tao Huang --- drivers/pinctrl/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 3b6051d63218..ef7a2878f139 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -2338,4 +2338,8 @@ static int __init pinctrl_init(void) } /* init early since many drivers really need to initialized pinmux early */ +#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_INITCALL_ASYNC) +core_initcall_sync(pinctrl_init); +#else core_initcall(pinctrl_init); +#endif From bf9dd729dc744396d3b6a7d14b0531feed19ba86 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sat, 4 Apr 2020 15:49:56 +0800 Subject: [PATCH 16/34] regulator: core: Call regulator_init() later when CONFIG_INITCALL_ASYNC=y regulator_init() depends on debugfs_init() to register debugfs filesystem. But regulator_init() and debugfs_init() are both in the same core_initcall level. Fix this by moving regulator_init() to the core_initcall_sync level. Change-Id: I302079e585f374a7fddd207e6fd740b61b0df52c Signed-off-by: Tao Huang --- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 16e365b87233..3bdf9a7b13ac 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -6543,7 +6543,7 @@ static int __init regulator_init(void) } /* init early to allow our consumers to complete system booting */ -#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT +#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_INITCALL_ASYNC) core_initcall_sync(regulator_init); #else core_initcall(regulator_init); From 66275080a4fe0edd843d14d070cb8cfcafb30250 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sat, 4 Apr 2020 15:40:45 +0800 Subject: [PATCH 17/34] PM / OPP: Call opp_debug_init() later when CONFIG_INITCALL_ASYNC=y opp_debug_init() depends on debugfs_init() to register debugfs filesystem. But opp_debug_init() and debugfs_init() are both in the same core_initcall level. Fix this by moving opp_debug_init() to the core_initcall_sync level. Change-Id: I4e6fa71e424bd1733d2c9aab4893f0f4af1e8099 Signed-off-by: Tao Huang --- drivers/opp/debugfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/opp/debugfs.c b/drivers/opp/debugfs.c index 2285308bf4b8..2a7a414aad46 100644 --- a/drivers/opp/debugfs.c +++ b/drivers/opp/debugfs.c @@ -330,4 +330,8 @@ static int __init opp_debug_init(void) return 0; } +#ifdef CONFIG_INITCALL_ASYNC +core_initcall_sync(opp_debug_init); +#else core_initcall(opp_debug_init); +#endif From 4b58c0898d952b37cb0aad0d035518364a3b00aa Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sat, 4 Apr 2020 15:37:53 +0800 Subject: [PATCH 18/34] HID: core: Call hid_init() early when CONFIG_INITCALL_ASYNC=y hid_generic_init() depends on hid_init() to init hid_bus_type. But hid_generic_init() and hid_init() are both in the same module_init level. Fix this by moving hid_init() to the rootfs_initcall level. Change-Id: I070f92c405d898ae9f929bff968a6bd26811085a Signed-off-by: Tao Huang --- drivers/hid/hid-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index b5887658c6af..2c1b292588f9 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2968,7 +2968,11 @@ static void __exit hid_exit(void) hid_quirks_exit(HID_BUS_ANY); } +#ifdef CONFIG_INITCALL_ASYNC +rootfs_initcall(hid_init); +#else module_init(hid_init); +#endif module_exit(hid_exit); MODULE_AUTHOR("Andreas Gal"); From 26e7a918973dab677a2845434af82f040937f889 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 15 Apr 2025 15:11:44 +0800 Subject: [PATCH 19/34] serial: 8250: Call serial8250_init() early when CONFIG_INITCALL_ASYNC=y dw8250_platform_driver_init() depends on serial8250_init(). But dw8250_platform_driver_init() and serial8250_init() are both in the same module_init level. Fix this by moving serial8250_init() to the rootfs_initcall level. Change-Id: I337da18ef25121ccb1f9351fd213abb7d83f82d1 Signed-off-by: Tao Huang --- drivers/tty/serial/8250/8250_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 2f7553ceaeeb..272256cc80f3 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -1251,7 +1251,7 @@ static void __exit serial8250_exit(void) #endif } -#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT +#ifdef CONFIG_INITCALL_ASYNC rootfs_initcall(serial8250_init); #else module_init(serial8250_init); From b683085198b6df02ffab33ba08828cab19407cc3 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 15 Apr 2025 15:35:38 +0800 Subject: [PATCH 20/34] iommu: Call iommu_subsys_init() early when CONFIG_INITCALL_ASYNC=y rk_iommu_init() depends on iommu_subsys_init(). But rk_iommu_init() and iommu_subsys_init() are both in the same subsys_initcall level. Fix this by moving iommu_subsys_init() to the postcore_initcall_sync level. Change-Id: Ie7a7ecf7ffa7c3876b745de657b65b84e65ff8c9 Signed-off-by: Tao Huang --- drivers/iommu/iommu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 113f774d95b1..6eb711791fc2 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -187,7 +187,11 @@ static int __init iommu_subsys_init(void) return 0; } +#ifdef CONFIG_INITCALL_ASYNC +postcore_initcall_sync(iommu_subsys_init); +#else subsys_initcall(iommu_subsys_init); +#endif static int remove_iommu_group(struct device *dev, void *data) { From 1858941e9ce2254c488950a374620525ef981c39 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 15 Apr 2025 19:06:25 +0800 Subject: [PATCH 21/34] phy: rockchip: inno-usb2: Call rockchip_usb2phy_driver_init() early when CONFIG_INITCALL_ASYNC=y ehci_platform_init()/ohci_platform_init() depends on rockchip_usb2phy_driver_init() to init usb2phy. But ehci_platform_init()/ohci_platform_init() and rockchip_usb2phy_driver_init() are both in the same module_init level. Fix this by moving rockchip_usb2phy_driver_init() to the fs_initcall level. Change-Id: Ie3994da5d25b646f8cc0974bb023979acdad60af Signed-off-by: Tao Huang --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index f6928c6051cc..50861763b182 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -4808,7 +4808,21 @@ static struct platform_driver rockchip_usb2phy_driver = { .of_match_table = rockchip_usb2phy_dt_match, }, }; +#ifdef CONFIG_INITCALL_ASYNC +static int __init rockchip_usb2phy_driver_init(void) +{ + return platform_driver_register(&rockchip_usb2phy_driver); +} +fs_initcall(rockchip_usb2phy_driver_init); + +static void __exit rockchip_usb2phy_driver_exit(void) +{ + platform_driver_unregister(&rockchip_usb2phy_driver); +} +module_exit(rockchip_usb2phy_driver_exit); +#else module_platform_driver(rockchip_usb2phy_driver); +#endif MODULE_AUTHOR("Frank Wang "); MODULE_DESCRIPTION("Rockchip USB2.0 PHY driver"); From 13cc56a3ec3c10080e5dac405b8a0e8e0f488cc3 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 15 Apr 2025 19:35:17 +0800 Subject: [PATCH 22/34] phy: rockchip: naneng-combphy: Call rockchip_combphy_driver_init() early when CONFIG_INITCALL_ASYNC=y dwc3_driver_init() depends on rockchip_combphy_driver_init() to init usb3phy. But dwc3_driver_init() and rockchip_combphy_driver_init() are both in the same module_init level. Fix this by moving rockchip_combphy_driver_init() to the fs_initcall level. Change-Id: I4e36da029f326f2a31d96db4175769b406bd0230 Signed-off-by: Tao Huang --- drivers/phy/rockchip/phy-rockchip-naneng-combphy.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c index 7a305b1aa2e1..d1a89be9d333 100644 --- a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c +++ b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c @@ -1604,7 +1604,21 @@ static struct platform_driver rockchip_combphy_driver = { .of_match_table = rockchip_combphy_of_match, }, }; +#ifdef CONFIG_INITCALL_ASYNC +static int __init rockchip_combphy_driver_init(void) +{ + return platform_driver_register(&rockchip_combphy_driver); +} +fs_initcall(rockchip_combphy_driver_init); + +static void __exit rockchip_combphy_driver_exit(void) +{ + platform_driver_unregister(&rockchip_combphy_driver); +} +module_exit(rockchip_combphy_driver_exit); +#else module_platform_driver(rockchip_combphy_driver); +#endif MODULE_DESCRIPTION("Rockchip NANENG COMBPHY driver"); MODULE_LICENSE("GPL v2"); From 8c62e5fa384bb22d88c2aaf14ba8001d8e07758c Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 15 Apr 2025 19:53:52 +0800 Subject: [PATCH 23/34] nvmem: core: Call nvmem_init() early when CONFIG_INITCALL_ASYNC=y rockchip_otp_init() depends on nvmem_init() to init nvmem_bus_type. But rockchip_otp_init() and nvmem_init() are both in the same subsys_initcall level. Fix this by moving nvmem_init() to the arch_initcall_sync level. Change-Id: If591d89572d77adbec06fe2cc2af23b1a4b239fd Signed-off-by: Tao Huang --- drivers/nvmem/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 53a6c4702078..2325f2de9af0 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1948,7 +1948,7 @@ static void __exit nvmem_exit(void) bus_unregister(&nvmem_bus_type); } -#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT +#ifdef CONFIG_INITCALL_ASYNC arch_initcall_sync(nvmem_init); #else subsys_initcall(nvmem_init); From 0c00b3269e8f1f4141f42809ae97eca40cd8e1b3 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 6 May 2020 19:37:18 +0800 Subject: [PATCH 24/34] drm/drv: Call drm_core_init() early when CONFIG_INITCALL_ASYNC=y rockchip_drm_init() depends on drm_core_init() to init DRM core. But rockchip_drm_init() and drm_core_init() are both in the same module_init level. Fix this by moving drm_core_init() to the subsys_initcall level. Change-Id: I872aefaad12f10569cf957ce4e9cac873522a234 Signed-off-by: Tao Huang --- drivers/gpu/drm/drm_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 69bd7978f448..0bee4583c777 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -1079,7 +1079,9 @@ error: return ret; } -#ifdef CONFIG_VIDEO_REVERSE_IMAGE +#ifdef CONFIG_INITCALL_ASYNC +subsys_initcall(drm_core_init); +#elif defined CONFIG_VIDEO_REVERSE_IMAGE fs_initcall(drm_core_init); #else module_init(drm_core_init); From 0bd74397227b0d3498477d15d6d3bd1a3e594b52 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 16 Apr 2025 17:05:24 +0800 Subject: [PATCH 25/34] ASoC: rockchip: multicodecs: Call rockchip_multicodecs_driver_init() later when CONFIG_INITCALL_ASYNC=y rockchip_multicodecs_driver_init() depends on rockchip_sai_driver_init(). But rockchip_multicodecs_driver_init() and rockchip_sai_driver_init() are both in the same module_init level. Fix this by moving rockchip_multicodecs_driver_init() to the late_initcall level. Change-Id: I6b6958264ee6d380116421fc2985710b8b3f1fa8 Signed-off-by: Tao Huang --- sound/soc/rockchip/rockchip_multicodecs.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/soc/rockchip/rockchip_multicodecs.c b/sound/soc/rockchip/rockchip_multicodecs.c index 9d18fafea8e5..05e2494637a4 100644 --- a/sound/soc/rockchip/rockchip_multicodecs.c +++ b/sound/soc/rockchip/rockchip_multicodecs.c @@ -999,7 +999,21 @@ static struct platform_driver rockchip_multicodecs_driver = { }, }; +#ifdef CONFIG_INITCALL_ASYNC +static int __init rockchip_multicodecs_driver_init(void) +{ + return platform_driver_register(&rockchip_multicodecs_driver); +} +late_initcall(rockchip_multicodecs_driver_init); + +static void __exit rockchip_multicodecs_driver_exit(void) +{ + platform_driver_unregister(&rockchip_multicodecs_driver); +} +module_exit(rockchip_multicodecs_driver_exit); +#else module_platform_driver(rockchip_multicodecs_driver); +#endif MODULE_AUTHOR("Sugar Zhang "); MODULE_DESCRIPTION("Rockchip General Multicodecs ASoC driver"); From 5baffd6cac7bd655bfa2393b7d752f579440f37f Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 16 Apr 2025 17:38:30 +0800 Subject: [PATCH 26/34] phy/rockchip: inno-dsidphy: Call inno_dsidphy_driver_init() early when CONFIG_INITCALL_ASYNC=y Moving inno_dsidphy_driver_init() to the fs_initcall level. Before rockchip_drm_init(). Change-Id: I09aa277f2af80107aa00b8da69ff919be02d2452 Signed-off-by: Tao Huang --- drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c index bf366053cec2..4b76f8521b55 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c @@ -1166,7 +1166,21 @@ static struct platform_driver inno_dsidphy_driver = { .probe = inno_dsidphy_probe, .remove = inno_dsidphy_remove, }; +#ifdef CONFIG_INITCALL_ASYNC +static int __init inno_dsidphy_driver_init(void) +{ + return platform_driver_register(&inno_dsidphy_driver); +} +fs_initcall(inno_dsidphy_driver_init); + +static void __exit inno_dsidphy_driver_exit(void) +{ + platform_driver_unregister(&inno_dsidphy_driver); +} +module_exit(inno_dsidphy_driver_exit); +#else module_platform_driver(inno_dsidphy_driver); +#endif MODULE_AUTHOR("Wyon Bi "); MODULE_DESCRIPTION("Innosilicon MIPI/LVDS/TTL Video Combo PHY driver"); From 6ddf51f36da381910f9374100ab76597e53103dd Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 16 Apr 2025 17:43:11 +0800 Subject: [PATCH 27/34] backlight: pwm_bl: Call pwm_backlight_driver_init() early when CONFIG_INITCALL_ASYNC=y panel_simple_init() depends on pwm_backlight_driver_init(). But panel_simple_init() and pwm_backlight_driver_init() are both in the same module_init level. Fix this by moving pwm_backlight_driver_init() to the fs_initcall level. Change-Id: I344330f658c0fb92a5f6f73499fc24bbef1651d2 Signed-off-by: Tao Huang --- drivers/video/backlight/pwm_bl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index a55feb708688..8371681023b1 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -720,7 +720,21 @@ static struct platform_driver pwm_backlight_driver = { .shutdown = pwm_backlight_shutdown, }; +#ifdef CONFIG_INITCALL_ASYNC +static int __init pwm_backlight_driver_init(void) +{ + return platform_driver_register(&pwm_backlight_driver); +} +fs_initcall(pwm_backlight_driver_init); + +static void __exit pwm_backlight_driver_exit(void) +{ + platform_driver_unregister(&pwm_backlight_driver); +} +module_exit(pwm_backlight_driver_exit); +#else module_platform_driver(pwm_backlight_driver); +#endif MODULE_DESCRIPTION("PWM based Backlight Driver"); MODULE_LICENSE("GPL v2"); From a0f44c9df33d90d0820242ca34062410e40f2ed2 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sat, 4 Apr 2020 15:55:57 +0800 Subject: [PATCH 28/34] netfilter: x_tables: Call xt_init() early when CONFIG_INITCALL_ASYNC=y classify_tg_init() depends on xt_init() to init xt. But classify_tg_init() and xt_init() are both in the same module_init level. Fix this by moving xt_init() to the rootfs_initcall level. Change-Id: If9aaae57704e064b719731efa3112d4e652f0069 Signed-off-by: Tao Huang --- net/netfilter/x_tables.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index e8cc8eef0ab6..b2f111832899 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c @@ -2012,6 +2012,10 @@ static void __exit xt_fini(void) kfree(xt); } +#ifdef CONFIG_INITCALL_ASYNC +rootfs_initcall(xt_init); +#else module_init(xt_init); +#endif module_exit(xt_fini); From 81d1cc82ea19c652339cf929b71e15dee728e04d Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sat, 4 Apr 2020 15:54:53 +0800 Subject: [PATCH 29/34] netfilter: nf_conntrack: Call nf_conntrack_standalone_init() early when CONFIG_INITCALL_ASYNC=y nf_nat_amanda_init() depends on nf_conntrack_standalone_init() to init nf_ct_nat_helpers. But nf_nat_amanda_init() and nf_conntrack_standalone_init() are both in the same module_init level. Fix this by moving nf_conntrack_standalone_init() to the rootfs_initcall level. Change-Id: I2b5a9994f83581cdd819e19abe6cabc7b1d7b3af Signed-off-by: Tao Huang --- net/netfilter/nf_conntrack_standalone.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index 52245dbfae31..28d957860dda 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c @@ -1250,5 +1250,9 @@ static void __exit nf_conntrack_standalone_fini(void) nf_conntrack_cleanup_end(); } +#ifdef CONFIG_INITCALL_ASYNC +rootfs_initcall(nf_conntrack_standalone_init); +#else module_init(nf_conntrack_standalone_init); +#endif module_exit(nf_conntrack_standalone_fini); From 5d98ec57bf1b3ab9003babb369814d11cf1a2429 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 16 Apr 2025 19:24:13 +0800 Subject: [PATCH 30/34] ipv6: Call inet6_init() early when CONFIG_INITCALL_ASYNC=y l2tp_ip6_init() depends on inet6_init() to init inetsw6. But l2tp_ip6_init() and inet6_init() are both in the same module_init level. Fix this by moving inet6_init() to the rootfs_initcall level. Change-Id: I71cd6831b1b162d8325988b4e674c4e467c40f68 Signed-off-by: Tao Huang --- net/ipv6/af_inet6.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 62247621cea5..bed9e94868b2 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -1330,6 +1330,10 @@ out_unregister_tcp_proto: proto_unregister(&tcpv6_prot); goto out; } +#ifdef CONFIG_INITCALL_ASYNC +rootfs_initcall(inet6_init); +#else module_init(inet6_init); +#endif MODULE_ALIAS_NETPROTO(PF_INET6); From 267447fac429410a1707b4f05d5ac87012461df0 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 16 Apr 2025 19:30:03 +0800 Subject: [PATCH 31/34] net: loopback: Call blackhole_netdev_init() early when CONFIG_INITCALL_ASYNC=y inet6_init() depends on blackhole_netdev_init() to init blackhole_netdev. But inet6_init() and blackhole_netdev_init() are both in the same module_init level. Fix this by moving blackhole_netdev_init() to the fs_initcall level. Change-Id: Ie2313d29ac00b533b22b50fadfda78a541b9e88b Signed-off-by: Tao Huang --- drivers/net/loopback.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 2e9742952c4e..a4969f1a7e36 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -277,4 +277,8 @@ static int __init blackhole_netdev_init(void) return 0; } +#ifdef CONFIG_INITCALL_ASYNC +fs_initcall(blackhole_netdev_init); +#else device_initcall(blackhole_netdev_init); +#endif From 018a3d4acbf441a67d410f5215903ab65b536a06 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sat, 4 Apr 2020 15:53:06 +0800 Subject: [PATCH 32/34] inet_diag: Call inet_diag_init() early when CONFIG_INITCALL_ASYNC=y dccp_diag_init() depends on inet_diag_init() to init inet_diag_table. But dccp_diag_init() and inet_diag_init() are both in the same module_init level. Fix this by moving inet_diag_init() to the rootfs_initcall level. Change-Id: Ie06bd549622c6f82b34486fc4faaba6c3e4dbba8 Signed-off-by: Tao Huang --- net/ipv4/inet_diag.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index e4e1999d93f5..ada7302af59d 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -1480,7 +1480,11 @@ static void __exit inet_diag_exit(void) kfree(inet_diag_table); } +#ifdef CONFIG_INITCALL_ASYNC +rootfs_initcall(inet_diag_init); +#else module_init(inet_diag_init); +#endif module_exit(inet_diag_exit); MODULE_LICENSE("GPL"); MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2 /* AF_INET */); From 04a2236d0087d6674babe8bf74a9c2142711476e Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Fri, 18 Apr 2025 10:31:21 +0800 Subject: [PATCH 33/34] net: bpfilter: Call bpfilter_sockopt_init() early when CONFIG_INITCALL_ASYNC=y load_umh() depends on bpfilter_sockopt_init() to init bpfilter_ops. But load_umh() and bpfilter_sockopt_init() are both in the same module_init/device_initcall level. Fix this by moving bpfilter_sockopt_init() to the rootfs_initcall level. Change-Id: I454872cc8036cffa92d135cbdb2c50ad9bb52e77 Signed-off-by: Tao Huang --- net/ipv4/bpfilter/sockopt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ipv4/bpfilter/sockopt.c b/net/ipv4/bpfilter/sockopt.c index 1b34cb9a7708..62b269a33dca 100644 --- a/net/ipv4/bpfilter/sockopt.c +++ b/net/ipv4/bpfilter/sockopt.c @@ -77,4 +77,8 @@ static int __init bpfilter_sockopt_init(void) return 0; } +#ifdef CONFIG_INITCALL_ASYNC +rootfs_initcall(bpfilter_sockopt_init); +#else device_initcall(bpfilter_sockopt_init); +#endif From 610a9bdb86734c138a77cd586e8a484840b4354d Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Mon, 31 Mar 2025 17:40:23 +0800 Subject: [PATCH 34/34] ARM: configs: rv1126b-fastboot: Enable CONFIG_INITCALL_ASYNC Change-Id: Ic1ea791aa47c589e8fb33a33f99250c2af2e247c Signed-off-by: Tao Huang --- arch/arm/configs/rv1126b-fastboot.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/rv1126b-fastboot.config b/arch/arm/configs/rv1126b-fastboot.config index fcac9385c431..89e5fb406ffe 100644 --- a/arch/arm/configs/rv1126b-fastboot.config +++ b/arch/arm/configs/rv1126b-fastboot.config @@ -241,7 +241,7 @@ CONFIG_FS_MBCACHE=m # CONFIG_GPIO_XRA1403 is not set # CONFIG_HI8435 is not set # CONFIG_IIO_SSP_SENSORHUB is not set -# CONFIG_INITCALL_ASYNC is not set +CONFIG_INITCALL_ASYNC=y # CONFIG_INITRAMFS_FORCE is not set CONFIG_INITRAMFS_SOURCE="" # CONFIG_INV_ICM42600_SPI is not set