All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH 1/21] polling loops: change exit condition to
@ 2005-12-04  0:12 Marcin Slusarz
  2005-12-04 19:57 ` Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marcin Slusarz @ 2005-12-04  0:12 UTC (permalink / raw)
  To: kernel-janitors

hello everyone
here is the first part of patch which changes many polling loops to use
jiffies and time_after / time_before instead of counters
most of the changes are in drivers directory (except first patch)
as it is my first patch for linux kernel, feel free to point out any
mistake you'll find

(this task is the last entry of kernel-janitors todo: http://janitor.kernelnewbies.org/TODO)

LINUX FOR POWER MACINTOSH
P:	Benjamin Herrenschmidt
M:	benh@kernel.crashing.org

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
diff -upr -X linux-2.6.15-rc4/Documentation/dontdiff linux-2.6.15-rc4-orig/arch/ppc/platforms/pmac_smp.c linux-2.6.15-rc4/arch/ppc/platforms/pmac_smp.c
--- linux-2.6.15-rc4-orig/arch/ppc/platforms/pmac_smp.c	2005-12-03 15:22:31.000000000 +0100
+++ linux-2.6.15-rc4/arch/ppc/platforms/pmac_smp.c	2005-12-03 16:51:58.000000000 +0100
@@ -675,11 +675,10 @@ void cpu_die(void)
 
 void __cpu_die(unsigned int cpu)
 {
-	int timeout;
+	unsigned long end_time = jiffies + msecs_to_jiffies(1000);
 
-	timeout = 1000;
 	while (!cpu_dead[cpu]) {
-		if (--timeout = 0) {
+		if (time_after(jiffies, end_time)) {
 			printk("CPU %u refused to die!\n", cpu);
 			break;
 		}
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [PATCH 1/21] polling loops: change exit condition to
  2005-12-04  0:12 [KJ] [PATCH 1/21] polling loops: change exit condition to Marcin Slusarz
@ 2005-12-04 19:57 ` Arnd Bergmann
  2005-12-04 20:18 ` Nishanth Aravamudan
  2005-12-05 17:12 ` [KJ] [PATCH 1/21] polling loops: change exit condition Marcin Slusarz
  2 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2005-12-04 19:57 UTC (permalink / raw)
  To: kernel-janitors

Am Sonntag 04 Dezember 2005 01:12 schrieb Marcin Slusarz:
> hello everyone
> here is the first part of patch which changes many polling loops to use
> jiffies and time_after / time_before instead of counters
> most of the changes are in drivers directory (except first patch)
> as it is my first patch for linux kernel, feel free to point out any
> mistake you'll find

Hmm, what happened to the poll_event API that Nish had suggested
some time ago for this problem? Was there an actual reason against
merging it or did the patch just get lost?

	Arnd <><
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [PATCH 1/21] polling loops: change exit condition to
  2005-12-04  0:12 [KJ] [PATCH 1/21] polling loops: change exit condition to Marcin Slusarz
  2005-12-04 19:57 ` Arnd Bergmann
@ 2005-12-04 20:18 ` Nishanth Aravamudan
  2005-12-05 17:12 ` [KJ] [PATCH 1/21] polling loops: change exit condition Marcin Slusarz
  2 siblings, 0 replies; 4+ messages in thread
From: Nishanth Aravamudan @ 2005-12-04 20:18 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

On 04.12.2005 [20:57:52 +0100], Arnd Bergmann wrote:
> Am Sonntag 04 Dezember 2005 01:12 schrieb Marcin Slusarz:
> > hello everyone
> > here is the first part of patch which changes many polling loops to use
> > jiffies and time_after / time_before instead of counters
> > most of the changes are in drivers directory (except first patch)
> > as it is my first patch for linux kernel, feel free to point out any
> > mistake you'll find
> 
> Hmm, what happened to the poll_event API that Nish had suggested
> some time ago for this problem? Was there an actual reason against
> merging it or did the patch just get lost?

A good question. I'll try to dig up my patch from my old machine and
take a look if it can be used instead of all these changes.

Thanks,
Nish

[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [PATCH 1/21] polling loops: change exit condition
  2005-12-04  0:12 [KJ] [PATCH 1/21] polling loops: change exit condition to Marcin Slusarz
  2005-12-04 19:57 ` Arnd Bergmann
  2005-12-04 20:18 ` Nishanth Aravamudan
@ 2005-12-05 17:12 ` Marcin Slusarz
  2 siblings, 0 replies; 4+ messages in thread
From: Marcin Slusarz @ 2005-12-05 17:12 UTC (permalink / raw)
  To: kernel-janitors

Nishanth Aravamudan wrote:
>>>here is the first part of patch which changes many polling loops to use
>>>jiffies and time_after / time_before instead of counters
>>>most of the changes are in drivers directory (except first patch)
>>>as it is my first patch for linux kernel, feel free to point out any
>>>mistake you'll find
>>
>>Hmm, what happened to the poll_event API that Nish had suggested
>>some time ago for this problem? Was there an actual reason against
>>merging it or did the patch just get lost?
> 
> 
> A good question. I'll try to dig up my patch from my old machine and
> take a look if it can be used instead of all these changes.
i think you ment "with", not "instead" ;)
in my ("kernel newbie" ;) humble opinion these macros make code harder
too read

(last version of your patch i found is here: 
http://lists.osdl.org/pipermail/kernel-janitors/2005-March/003699.html)

regards,
Marcin
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2005-12-05 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-04  0:12 [KJ] [PATCH 1/21] polling loops: change exit condition to Marcin Slusarz
2005-12-04 19:57 ` Arnd Bergmann
2005-12-04 20:18 ` Nishanth Aravamudan
2005-12-05 17:12 ` [KJ] [PATCH 1/21] polling loops: change exit condition Marcin Slusarz

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.