public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Pfaff <pfaffben@msu.edu>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch] ess maestro, support for hardware volume control
Date: 09 Jun 2001 23:43:46 -0400	[thread overview]
Message-ID: <877kyl2e4t.fsf@pfaffben.user.msu.edu> (raw)
In-Reply-To: <E158sHF-0004Vl-00@the-village.bc.nu>
In-Reply-To: Alan Cox's message of "Sun, 10 Jun 2001 00:36:21 +0100 (BST)"

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>

  reply	other threads:[~2001-06-10  3:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-09 17:09 [patch] ess maestro, support for hardware volume control Lukas Schroeder
2001-06-09 17:25 ` Zach Brown
2001-06-09 18:16   ` Lukas Schroeder
2001-06-09 18:50     ` Zach Brown
2001-06-09 18:58       ` Alan Cox
2001-06-09 19:31 ` Alan Cox
2001-06-09 21:23   ` Ben Pfaff
2001-06-09 22:52     ` Zach Brown
2001-06-10 10:10       ` Abramo Bagnara
2001-06-09 23:36     ` Alan Cox
2001-06-10  3:43       ` Ben Pfaff [this message]
2001-06-10 13:08         ` Alan Cox
2001-06-10 17:53           ` Riley Williams
2001-06-12 12:31     ` Lukas Schroeder

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=877kyl2e4t.fsf@pfaffben.user.msu.edu \
    --to=pfaffben@msu.edu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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