Skip to contentSkip to conversation

prism54/islpci_dev: replace schedule_timeout() with msleep()

PATCH Margit Schubert-While 3 participants 3 messages Sep 2, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

On Thu, 02 Sep 2004, Maximilian scribeth:

Quoted 1 line

it shouldn't hinder 2.6 in it's progression.

I consider this a regression.
As schedule_timeout is used elesewhere in the prism54 code, we are using a consistent and documented method.

Margit

#1 lore raw
Quoted 5 lines · Margit Schubert-While

On Thu, 02 Sep 2004, Maximilian scribeth:

Quoted 1 line

it shouldn't hinder 2.6 in it's progression.

I consider this a regression.
As schedule_timeout is used elesewhere in the prism54 code, we are using a consistent and documented method.

you didn't answer to the unit argument in favour of msleep.

shure msleep is also consistent and documented.

--
maks
kernel janitor http://janitor.kernelnewbies.org/

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

#2 lore raw
Quoted 7 lines · maximilian attems
Quoted 5 lines · Margit Schubert-While

On Thu, 02 Sep 2004, Maximilian scribeth:

Quoted 1 line

it shouldn't hinder 2.6 in it's progression.

I consider this a regression.
As schedule_timeout is used elesewhere in the prism54 code, we are using a consistent and documented method.

A grep of drivers/net/wireless/prism54 for schedule_timeout showed three occurrences (in 2.6.9-rc1-bk7):

islpci_dev.c:   schedule_timeout(50*HZ/1000);
islpci_dev.c:           remaining = schedule_timeout(HZ);
islpci_mgt.c:           timeleft = schedule_timeout(wait_cycle_jiffies);

The first is removed by my patch.

The second & third are potentially bugs as there is no set_current_state() preceding the call to schedule_timeout(). As per the source:

/**
* schedule_timeout - sleep until timeout
* @timeout: timeout value in jiffies
*
* Make the current task sleep until @timeout jiffies have
* elapsed. The routine will return immediately unless
* the current task state has been set (see set_current_state()).

Therefore, in the current code, the schedule_timeout() call does not have the desired effect (the same information is available in kernel-hacking.ps).

Both of these calls should probably be fixed, but I'm not sure if you wish to sleep in TASK_INTERUPTIBLE or TASK_UNINTERRUPTIBLE. Keep in mind that msleep_interruptible() is also (hopefully) being pushed to the kernel soon.

As to consistency or documentation . . . I have no evidence to suggest that msleep() is inconsistent. And I don't think there is any need for more documentation than the source in this case:

/**
* msleep - sleep safely even with waitqueue interruptions
* @msecs: Time in milliseconds to sleep for
*/

Hope this helps clear things up.

-Nish

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