netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [patch 8/8]  prism54/islpci_dev: replace schedule_timeout() with msleep()
@ 2004-09-02  9:35 Margit Schubert-While
  2004-09-02 10:03 ` maximilian attems
  0 siblings, 1 reply; 10+ messages in thread
From: Margit Schubert-While @ 2004-09-02  9:35 UTC (permalink / raw)
  To: netdev; +Cc: janitor

On Thu, 02 Sep 2004, Maximilian scribeth:
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [patch 8/8]  prism54/islpci_dev: replace schedule_timeout() with msleep()
@ 2004-09-02 17:52 Margit Schubert-While
  2004-09-02 18:27 ` Nishanth Aravamudan
  0 siblings, 1 reply; 10+ messages in thread
From: Margit Schubert-While @ 2004-09-02 17:52 UTC (permalink / raw)
  To: netdev; +Cc: janitor, nacc

On Thu, 02 Sep 2004, Nishanth scribeth:
> Keep in mind that msleep_interruptible() is also
> (hopefully) being pushed to the kernel soon

I think you need this for your current patch set ;-)
eg. In e100, where you replace an interruptible timeout:
> @@ -2020,8 +2016,7 @@

I don't think that's correct.

Margit

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [patch 8/8]  prism54/islpci_dev: replace schedule_timeout() with msleep()
@ 2004-09-02 17:30 Margit Schubert-While
  0 siblings, 0 replies; 10+ messages in thread
From: Margit Schubert-While @ 2004-09-02 17:30 UTC (permalink / raw)
  To: netdev; +Cc: janitor

On Thu, 02 Sep 2004, Nishanth scribeth:
> 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:

Nope, look a few lines above:
DEFINE_WAIT() and prepare_to_wait().

Margit

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [patch 8/8]  prism54/islpci_dev: replace schedule_timeout() with msleep()
@ 2004-09-02 10:21 Margit Schubert-While
  0 siblings, 0 replies; 10+ messages in thread
From: Margit Schubert-While @ 2004-09-02 10:21 UTC (permalink / raw)
  To: netdev; +Cc: janitor

On Thu, 02 Sep 2004, Maximilian scribeth:
> you didn't answer to the unit argument in favour of msleep.

Don't need to, here's msleep -
void msleep(unsigned int msecs)
{
        unsigned long timeout = msecs_to_jiffies(msecs);

        while (timeout) {
                set_current_state(TASK_UNINTERRUPTIBLE);
                timeout = schedule_timeout(timeout);
        }
}

In other words, with the subtle exception of the while loop,
it reconstitutes the original code.
(Although m_to_j doesn't even exactly do that)
(And note because of the while loop, this may not be 
 what the author intended)

> shure msleep is also consistent and documented.
grep -r Documentation = Nix

Margit

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [patch 8/8]  prism54/islpci_dev: replace schedule_timeout() with msleep()
@ 2004-09-02  6:50 Margit Schubert-While
  2004-09-02  8:24 ` [Kernel-janitors] " maximilian attems
  0 siblings, 1 reply; 10+ messages in thread
From: Margit Schubert-While @ 2004-09-02  6:50 UTC (permalink / raw)
  To: netdev; +Cc: janitor

I agree with Jean and add the following :
You are assuming HZ = 1000.
In 2.4, HZ = 100 (And in 2.6, HZ is not necessarily = 1000).
The prism54 code base is identical between 2.4/2.6 and is
maintained as such in the project.
Therefore, I look forward to your implementation of msleep()
in 2.4  ;-)

Margit

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [patch 8/8]  prism54/islpci_dev: replace  schedule_timeout() with msleep()
@ 2004-09-01 21:06 janitor
  0 siblings, 0 replies; 10+ messages in thread
From: janitor @ 2004-09-01 21:06 UTC (permalink / raw)
  To: netdev; +Cc: jgarzik, jt, janitor







I would appreciate any comments from the janitor@sternweltens list. 



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>
Signed-off-by: Maximilian Attems <janitor@sternwelten.at>



---

 linux-2.6.9-rc1-bk7-max/drivers/net/wireless/prism54/islpci_dev.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff -puN drivers/net/wireless/prism54/islpci_dev.c~msleep-drivers_net_wireless_prism54_islpci_dev drivers/net/wireless/prism54/islpci_dev.c
--- linux-2.6.9-rc1-bk7/drivers/net/wireless/prism54/islpci_dev.c~msleep-drivers_net_wireless_prism54_islpci_dev	2004-09-01 19:35:41.000000000 +0200
+++ linux-2.6.9-rc1-bk7-max/drivers/net/wireless/prism54/islpci_dev.c	2004-09-01 19:35:41.000000000 +0200
@@ -436,8 +436,7 @@ prism54_bring_down(islpci_private *priv)
 	wmb();
 
 	/* wait a while for the device to reset */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(50*HZ/1000);
+	msleep(50);
 
 	return 0;
 }

_

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-09-02 18:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-02  9:35 [patch 8/8] prism54/islpci_dev: replace schedule_timeout() with msleep() Margit Schubert-While
2004-09-02 10:03 ` maximilian attems
2004-09-02 16:23   ` [Kernel-janitors] " Nishanth Aravamudan
  -- strict thread matches above, loose matches on Subject: below --
2004-09-02 17:52 Margit Schubert-While
2004-09-02 18:27 ` Nishanth Aravamudan
2004-09-02 17:30 Margit Schubert-While
2004-09-02 10:21 Margit Schubert-While
2004-09-02  6:50 Margit Schubert-While
2004-09-02  8:24 ` [Kernel-janitors] " maximilian attems
2004-09-02 16:09   ` Nishanth Aravamudan
2004-09-01 21:06 janitor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).