OSDN Git Service

kobject: increase number of kobject uevent pointers to 64
authorSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Tue, 26 Jan 2016 23:59:30 +0000 (15:59 -0800)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:08:33 +0000 (11:08 -0700)
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] [<ffffffc00008881c>] dump_backtrace+0x0/0x130
[   10.627175] [<ffffffc00008895c>] show_stack+0x10/0x1c
[   10.632237] [<ffffffc000cc4d00>] dump_stack+0x74/0xb8
[   10.637253] [<ffffffc0000a0fec>] warn_slowpath_common+0x90/0xb8
[   10.643170] [<ffffffc0000a1060>] warn_slowpath_fmt+0x4c/0x58
[   10.648814] [<ffffffc00031121c>] add_uevent_var+0xbc/0x100
[   10.654259] [<ffffffc0003116f8>] kobject_uevent_env+0x498/0x5a8
[   10.660185] [<ffffffc000311814>] kobject_uevent+0xc/0x18
[   10.665457] [<ffffffc0007fd3c0>] power_supply_changed_work+0xb0/0xf0
[   10.671830] [<ffffffc0000b617c>] process_one_work+0x23c/0x3f4
[   10.677529] [<ffffffc0000b7338>] worker_thread+0x280/0x3a8
[   10.683017] [<ffffffc0000bb384>] kthread+0xe0/0xec

Fix this warning by increasing the number of kobject uevent
pointers from 32 to 64.

CRs-Fixed: 971954
Change-Id: Ide942d25006abd36ba7be945be397a535e91d970
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
include/linux/kobject.h

index e628459..74de8b6 100644 (file)
@@ -29,7 +29,7 @@
 #include <linux/workqueue.h>
 
 #define UEVENT_HELPER_PATH_LEN         256
-#define UEVENT_NUM_ENVP                        32      /* number of env pointers */
+#define UEVENT_NUM_ENVP                        64      /* number of env pointers */
 #define UEVENT_BUFFER_SIZE             2048    /* buffer for the variables */
 
 #ifdef CONFIG_UEVENT_HELPER