* [Kernel-janitors] Re: [PATCH] usb/auerswald: replace
@ 2004-07-28 18:23 Wolfgang Mües
2004-07-28 18:33 ` Nishanth Aravamudan
2004-08-02 21:26 ` Greg KH
0 siblings, 2 replies; 3+ messages in thread
From: Wolfgang Mües @ 2004-07-28 18:23 UTC (permalink / raw)
To: kernel-janitors
Hello Nishanth,
On Wednesday 28 July 2004 01:12, Nishanth Aravamudan wrote:
> I would appreciate any comments from the janitors list.
>
> Applys-to: 2.6.7
>
> Description: Use msleep() instead of schedule_timeout() to
> guarantee the task delays for the desired time.
>
> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
>
>
> --- linux-vanilla/drivers/usb/misc/auerswald.c 2004-06-16
I am the author of this driver.
Can you give me the rationale of the proposed change?
In what sense is msleep() better/other than schedule_timeout?
Note that I am rewriting this driver now. But I have heavy problems with
the error handling of control IN messages and/or INT IN messages on USB
2.0 UHCI in SMP systems....
best regards
Wolfgang Mües
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread* [Kernel-janitors] Re: [PATCH] usb/auerswald: replace 2004-07-28 18:23 [Kernel-janitors] Re: [PATCH] usb/auerswald: replace Wolfgang Mües @ 2004-07-28 18:33 ` Nishanth Aravamudan 2004-08-02 21:26 ` Greg KH 1 sibling, 0 replies; 3+ messages in thread From: Nishanth Aravamudan @ 2004-07-28 18:33 UTC (permalink / raw) To: kernel-janitors [-- Attachment #1: Type: text/plain, Size: 1780 bytes --] On Wed, Jul 28, 2004 at 08:23:23PM +0200, Wolfgang M?es wrote: > Hello Nishanth, > > On Wednesday 28 July 2004 01:12, Nishanth Aravamudan wrote: > > I would appreciate any comments from the janitors list. > > > > Applys-to: 2.6.7 > > > > Description: Use msleep() instead of schedule_timeout() to > > guarantee the task delays for the desired time. > > > > Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> > > > > > > --- linux-vanilla/drivers/usb/misc/auerswald.c 2004-06-16 > > I am the author of this driver. > > Can you give me the rationale of the proposed change? > In what sense is msleep() better/other than schedule_timeout? Certainly. Some of this is going to be a repetition from previous posts to the list, but oh well. In this particular case, the rationale is quite simple. There are certain situations -- the details of which I will have to defer to Greg Kroah-Hartman for -- in which a code snippet such as: set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(some_time); will not delay as desired, i.e. the task resumes *before* some_time has elapsed, instead of after. To prevent this condition from occuring, msleep() wraps the schedule_timeout() in a while-loop on the timeout value. Thus, as long as the timeout retains a positive value the task gives the CPU back up and delays again. And once the timeout is 0, the task is resumed. For the details, I recommend consulting the source (kernel/timer.c). Also, and this is less technical, but msleep() allows code to be written in terms of milliseconds instead of jiffies, which is far clearer to a person, IMO. All rounding issues are taken care of by msleep() as well, as it uses msecs_to_jiffies() to calculate the correct delay value for schedule_timeout(). Does that help? Thanks, Nish [-- Attachment #2: Type: text/plain, Size: 167 bytes --] _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org http://lists.osdl.org/mailman/listinfo/kernel-janitors ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Kernel-janitors] Re: [PATCH] usb/auerswald: replace 2004-07-28 18:23 [Kernel-janitors] Re: [PATCH] usb/auerswald: replace Wolfgang Mües 2004-07-28 18:33 ` Nishanth Aravamudan @ 2004-08-02 21:26 ` Greg KH 1 sibling, 0 replies; 3+ messages in thread From: Greg KH @ 2004-08-02 21:26 UTC (permalink / raw) To: kernel-janitors [-- Attachment #1: Type: text/plain, Size: 351 bytes --] On Tue, Jul 27, 2004 at 04:12:36PM -0700, Nishanth Aravamudan wrote: > I would appreciate any comments from the janitors list. > > Applys-to: 2.6.7 > > Description: Use msleep() instead of schedule_timeout() to > guarantee the task delays for the desired time. > > Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Applied, thanks. greg k-h [-- Attachment #2: Type: text/plain, Size: 167 bytes --] _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org http://lists.osdl.org/mailman/listinfo/kernel-janitors ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-08-02 21:26 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2004-07-28 18:23 [Kernel-janitors] Re: [PATCH] usb/auerswald: replace Wolfgang Mües 2004-07-28 18:33 ` Nishanth Aravamudan 2004-08-02 21:26 ` Greg KH
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.