usb/dabusb: insert set_current_state()
Subsystems (2)
PATCH 1/1 usb/dabusb: insert set_current_state()
I would appreciate any comments from the janitors list.
Applys-to: 2.6.7
Description: Move non-blocking conditional check outside while-loop. Insert set_current_stateo() so schedule_timeout() functions as expected.
drivers/usb/media/dabusb.c +5 -3
@@ -592,12 +592,14 @@ static int dabusb_open (struct inode *indbg ("dabusb_open" );down (&s->mutex); +if (file->f_flags &O_NONBLOCK ) { +return -EBUSY ; + } +while (!s->usbdev || s->opened) {up (&s->mutex); -if (file->f_flags &O_NONBLOCK ) { -return -EBUSY ; - } +set_current_state (TASK_INTERRUPTIBLE );schedule_timeout (HZ /2 );if (signal_pending (current)) {
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
PATCH 1/1 usb/dabusb: insert set_current_state()
I would appreciate any comments from the janitors list.
Applys-to: 2.6.7
Description: Insert set_current_stateo() so schedule_timeout() functions as expected.
drivers/usb/misc/tiglusb.c +1 -0
@@ -115,6 +115,7 @@ tiglusb_open (struct inode *inode, strucreturn -EBUSY ; } +set_current_state (TASK_INTERRUPTIBLE );schedule_timeout (HZ /2 );if (signal_pending (current)) {
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
After discussing this patch with Mark Hollomon, I think it is much safer / better to leave the conditional check within the while loop. This way the mutex state is as expected and maintainability is not compromised. The previous patch should not be applied.
Applys-to: 2.6.7
Description: Inserts appropriate set_current_state() call so that schedule_timeout() functions as expected.
drivers/usb/media/dabusb.c +1 -0
@@ -598,6 +598,7 @@ static int dabusb_open (struct inode *inif (file->f_flags &O_NONBLOCK ) {return -EBUSY ; } +set_current_state (TASK_INTERRUPTIBLE );schedule_timeout (HZ /2 );if (signal_pending (current)) {
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors