From: "Mehmet Ceyran" <mceyran@web.de>
To: "'Mike Fedyk'" <mfedyk@matchmail.com>
Cc: <linux-kernel@vger.kernel.org>, <alan@lxorguk.ukuu.org.uk>
Subject: AW: drivers/sound/i810_audio.c bug and patch
Date: Thu, 4 Sep 2003 04:55:06 +0200 [thread overview]
Message-ID: <000201c3728f$f55c42e0$0100a8c0@server1> (raw)
In-Reply-To: <20030904014327.GK16361@matchmail.com>
Hi Mike,
>> Well, why not? The loop will only go through it's body 100 times if
>> the hardware is actually not available or corrupt and even in this
>> case the whole block won't take much time. It works for me and it
>> should work for all the other people using this driver too:
> Why busy wait especially when you can sleep 1ms each time and poll
less?
Well, I can tell you why I chose "busy wait" (kind of brainstorming):
- Why did the originator of the driver made the loop with 10 turns,
which is "busy wait" in your definition too?
- Imagine you have workers and you give them a job that's supposed to be
finished in six minutes. But these workers actually need seven minutes,
which you don't know. If that job is urgent, would you rather look if
it's done yet every 60 minutes or every six minutes? In the first case
(that's your model), you would get your positive result in one hour, in
the second case (my model), you'd get it in 12 minutes.
- Seeing the constant of HZ/20 in "schedule_timeout(HZ/20);" gives me
the feeling that this value is taken from some specification. Perhaps
it's from a i810 datasheet (I will look at that later because it's very
late now), but my fix is for SiS 7012 which could have slightly
different characteristics. In this case, by doing my "busy wait", you
don't modify the existing code which will initialize the chip in less
than or equal to 10 turns.
- When the driver is loaded at boot time I think it's the only piece of
code which is running at that moment, I don't think there are any other
threads working during driver init. If it's loaded as a module, the one
who loads it waits for its results anyway. It's almost impossible that
doing this "busy wait" will affect a running system with many
concurrently running processes at a high system load _noticeably_. It
will instead come to a result faster if the hardware is available (see
point 1).
Best Regards,
Mehmet
next prev parent reply other threads:[~2003-09-04 2:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-03 12:22 Who maintains drivers/sound/i810_audio.c? Mehmet Ceyran
2003-09-03 12:29 ` Marc-Christian Petersen
2003-09-03 23:31 ` drivers/sound/i810_audio.c bug and patch Mehmet Ceyran
2003-09-04 1:43 ` Mike Fedyk
2003-09-04 2:55 ` Mehmet Ceyran [this message]
2003-09-04 11:01 ` Alan Cox
2003-09-04 17:53 ` Mike Fedyk
2003-09-04 11:01 ` Alan Cox
2003-09-03 15:00 ` Who maintains drivers/sound/i810_audio.c? Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000201c3728f$f55c42e0$0100a8c0@server1' \
--to=mceyran@web.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mfedyk@matchmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox