From: Luis R. Rodriguez <hidden> Date: 2004-09-23 22:55:07
On Thu, Sep 23, 2004 at 03:13:03PM -0700, Nishanth Aravamudan wrote:
quoted hunk
Any comments would be appreciated.
Description: Use msleep() instead of schedule_timeout()
to guarantee the task delays as expected. Also set_current_state() is
inserted before schedule_timeout(). If the for-loop were to execute
twice, the second time would not set the state before sleeping in the
current code; this causes schedule_timeout() to return immediately.
Signed-off-by: Nishanth Aravamudan <redacted>
@@ -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);return0;}
@@ -489,6 +488,7 @@ islpci_reset_if(islpci_private *priv)/* The software reset acknowledge needs about 220 msec here.*Beconservativeandwaitforuptoonesecond.*/+set_current_state(TASK_UNINTERRUPTIBLE);remaining=schedule_timeout(HZ);if(remaining>0){
Looks good to me. IIRC Margit had something to say about this last time
this popped around -- CC'ing her to see if there are any outstanding
comments.
PS. For future prism54 patches please feel free to CC prism54-devel and
netdev.
Luis
--
GnuPG Key fingerprint = 113F B290 C6D2 0251 4D84 A34A 6ADD 4937 E20A 525E
From: Margit Schubert-While <hidden> Date: 2004-09-24 07:43:10
Hi Nish,
At 18:55 23.09.2004 -0400, Luis scribeth:
On Thu, Sep 23, 2004 at 03:13:03PM -0700, Nishanth Aravamudan wrote:
quoted
Any comments would be appreciated.
Description: Use msleep() instead of schedule_timeout()
to guarantee the task delays as expected. Also set_current_state() is
inserted before schedule_timeout(). If the for-loop were to execute
twice, the second time would not set the state before sleeping in the
current code; this causes schedule_timeout() to return immediately.
Signed-off-by: Nishanth Aravamudan <redacted>
---
@@ -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; }
@@ -489,6 +488,7 @@ islpci_reset_if(islpci_private *priv) /* The software reset acknowledge needs about 220 msec here. * Be conservative and wait for up to one second. */+ set_current_state(TASK_UNINTERRUPTIBLE); remaining = schedule_timeout(HZ); if(remaining > 0) {
Looks good to me. IIRC Margit had something to say about this last time
this popped around -- CC'ing her to see if there are any outstanding
comments.
You bet she has.
The patch has wrong line numbers. Doesn't take into account the stacked up
netdev changes. (Therefore CC'ing Jeff Garzik)
This breaks 2.4 compatibility.
So either backport to 2.4 or Nish can take over prism54 2.4 maintenance ;-)
Don't say a backport is not possible/reasonable, it happened with
netdev_priv().
(In 2.4.27; At least there, we have HAVE_NETDEV_PRIV).
If this is going to be forced, can we at least have a
define HAVE_MSLEEP in delay.h ?
I am somewhat confused by the second part of the patch.
What has that got to do with msleep ?
Actually, the fix would appear to be correct, but that is a seperate issue
and nothing to do with msleep.
(Prims54 developers -> I'll take a look over the weekend)
I am sceptical about the whole msleep patchset as, by their own admission,
the janitors have/can not (no hardware) test the majority of the changes.
Even more worrying is that incorrect code has directly appeared in
mainline kernel BK.
Margit
From: maximilian attems <hidden> Date: 2004-09-24 16:34:00
On Fri, 24 Sep 2004, Margit Schubert-While wrote:
..
The patch has wrong line numbers. Doesn't take into account the stacked up
netdev changes. (Therefore CC'ing Jeff Garzik)
sure the kj patches are against mainline.
This breaks 2.4 compatibility.
So either backport to 2.4 or Nish can take over prism54 2.4 maintenance ;-)
can't remember the last time when Randy submitted janitorial patches to
2.4.x, but it's long ago. 2.4 is in maintenance mode.
Don't say a backport is not possible/reasonable, it happened with
netdev_priv().
(In 2.4.27; At least there, we have HAVE_NETDEV_PRIV).
there must have been serious reasons for that.
If this is going to be forced, can we at least have a
define HAVE_MSLEEP in delay.h ?
I am somewhat confused by the second part of the patch.
What has that got to do with msleep ?
basically a lot, because as prism54 lots of drivers forgo/et to set
there state when calling schedule_timeout().
Actually, the fix would appear to be correct, but that is a seperate issue
and nothing to do with msleep.
(Prims54 developers -> I'll take a look over the weekend)
great, please also remove the unused TRACE macro.
(patch was sent to netdev on 3. Sept).
the kj mailing list got another submission to correct
the __FUNCTION__ use their. :)
I am sceptical about the whole msleep patchset as, by their own admission,
the janitors have/can not (no hardware) test the majority of the changes.
Even more worrying is that incorrect code has directly appeared in
mainline kernel BK.
the named small errors were quickly corrected.
it's up to the driver MAINTAINER to prove us wrong.
we got lots of ack in between.
--
maks
kernel janitor http://janitor.kernelnewbies.org/
From: maximilian attems <hidden> Date: 2004-10-30 22:22:57
On Fri, 01 Oct 2004, Jeff Garzik wrote:
I would rather see an msleep implementation in 2.4.x...
thanks for Domen Puncer at helping out.
msleep() and msleep_interruptible() as found in current 2.6 to 2.4.
therefor also adds the helper functions ssleep(), jiffies_to_msecs(),
jiffies_to_usecs(), msecs_to_jiffies().
compile and boot tested.
Signed-off-by: Maximilian Attems <redacted>
---
include/linux/delay.h | 8 ++++++
include/linux/time.h | 41 +++++++++++++++++++++++++++++++++
kernel/Makefile | 3 +-
kernel/timer.c | 33 ++++++++++++++++++++++++++
4 files changed, 84 insertions(+), 1 deletion(-)
diff -puN kernel/Makefile~add-msleep-2.4 kernel/Makefile
@@ -34,4 +34,12 @@ extern unsigned long loops_per_jiffy;({unsignedlongmsec=(n);while(msec--)udelay(1000);}))#endif+voidmsleep(unsignedintmsecs);+unsignedlongmsleep_interruptible(unsignedintmsecs);++staticinlinevoidssleep(unsignedintseconds)
[...]
+static inline unsigned int jiffies_to_msecs(const unsigned long j)
+static inline unsigned int jiffies_to_usecs(const unsigned long j)
+static inline unsigned long msecs_to_jiffies(const unsigned int m)
I'm pretty sure more than one of these symbols clashes with a symbol
defined locally in a driver. I like the patch but we can't apply it
until the impact on existing code is evaluated.
Jeff
@@ -34,4 +34,12 @@ extern unsigned long loops_per_jiffy;({unsignedlongmsec=(n);while(msec--)udelay(1000);}))#endif+voidmsleep(unsignedintmsecs);+unsignedlongmsleep_interruptible(unsignedintmsecs);++staticinlinevoidssleep(unsignedintseconds)
[...]
quoted
+static inline unsigned int jiffies_to_msecs(const unsigned long j)
quoted
+static inline unsigned int jiffies_to_usecs(const unsigned long j)
quoted
+static inline unsigned long msecs_to_jiffies(const unsigned int m)
I'm pretty sure more than one of these symbols clashes with a symbol
defined locally in a driver. I like the patch but we can't apply it
until the impact on existing code is evaluated.
More than likely much of the code cleanup that was done before I began
my patches, like removing custom msleep()s from drivers will need to
be done again, as Jeff points out.
-Nish
@@ -34,4 +34,12 @@ extern unsigned long loops_per_jiffy;({unsignedlongmsec=(n);while(msec--)udelay(1000);}))#endif+voidmsleep(unsignedintmsecs);+unsignedlongmsleep_interruptible(unsignedintmsecs);++staticinlinevoidssleep(unsignedintseconds)
[...]
quoted
+static inline unsigned int jiffies_to_msecs(const unsigned long j)
quoted
+static inline unsigned int jiffies_to_usecs(const unsigned long j)
quoted
+static inline unsigned long msecs_to_jiffies(const unsigned int m)
I'm pretty sure more than one of these symbols clashes with a symbol
defined locally in a driver. I like the patch but we can't apply it
until the impact on existing code is evaluated.
More than likely much of the code cleanup that was done before I began
my patches, like removing custom msleep()s from drivers will need to
be done again, as Jeff points out.
-Nish
From: maximilian attems <hidden> Date: 2004-10-31 14:43:53
On Sat, 30 Oct 2004, Jeff Garzik wrote:
I'm pretty sure more than one of these symbols clashes with a symbol
defined locally in a driver. I like the patch but we can't apply it
until the impact on existing code is evaluated.
Jeff
current 2.4 has no ssleep() nor jiffies_to_usecs() nor jiffies_to_msecs()
users. so no namespace conflicts on them.
i found a strange unsupported "msleep" syscall in
./arch/parisc/hpux/sys_hpux.c
left this one appart, i resend the msleep patch + 5 cleanup patches.
they remove duplicate msleep() or msecs_to_jiffies() definitions.
they are all compile tested, but the one touching drivers/char/shwdt.c
please show me if i forgot something.
--
maks
kernel janitor http://janitor.kernelnewbies.org/
ps dropped prism54-devel@prism54.org from cc as this ml rejects my mails.
From: maximilian attems <hidden> Date: 2004-10-31 14:43:53
On Sat, 30 Oct 2004, Jeff Garzik wrote:
I'm pretty sure more than one of these symbols clashes with a symbol
defined locally in a driver. I like the patch but we can't apply it
until the impact on existing code is evaluated.
Jeff
current 2.4 has no ssleep() nor jiffies_to_usecs() nor jiffies_to_msecs()
users. so no namespace conflicts on them.
i found a strange unsupported "msleep" syscall in
./arch/parisc/hpux/sys_hpux.c
left this one appart, i resend the msleep patch + 5 cleanup patches.
they remove duplicate msleep() or msecs_to_jiffies() definitions.
they are all compile tested, but the one touching drivers/char/shwdt.c
please show me if i forgot something.
--
maks
kernel janitor http://janitor.kernelnewbies.org/
ps dropped prism54-devel@prism54.org from cc as this ml rejects my mails.
From: maximilian attems <hidden> Date: 2004-10-31 14:45:08
Backport suggested by prism54 folks. idea acked by Jeff.
thanks for Domen Puncer at helping out.
Belows patch adds msleep() and msleep_interruptible() as found
in current 2.6 to 2.4.
therefor adds the helper functions ssleep(), jiffies_to_msecs(),
jiffies_to_usecs(), msecs_to_jiffies().
The namespace clashes for msleep() and msecs_to_jiffies()
are cleanup by the next 5 patches.
Signed-off-by: Maximilian Attems <redacted>
---
linux-2.4.28-rc1-max/include/linux/delay.h | 8 +++++
linux-2.4.28-rc1-max/include/linux/time.h | 41 +++++++++++++++++++++++++++++
linux-2.4.28-rc1-max/kernel/Makefile | 3 +-
linux-2.4.28-rc1-max/kernel/timer.c | 33 +++++++++++++++++++++++
4 files changed, 84 insertions(+), 1 deletion(-)
diff -puN kernel/Makefile~add-msleep-2.4 kernel/Makefile