lock_kernel() / unlock_kernel inconsistency
In an effort to stay consistent with the community, I migrated some code to a driver to use the daemonize() routine in the function specified by the kernel_thread() call. However, in looking at a few drivers in the system (drivers/usb/hub.c , drivers/md/md.c, drivers/media/video/msp3400.c), I noticed some inconsistencies. Specifically with the use of lock_kernel() / unlock_kernel(). drivers/md/md.c looks like: int md_thread(void * arg) { md_lock_kernel(); daemonize(); . . . //md_unlock_kernel(); } this is similiar to drivers/usb/hub.c (which doesn't call unlock_kernel following lock_kernel) however drivers/media/video/msp3400.c looks like: static int msp3400c_thread(void *data) { . . . #ifdef CONFIG_SMP lock_kernel(); #endif daemonize(); . . . #ifdef CONFIG_SMP unlock_kernel(); #endif } The latter example seems logically correct to me. Does this imply that after the CPU that is responsible for starting the thread in md.c or hub.c claims the global lock it will never be released to any other CPU? If I am incorrect here please just point out my error, however, I figured I would bring this to the mailing list's attention if in fact this is truely in error. Thanks, Jason - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
lock_kernel() / unlock_kernel inconsistency
In an effort to stay consistent with the community, I migrated some code to a driver to use the daemonize() routine in the function specified by the kernel_thread() call. However, in looking at a few drivers in the system (drivers/usb/hub.c , drivers/md/md.c, drivers/media/video/msp3400.c), I noticed some inconsistencies. Specifically with the use of lock_kernel() / unlock_kernel(). drivers/md/md.c looks like: int md_thread(void * arg) { md_lock_kernel(); daemonize(); . . . //md_unlock_kernel(); } this is similiar to drivers/usb/hub.c (which doesn't call unlock_kernel following lock_kernel) however drivers/media/video/msp3400.c looks like: static int msp3400c_thread(void *data) { . . . #ifdef CONFIG_SMP lock_kernel(); #endif daemonize(); . . . #ifdef CONFIG_SMP unlock_kernel(); #endif } The latter example seems logically correct to me. Does this imply that after the CPU that is responsible for starting the thread in md.c or hub.c claims the global lock it will never be released to any other CPU? If I am incorrect here please just point out my error, however, I figured I would bring this to the mailing list's attention if in fact this is truely in error. Thanks, Jason - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
GPL Question
Consider this: A subsystem that is statically built into the Linux Kernel is modified to allow the registration of a structure containing function pointers. The function pointers corrolate to a set of functions within that subsystem. If the new structure of pointers has been registered, the original functions will call the new functions in the structure passing all arguments and returning the return value of the new function. With this said, if no structure has been registered, then no functionality is degraded within the kernel. Only the loss of some cpu time to check the pointers at the top of the old functions. Now, if a module is loaded that registers a set of functions that have increased functionality compared to the original functions, if that modules is not based off GPL'd code, must the source code of that module be released under the GPL? Thanks in advance, Jason Wohlgemuth - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
GPL Question
Consider this: A subsystem that is statically built into the Linux Kernel is modified to allow the registration of a structure containing function pointers. The function pointers corrolate to a set of functions within that subsystem. If the new structure of pointers has been registered, the original functions will call the new functions in the structure passing all arguments and returning the return value of the new function. With this said, if no structure has been registered, then no functionality is degraded within the kernel. Only the loss of some cpu time to check the pointers at the top of the old functions. Now, if a module is loaded that registers a set of functions that have increased functionality compared to the original functions, if that modules is not based off GPL'd code, must the source code of that module be released under the GPL? Thanks in advance, Jason Wohlgemuth - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/