Re: [patch] ess maestro, support for hardware volume control

From: Ben Pfaff (pfaffben@msu.edu)
Date: Sat Jun 09 2001 - 22:43:46 EST


Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

> > BTW, what is the officially approved way to open a device on a
> > dynamic misc minor? Reading /proc/misc for the minor number,
>
> Ask for minor 0 I believe, then load the module then see what you got.
>
> > then mknod'ing a device and opening it seems to me to have a
> > nasty race condition, am I missing something here?

I think that's not what I was thinking of, here's an outline.
What can happen as I see it is that userspace #2, which wants to
talk to a particular misc driver, actually ends up talking to a
different one because the minor gets reassigned between reading
/proc/misc to find out the number and mknoding and opening the
device:

kernel userspace #1 userspace #2
------ ------------ ------------
                        insmod maestro
grab a misc minor
                                                read /proc/misc
                                                mknod device
                        rmmod maestro
release misc minor
                        insmod something else
grab same misc minor
                                                open device
                                                read from device

Is this just something where you say "don't let that happen",
or...?

I didn't really want to use a dynamic minor but Linus doesn't
want to give out any more fixed assignments, right?

> Ultimately if its a device of its own it probably wants to be part of the
> input device frame work - as for example the volume knob on my USB speakers is

Any idea what code I should be looking at to do something like
that, drivers/usb/audio.c is a big file (is it in there or
somewhere else?).

Thanks,

Ben.

-- 
Regarding a Microsoft/Xerox agreement:
	"This is a match made in heaven. 
	 Both companies excel at copying other people's work."
--douglas@min.net <URL:http://slashdot.org/article.pl?sid=99/05/16/2211252>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 15 2001 - 21:00:11 EST