Skip to contentSkip to conversation

no set_current_state()

Kernel-janitors Oliver Neukum 3 participants 8 messages Jul 13, 2004 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Am Dienstag, 13. Juli 2004 19:52 schrieb Nishanth Aravamudan:

Quoted 7 lines

Hi,

In continuing to replace, where appropriate, code with msleep() calls, I ran across the following file(s) / function(s), which do not invoke set_current_state() before schedule_timeout(), which causes the latter to return immediately:

Quoted 5 lines

drivers/usb/media/dabusb.c::dabusb_open()

If someone could tell me which state (TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE) is desired, I can fix this and perhaps replace the calls with msleep().

TASK_INTERRUPTIBLE. It checks for pending signals. While you are at it, try to move the check for nonblocking outside of the loop.

HTH
Oliver

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

Am Dienstag, 13. Juli 2004 19:54 schrieb Nishanth Aravamudan:

Quoted 8 lines

Hi,

In continuing to replace, where appropriate, code with msleep() calls, I ran across the following file(s) / function(s), which do not invoke set_current_state() before schedule_timeout(), which causes the latter to return immediately:

drivers/usb/media/ov511.c::init_ov_sensor()

Should use msleep.

Quoted 1 line

drivers/usb/media/ov511.c::ov7xx0_configure()

also msleep

HTH
Oliver

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to Oliver Neukum

Am Dienstag, 13. Juli 2004 19:57 schrieb Nishanth Aravamudan:

Quoted 8 lines

Hi,

In continuing to replace, where appropriate, code with msleep() calls, I ran across the following file(s) / function(s), which do not invoke set_current_state() before schedule_timeout(), which causes the latter to return immediately:

drivers/usb/misc/tiglusb.c::tiglusb_open()

TASK_INTERRUPTIBLE

HTH
Oliver

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#3 lore raw
In reply to Oliver Neukum

Am Dienstag, 13. Juli 2004 19:52 schrieb Nishanth Aravamudan:

Quoted 7 lines

Hi,

In continuing to replace, where appropriate, code with msleep() calls, I ran across the following file(s) / function(s), which do not invoke set_current_state() before schedule_timeout(), which causes the latter to return immediately:

Quoted 5 lines

drivers/usb/media/dabusb.c::dabusb_open()

If someone could tell me which state (TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE) is desired, I can fix this and perhaps replace the calls with msleep().

TASK_INTERRUPTIBLE. It checks for pending signals. While you are at it, try to move the check for nonblocking outside of the loop.

HTH
Oliver

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#4 lore raw
In reply to Oliver Neukum

Am Dienstag, 13. Juli 2004 19:54 schrieb Nishanth Aravamudan:

Quoted 8 lines

Hi,

In continuing to replace, where appropriate, code with msleep() calls, I ran across the following file(s) / function(s), which do not invoke set_current_state() before schedule_timeout(), which causes the latter to return immediately:

drivers/usb/media/ov511.c::init_ov_sensor()

Should use msleep.

Quoted 1 line

drivers/usb/media/ov511.c::ov7xx0_configure()

also msleep

HTH
Oliver

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#5 lore raw
In reply to Oliver Neukum

Am Dienstag, 13. Juli 2004 19:57 schrieb Nishanth Aravamudan:

Quoted 8 lines

Hi,

In continuing to replace, where appropriate, code with msleep() calls, I ran across the following file(s) / function(s), which do not invoke set_current_state() before schedule_timeout(), which causes the latter to return immediately:

drivers/usb/misc/tiglusb.c::tiglusb_open()

TASK_INTERRUPTIBLE

HTH
Oliver

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#6 lore raw
In reply to Oliver Neukum
Quoted 3 lines · Nishanth Aravamudan

drivers/usb/gadget/pxa2xx_udc.c::udc_enable()

If someone could tell me which state (TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE) is desired, I can fix this and perhaps replace the calls with msleep().

That'd make a fine msleep(), thanks.

- Dave

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#7 lore raw
In reply to Oliver Neukum
Quoted 10 lines · On Tue, 13 Jul 2004 20:57:14 +0200 Oliver Neukum <[email protected]> wrote:

Am Dienstag, 13. Juli 2004 19:57 schrieb Nishanth Aravamudan:

Quoted 6 lines

In continuing to replace, where appropriate, code with msleep() calls, I ran across the following file(s) / function(s), which do not invoke set_current_state() before schedule_timeout(), which causes the latter to return immediately:

drivers/usb/misc/tiglusb.c::tiglusb_open()

TASK_INTERRUPTIBLE

In this case, Oliver is right. However, do not use TASK_INTERRUPTIBLE in any path which is called from ->release(). When an application is killed with ^C and is exiting, schedule() returns immediately if called so, so the end result would be a fix with no effect.

-- Pete

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors