From: Takashi Iwai <tiwai@suse.de>
To: Chris Rankin <rankincj@yahoo.com>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: SoundScape driver... FIXMEs
Date: Mon, 23 Sep 2002 14:51:17 +0200 [thread overview]
Message-ID: <s5h7khcq37e.wl@alsa2.suse.de> (raw)
In-Reply-To: <20020923122856.24522.qmail@web40606.mail.yahoo.com>
At Mon, 23 Sep 2002 13:28:56 +0100 (BST),
Chris Rankin wrote:
>
> > i don't see any particular part that restricts to
> > module (except that
> > the driver needs firmware to be loaded via ioctl).
> > am i missing something?
>
> Only that it's OBSCENELY more difficult to develop a
> driver if you compile it into the kernel every time...
> Unless you ENJOY rebooting your machine, of course.
yes, but it should not be the reason to stop compiling the built-in
driver via ifdef. why not just put a warning something like "this
driver is not tested as built-in", if you are not sure?
> > > - I was not aware that "verify_area()" had been
> > > deprecated.
>
> > verify_area() is simply not necessary
> > if you use copy_from/to_user().
>
> Aha, but that's not the same as "deprecated" at all
> ;-).
no. it's still alive even on 2.5 tree.
> I only do one big "verify_area()" up front to simplify
> the DMA-uploading loop. This way, I know before I even
> begin that *entire* address range is valid, and so I
> don't need to worry about __copy_from_user() being
> passed an invalid address.
>
> There is only one verify_area() call, but several
> __copy_from_user() calls because the firmware is 64K
> long, but I upload it in contiguous chunks.
>
> > generally it's recommended to check the return value
> > from
> > copy_from/to_user() at each call and to return
> > -EFAULT, because it can be faster.
>
> Note that copy_from_user() effectively calls
> verify_area() and so may return -EFAULT. However, I
> call __copy_from_user() instead, having already
> checked the entire address range. In other words, I
> perform 1 call to verify_area() and N calls to
> __copy_from_user(), rather than the equivalent of N
> calls to verify_area() and N calls to
> __copy_from_user(). Also, I don't need to keep on
> checking for -EFAULT
> inside the loop.
yeah, i know. that's why i wrote "generally", above.
i don't think putting these checks into one verify_area() improves the
performance so much. checking the return value of copy_from/to_user()
is more obvious, i think. anyway, it's a matter of taste.
> > another point: doesn't the busy-loop in
> > host_read/write_ctrl_unsafe
> > need udelay() or something to produce a certain
> > delay length?
> > otherwise the timeout is very dependent on a
> > machine.
>
> Yes, possibly. Provided udelay() isn't deprecated and
> doesn't schedule or anything.
no and no. it's a simply busy delay for the given time length
with _relatively_ good accuracy (up to 1ms).
> I tested this driver on
> a P120 - not exactly a speed daemon... ;-)!
ah, then the current driver will fail definitely on 2GHz P4 ;)
ciao,
Takashi
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
next prev parent reply other threads:[~2002-09-23 12:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-22 19:09 SoundScape driver... FIXMEs Chris Rankin
2002-09-23 10:56 ` Takashi Iwai
2002-09-23 12:28 ` Chris Rankin
2002-09-23 12:51 ` Takashi Iwai [this message]
2002-09-23 19:43 ` Chris Rankin
2002-09-24 10:34 ` Takashi Iwai
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=s5h7khcq37e.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=rankincj@yahoo.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 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.