* [KJ] polling in drivers/cdrom/aztcd.c
@ 2005-11-18 11:57 Daniel Marjamäki
2005-11-26 20:27 ` Alexey Dobriyan
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Marjamäki @ 2005-11-18 11:57 UTC (permalink / raw)
To: kernel-janitors
Hello!
I saw this in version 2.6.14.1 of linux.
Does anybody have any input on this matter?
In the file there are several polling routines like the one below, and they are repeatedly called.
The loop will repeat 8 million times before it times out!
I suspect we can make huge improvements here. I'm having 3 improvements in mind:
1. Time out based on actual time rather than on repetitions.
2. Sleep between each repetition. How can I sleep say.. 10-50 us? Is it possible?
3. On time out, return an error code. The callers always assume that the polling succeeded!
static void pa_ok(void)
{
aztTimeOutCount = 0;
do {
aztIndatum = inb(DATA_PORT);
aztTimeOutCount++;
if (aztTimeOutCount >= AZT_TIMEOUT) {
printk("aztcd: Error Wait PA_OK\n");
break;
}
} while (aztIndatum != AFL_PA_OK);
}
Best Regards,
Daniel Marjamäki
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [KJ] polling in drivers/cdrom/aztcd.c
2005-11-18 11:57 [KJ] polling in drivers/cdrom/aztcd.c Daniel Marjamäki
@ 2005-11-26 20:27 ` Alexey Dobriyan
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Dobriyan @ 2005-11-26 20:27 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 787 bytes --]
On Fri, Nov 18, 2005 at 12:57:18PM +0100, Daniel Marjam?ki wrote:
> I saw this in version 2.6.14.1 of linux.
> Does anybody have any input on this matter?
Bzzrt... The thing was commented out 19 months ago.
# 2004/05/19 16:39:03-07:00 akpm
# [PATCH] drivers/cdrom/aztcd.c warning fix.
#
# From: "Luiz Fernando N. Capitulino"
#
# drivers/cdrom/azctd.c:379: warning: `pa_ok' defined but not used
> static void pa_ok(void)
> {
> aztTimeOutCount = 0;
> do {
> aztIndatum = inb(DATA_PORT);
> aztTimeOutCount++;
> if (aztTimeOutCount >= AZT_TIMEOUT) {
> printk("aztcd: Error Wait PA_OK\n");
> break;
> }
> } while (aztIndatum != AFL_PA_OK);
> }
[-- 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] 2+ messages in thread
end of thread, other threads:[~2005-11-26 20:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-18 11:57 [KJ] polling in drivers/cdrom/aztcd.c Daniel Marjamäki
2005-11-26 20:27 ` Alexey Dobriyan
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.