From: Dongdong Deng Date: Tue, 31 Aug 2010 02:06:00 +0000 (-0500) Subject: kgdbts: prevent re-entry to kgdbts before it unregisters X-Git-Tag: v2.6.37-rc1~36^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dacd5c073150cd78dfb6004cbfa71986f0258a4;p=pandora-kernel.git kgdbts: prevent re-entry to kgdbts before it unregisters The "kgdb_connected" variable of debug_core just indicates whether or not kgdbts is connected to the debug_core. It does not completely prevent a script from trying invoke kgdbts again and possibly crashing the system (see Call Trace below). The configured variable in kgtbts can be used instead of kgdb_connected instead of kgdb_connected. The cleanup_kgdbts() can also be removed because there is no possible way to build kgdbts as a kernel module that you could unload with rmmod. Call Trace: ----------------------------------------------------------------- root:/$ echo kgdbts=V1S1000 > /sys/module/kgdbts/parameters/kgdbts kgdb: Unregistered I/O driver kgdbts, debugger disabled. ------------[ cut here ]------------ WARNING: at kernel/debug/debug_core.c:1002 kgdb_unregister_io_module+0xec/0x100() Hardware name: Moon Creek platform Modules linked in: Pid: 664, comm: sh Not tainted 2.6.34.1-WR4.0.0.0_standard #58 Call Trace: [] warn_slowpath_common+0x6d/0xa0 [] ? kgdb_unregister_io_module+0xec/0x100 [] ? kgdb_unregister_io_module+0xec/0x100 [] ? param_attr_store+0x0/0x20 [] warn_slowpath_null+0x15/0x20 [] kgdb_unregister_io_module+0xec/0x100 [] cleanup_kgdbts+0x1a/0x20 [] param_set_kgdbts_var+0x6d/0xb0 [] ? param_set_kgdbts_var+0x0/0xb0 [] param_attr_store+0x17/0x20 [] module_attr_store+0x2c/0x40 [] sysfs_write_file+0x94/0xf0 [] vfs_write+0x96/0x130 [] ? sysfs_write_file+0x0/0xf0 [] sys_write+0x46/0xd0 [] system_call_done+0x0/0x4 ---[ end trace 4eb028c6ee43154c ]--- kgdb: Unregistered I/O driver kgdbts, debugger disabled. ----------------------------------------------------------------- [jason.wessel@windriver.com: remove cleanup_kgdbts() ] Signed-off-by: Dongdong Deng Signed-off-by: Jason Wessel --- Reading git-diff-tree failed