From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 9 Jun 2001 23:47:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 9 Jun 2001 23:47:39 -0400 Received: from www.cscw.msu.edu ([35.8.233.178]:6413 "EHLO cscw.msu.edu") by vger.kernel.org with ESMTP id ; Sat, 9 Jun 2001 23:47:22 -0400 To: Alan Cox Cc: linux-kernel@vger.kernel.org Subject: Re: [patch] ess maestro, support for hardware volume control In-Reply-To: Reply-To: pfaffben@msu.edu MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII From: Ben Pfaff Date: 09 Jun 2001 23:43:46 -0400 In-Reply-To: Alan Cox's message of "Sun, 10 Jun 2001 00:36:21 +0100 (BST)" Message-ID: <877kyl2e4t.fsf@pfaffben.user.msu.edu> User-Agent: Chaos/1.13.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (i386-debian-linux-gnu) MULE/4.0 (HANANOEN) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Alan Cox 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