From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: trying out usb hotplugs Date: Fri, 29 Nov 2002 15:14:28 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Jaroslav Kysela Cc: Clemens Ladisch , "alsa-devel@lists.sourceforge.net" List-Id: alsa-devel@alsa-project.org At Fri, 29 Nov 2002 15:05:21 +0100 (CET), Jaroslav wrote: > > On Fri, 29 Nov 2002, Takashi Iwai wrote: > > > Hi, > > > > the attached is my latest patch. > > could you check it? > > Let's go and make things more complicated (like in my tree on disc): > > 1) waiting for time when all disconnected applications have closed > all file descriptors is a bit problem, because no new/other USB devices > can be connected/disconnected; in my tree, I use thread to postpone > freeing of snd_card_t structure right. i didn't touch this part at all. another possible solution is to put the pending card instance into a stale linked-list like in pcmcia drivers. the pending objects are released at the time when a new device is registered and when the module is removed. but if a kernel-thread can work well, it's better, because it will release the resources asap. > 2) replace file->f_op with fake operations which allows only original > release() callback in snd_card_disconnect(); this point makes things > more and more simple than your code (check all accesses), because we > need to count only open/release calls yes, that's a better solution. > 3) the unfinished problem is still: how to behave, if the disconnect event > comes in the middle of some code; you're right at this point, the > lowlevel driver must handle it > > Please, remove from your code any checks from ioctl(), poll(), read() / > write(). Then commit and I'll merge my tree with yours. ok. Takashi ------------------------------------------------------- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en