At Tue, 20 Jun 2006 17:27:12 +0200, I wrote: > > At Tue, 20 Jun 2006 14:21:52 +0200, > I wrote: > > > > At Sat, 17 Jun 2006 02:01:39 -0700, > > Sam Revitch wrote: > > > > > > The last patch has other problems -- races in mixer_oss/pcm_oss, build > > > failures with disable-verbose-procfs, etc.. :-( To avoid spamming > > > this list with another file attachment the latest one is posted here: > > > > > > http://lsb.blogdns.net/files/snd-disconnect.patch > > > > The patch still has a problem with ac97_codec.c that has also own > > lowlevel device. opl3 and opl4 have to be fixed. > > > > Looking through the patch, I found that unregister callback can be > > replaced simply with disconnect + free. This will remove the > > complexity a bit. I'll try to make another patch based on yours. > > The resultant patch is below. Also the below is to alsa-driver tree. Takashi diff -r c272885c5162 acore/memory_debug.c --- a/acore/memory_debug.c Mon Jun 19 17:21:19 2006 +0200 +++ b/acore/memory_debug.c Tue Jun 20 17:23:28 2006 +0200 @@ -169,7 +169,6 @@ int __init snd_memory_info_init(void) void __exit snd_memory_info_done(void) { - if (snd_memory_info_entry) - snd_info_unregister(snd_memory_info_entry); + snd_info_free_entry(snd_memory_info_entry); } #endif diff -r c272885c5162 usb/usbaudio.patch --- a/usb/usbaudio.patch Mon Jun 19 17:21:19 2006 +0200 +++ b/usb/usbaudio.patch Tue Jun 20 17:23:28 2006 +0200 @@ -1,5 +1,5 @@ ---- ../alsa-kernel/usb/usbaudio.c 2006-03-14 12:20:41.000000000 +0100 -+++ usbaudio.c 2006-03-14 12:37:54.000000000 +0100 +--- ../alsa-kernel/usb/usbaudio.c 2006-06-20 12:49:23.000000000 +0200 ++++ usbaudio.c 2006-06-20 12:51:01.000000000 +0200 @@ -1,3 +1,4 @@ +#include "usbaudio.inc" /* @@ -137,7 +137,7 @@ continue; /* must be isochronous */ if ((get_endpoint(alts, 0)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != -@@ -2644,7 +2683,11 @@ +@@ -2645,7 +2684,11 @@ fp->altset_idx = i; fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; @@ -149,7 +149,7 @@ if (snd_usb_get_speed(dev) == USB_SPEED_HIGH) fp->maxpacksize = (((fp->maxpacksize >> 11) & 3) + 1) * (fp->maxpacksize & 0x7ff); -@@ -2925,7 +2968,11 @@ +@@ -2926,7 +2969,11 @@ fp->iface = altsd->bInterfaceNumber; fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; @@ -161,7 +161,7 @@ switch (fp->maxpacksize) { case 0x120: -@@ -2993,7 +3040,11 @@ +@@ -2994,7 +3041,11 @@ fp->iface = altsd->bInterfaceNumber; fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; @@ -173,7 +173,7 @@ fp->rate_max = fp->rate_min = combine_triple(&alts->extra[8]); stream = (fp->endpoint & USB_DIR_IN) -@@ -3058,8 +3109,13 @@ +@@ -3059,8 +3110,13 @@ struct usb_host_config *config = dev->actconfig; int err; @@ -187,7 +187,7 @@ snd_printdd("sending Extigy boot sequence...\n"); /* Send message to force it to reconnect with full interface. */ err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev,0), -@@ -3071,8 +3127,13 @@ +@@ -3072,8 +3128,13 @@ if (err < 0) snd_printdd("error usb_get_descriptor: %d\n", err); err = usb_reset_configuration(dev); if (err < 0) snd_printdd("error usb_reset_configuration: %d\n", err); @@ -201,7 +201,7 @@ return -ENODEV; /* quit this anyway */ } return 0; -@@ -3080,6 +3141,8 @@ +@@ -3081,6 +3142,8 @@ static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev) { @@ -210,7 +210,7 @@ u8 buf = 1; snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 0x2a, -@@ -3091,6 +3154,7 @@ +@@ -3092,6 +3155,7 @@ 1, 2000, NULL, 0, 1000); return -ENODEV; } @@ -218,7 +218,7 @@ return 0; } -@@ -3260,8 +3324,13 @@ +@@ -3261,8 +3325,13 @@ chip->index = idx; chip->dev = dev; chip->card = card; @@ -232,7 +232,7 @@ INIT_LIST_HEAD(&chip->pcm_list); INIT_LIST_HEAD(&chip->midi_list); INIT_LIST_HEAD(&chip->mixer_list); -@@ -3346,8 +3415,12 @@ +@@ -3347,8 +3416,12 @@ alts = &intf->altsetting[0]; ifnum = get_iface_desc(alts)->bInterfaceNumber; @@ -245,17 +245,7 @@ if (quirk && quirk->ifnum >= 0 && ifnum != quirk->ifnum) goto __err_val; -@@ -3468,12 +3541,17 @@ - } - usb_chip[chip->index] = NULL; - mutex_unlock(®ister_mutex); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) - snd_card_free(card); -+#else -+ snd_card_free_in_thread(card); -+#endif - } else { - mutex_unlock(®ister_mutex); +@@ -3475,6 +3548,7 @@ } } @@ -263,7 +253,7 @@ /* * new 2.5 USB kernel API */ -@@ -3494,6 +3572,8 @@ +@@ -3495,6 +3569,8 @@ snd_usb_audio_disconnect(interface_to_usbdev(intf), dev_get_drvdata(&intf->dev)); } @@ -272,7 +262,7 @@ static int __init snd_usb_audio_init(void) -@@ -3514,3 +3594,5 @@ +@@ -3515,3 +3591,5 @@ module_init(snd_usb_audio_init); module_exit(snd_usb_audio_cleanup); _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-devel