From 9cbe2f0b9bfd8abc716180ef965e92dd74c7e356 Mon Sep 17 00:00:00 2001 From: Subbaraman Narayanamurthy Date: Tue, 26 Jan 2016 15:59:30 -0800 Subject: [PATCH] ANDROID: GKI: kobject: increase number of kobject uevent pointers to 64 Power supply framework uses uevents to notify the power supply change events to the userspace. Some power supplies have their properties increasing thus overflowing the number of kobject uevent pointers, triggering warning shown below. [ 10.577545] WARNING: CPU: 3 PID: 406 at kernel/lib/kobject_uevent.c:393 add_uevent_var+0xc0/0x100() [ 10.589680] add_uevent_var: too many keys [ 10.593809] Modules linked in: [ 10.596686] CPU: 3 PID: 406 Comm: kworker/3:2 Tainted: G W 3.18.20-g5e99605-00057-gd18285f #603 [ 10.606373] Hardware name: Qualcomm Technologies, Inc. MSM 8996 v3 + PMI8996 MTP (DT) [ 10.614188] Workqueue: events power_supply_changed_work [ 10.619366] Call trace: [ 10.621803] [] dump_backtrace+0x0/0x130 [ 10.627175] [] show_stack+0x10/0x1c [ 10.632237] [] dump_stack+0x74/0xb8 [ 10.637253] [] warn_slowpath_common+0x90/0xb8 [ 10.643170] [] warn_slowpath_fmt+0x4c/0x58 [ 10.648814] [] add_uevent_var+0xbc/0x100 [ 10.654259] [] kobject_uevent_env+0x498/0x5a8 [ 10.660185] [] kobject_uevent+0xc/0x18 [ 10.665457] [] power_supply_changed_work+0xb0/0xf0 [ 10.671830] [] process_one_work+0x23c/0x3f4 [ 10.677529] [] worker_thread+0x280/0x3a8 [ 10.683017] [] kthread+0xe0/0xec Fix this warning by increasing the number of kobject uevent pointers from 32 to 64. CRs-Fixed: 971954 Bug: 148872640 Signed-off-by: Subbaraman Narayanamurthy Signed-off-by: Will McVicker Signed-off-by: Saravana Kannan [saravanak Increase uevent buffer size too] (cherry picked from commit d09cd0dd75f95acedd3fa63d67ca3fbc92d21272) Change-Id: Ide942d25006abd36ba7be945be397a535e91d970 --- include/linux/kobject.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 1ab0d624fb36..9744ae93a6f2 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -29,8 +29,8 @@ #include #define UEVENT_HELPER_PATH_LEN 256 -#define UEVENT_NUM_ENVP 32 /* number of env pointers */ -#define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */ +#define UEVENT_NUM_ENVP 64 /* number of env pointers */ +#define UEVENT_BUFFER_SIZE 4096 /* buffer for the variables */ #ifdef CONFIG_UEVENT_HELPER /* path to the userspace helper executed on an event */