From c4106d89453aacc831e8a1f1c96587de1305da4b Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Mon, 20 Aug 2012 16:34:31 +0400 Subject: Revert 14d0790 "UBUNTU: SAUCE: async_populate_rootfs: fix build warnings" Signed-off-by: Andrey Konovalov --- init/initramfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/init/initramfs.c b/init/initramfs.c index a9ea4066e2ef..c5a412346663 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -589,7 +589,7 @@ void populate_rootfs_wait(void) } EXPORT_SYMBOL(populate_rootfs_wait); -static void __init async_populate_rootfs(void *data, async_cookie_t cookie) +static void __init async_populate_rootfs(void) { char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size); if (err) @@ -638,14 +638,12 @@ static int __init populate_rootfs_early(void) async_schedule_domain(async_populate_rootfs, NULL, &populate_rootfs_domain); } - return 0; } static int __init populate_rootfs(void) { if (!rootfs_populated) async_schedule_domain(async_populate_rootfs, NULL, &populate_rootfs_domain); - return 0; } earlyrootfs_initcall(populate_rootfs_early); -- cgit v1.2.3 From 250e09d6648d2740219bc400598c9691be0ae306 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Mon, 20 Aug 2012 16:36:20 +0400 Subject: Revert bc3f32c "UBUNTU: SAUCE: ensure root is ready before running..." Revert bc3f32c "UBUNTU: SAUCE: ensure root is ready before running usermodehelpers in it" Signed-off-by: Andrey Konovalov --- include/linux/init.h | 2 ++ include/linux/kmod.h | 2 -- init/initramfs.c | 7 ------- init/main.c | 2 +- kernel/kmod.c | 2 -- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/include/linux/init.h b/include/linux/init.h index d8ed250fce30..b8540f0988c3 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -225,6 +225,8 @@ extern bool initcall_debug; static initcall_t __initcall_##fn \ __used __section(.security_initcall.init) = fn +extern struct list_head populate_rootfs_domain; + struct obs_kernel_param { const char *str; int (*setup_func)(char *); diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 6f571b1be39e..5398d5807075 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h @@ -71,8 +71,6 @@ call_usermodehelper_fns(char *path, char **argv, char **envp, int wait, int (*init)(struct subprocess_info *info, struct cred *new), void (*cleanup)(struct subprocess_info *), void *data); -void populate_rootfs_wait(void); - static inline int call_usermodehelper(char *path, char **argv, char **envp, int wait) { diff --git a/init/initramfs.c b/init/initramfs.c index c5a412346663..1ae8873570c6 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -19,7 +19,6 @@ #include #include #include -#include static __initdata char *message; static void __init error(char *x) @@ -583,12 +582,6 @@ static void __init clean_rootfs(void) LIST_HEAD(populate_rootfs_domain); -void populate_rootfs_wait(void) -{ - async_synchronize_full_domain(&populate_rootfs_domain); -} -EXPORT_SYMBOL(populate_rootfs_wait); - static void __init async_populate_rootfs(void) { char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size); diff --git a/init/main.c b/init/main.c index 6d265fc4307f..2deae100e2a6 100644 --- a/init/main.c +++ b/init/main.c @@ -895,7 +895,7 @@ static int __init kernel_init(void * unused) * We need to ensure that the filesystem is ready by this point, wait for * async_populate_rootfs to complete. */ - populate_rootfs_wait(); + async_synchronize_full_domain(&populate_rootfs_domain); /* * check if there is an early userspace init. If yes, let it do all diff --git a/kernel/kmod.c b/kernel/kmod.c index c5710b59f438..6f99aead66c6 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -618,8 +618,6 @@ int call_usermodehelper_fns( struct subprocess_info *info; gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; - populate_rootfs_wait(); - info = call_usermodehelper_setup(path, argv, envp, gfp_mask); if (info == NULL) -- cgit v1.2.3 From e229e0435b08c3743805c130c7c0756440f66363 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Mon, 20 Aug 2012 16:38:24 +0400 Subject: Revert "b57a541 UBUNTU: SAUCE: async_populate_rootfs: move rootfs init earlier" Signed-off-by: Andrey Konovalov --- include/asm-generic/vmlinux.lds.h | 1 - include/linux/init.h | 1 - init/initramfs.c | 15 +-------------- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index b5590e10b3a7..4e2e1cc505ab 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -626,7 +626,6 @@ *(.initcallearly.init) \ INIT_CALLS_LEVEL(0) \ INIT_CALLS_LEVEL(1) \ - INIT_CALLS_LEVEL(earlyrootfs) \ INIT_CALLS_LEVEL(2) \ INIT_CALLS_LEVEL(3) \ INIT_CALLS_LEVEL(4) \ diff --git a/include/linux/init.h b/include/linux/init.h index b8540f0988c3..e8163edd1ba8 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -197,7 +197,6 @@ extern bool initcall_debug; #define core_initcall(fn) __define_initcall("1",fn,1) #define core_initcall_sync(fn) __define_initcall("1s",fn,1s) -#define earlyrootfs_initcall(fn) __define_initcall("earlyrootfs",fn,rootfs) #define postcore_initcall(fn) __define_initcall("2",fn,2) #define postcore_initcall_sync(fn) __define_initcall("2s",fn,2s) #define arch_initcall(fn) __define_initcall("3",fn,3) diff --git a/init/initramfs.c b/init/initramfs.c index 1ae8873570c6..928a3f2b81da 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -622,22 +622,9 @@ static void __init async_populate_rootfs(void) return; } -static int __initdata rootfs_populated; - -static int __init populate_rootfs_early(void) -{ - if (num_online_cpus() > 1) { - rootfs_populated = 1; - async_schedule_domain(async_populate_rootfs, NULL, - &populate_rootfs_domain); - } -} static int __init populate_rootfs(void) { - if (!rootfs_populated) - async_schedule_domain(async_populate_rootfs, NULL, - &populate_rootfs_domain); + async_schedule_domain(async_populate_rootfs, NULL, &populate_rootfs_domain); } -earlyrootfs_initcall(populate_rootfs_early); rootfs_initcall(populate_rootfs); -- cgit v1.2.3 From ac20a0e853ca73bb821a85d8492d965e07513ccd Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Mon, 20 Aug 2012 16:39:55 +0400 Subject: Revert a1f6335 "UBUNTU: SAUCE: Make populate_rootfs asynchronous" Signed-off-by: Andrey Konovalov --- include/linux/init.h | 2 -- init/initramfs.c | 15 +++------------ init/main.c | 6 ------ 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/include/linux/init.h b/include/linux/init.h index e8163edd1ba8..5e664f671615 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -224,8 +224,6 @@ extern bool initcall_debug; static initcall_t __initcall_##fn \ __used __section(.security_initcall.init) = fn -extern struct list_head populate_rootfs_domain; - struct obs_kernel_param { const char *str; int (*setup_func)(char *); diff --git a/init/initramfs.c b/init/initramfs.c index 928a3f2b81da..84c6bf111300 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -18,7 +18,6 @@ #include #include #include -#include static __initdata char *message; static void __init error(char *x) @@ -580,9 +579,7 @@ static void __init clean_rootfs(void) } #endif -LIST_HEAD(populate_rootfs_domain); - -static void __init async_populate_rootfs(void) +static int __init populate_rootfs(void) { char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size); if (err) @@ -595,7 +592,7 @@ static void __init async_populate_rootfs(void) initrd_end - initrd_start); if (!err) { free_initrd(); - return; + return 0; } else { clean_rootfs(); unpack_to_rootfs(__initramfs_start, __initramfs_size); @@ -619,12 +616,6 @@ static void __init async_populate_rootfs(void) free_initrd(); #endif } - return; -} - -static int __init populate_rootfs(void) -{ - async_schedule_domain(async_populate_rootfs, NULL, &populate_rootfs_domain); + return 0; } - rootfs_initcall(populate_rootfs); diff --git a/init/main.c b/init/main.c index 2deae100e2a6..2173f4c9cbbd 100644 --- a/init/main.c +++ b/init/main.c @@ -891,12 +891,6 @@ static int __init kernel_init(void * unused) (void) sys_dup(0); (void) sys_dup(0); - /* - * We need to ensure that the filesystem is ready by this point, wait for - * async_populate_rootfs to complete. - */ - async_synchronize_full_domain(&populate_rootfs_domain); - /* * check if there is an early userspace init. If yes, let it do all * the work -- cgit v1.2.3 From 03664de47d69b580359d2dac84feb3b9e57f7f7d Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Tue, 21 Aug 2012 19:41:37 +0400 Subject: Revert 8c16bb8 "UBUNTU: SAUCE: acpi battery -- move first lookup asynchronous" Signed-off-by: Andrey Konovalov --- drivers/acpi/battery.c | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 724c6b650877..ff2c876ec412 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -985,18 +985,6 @@ static int battery_notify(struct notifier_block *nb, return 0; } -static LIST_HEAD(acpi_battery_domain); - -static void acpi_battery_update_async(struct acpi_device *device, async_cookie_t cookie) -{ - struct acpi_battery *battery = acpi_driver_data(device); - - acpi_battery_update(battery); - printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n", - ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device), - device->status.battery_present ? "present" : "absent"); -} - static int acpi_battery_add(struct acpi_device *device) { int result = 0; @@ -1016,16 +1004,13 @@ static int acpi_battery_add(struct acpi_device *device) if (ACPI_SUCCESS(acpi_get_handle(battery->device->handle, "_BIX", &handle))) set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags); - - /* Mark the battery for update at first access. */ - battery->update_time = 0; + result = acpi_battery_update(battery); + if (result) + goto fail; #ifdef CONFIG_ACPI_PROCFS_POWER result = acpi_battery_add_fs(device); #endif - if (!result) { - async_schedule_domain(acpi_battery_update_async, device, &acpi_battery_domain); - - } else { + if (result) { #ifdef CONFIG_ACPI_PROCFS_POWER acpi_battery_remove_fs(device); #endif @@ -1055,10 +1040,6 @@ static int acpi_battery_remove(struct acpi_device *device, int type) if (!device || !acpi_driver_data(device)) return -EINVAL; - - /* Ensure all async updates are complete before freeing the battery. */ - async_synchronize_full_domain(&acpi_battery_domain); - battery = acpi_driver_data(device); unregister_pm_notifier(&battery->pm_nb); #ifdef CONFIG_ACPI_PROCFS_POWER @@ -1103,21 +1084,27 @@ static struct acpi_driver acpi_battery_driver = { .drv.pm = &acpi_battery_pm, }; -static int __init acpi_battery_init(void) +static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) { if (acpi_disabled) return; #ifdef CONFIG_ACPI_PROCFS_POWER acpi_battery_dir = acpi_lock_battery_dir(); if (!acpi_battery_dir) - return -1; + return; #endif if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_battery_dir(acpi_battery_dir); #endif - return -1; + return; } + return; +} + +static int __init acpi_battery_init(void) +{ + async_schedule(acpi_battery_init_async, NULL); return 0; } -- cgit v1.2.3