# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.425 -> 1.426 # drivers/usb/audio.c 1.13 -> 1.14 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/02/27 david-b@packbell.net 1.426 # PATCH: audio driver urb allocation # # This fixes a bug in the audio driver which came from an # incorrect conversion from static to dynamic URB allocation. # It's against 2.5.5 # # I noticed this while trying to see exactly how ISO transfers # get used. The bug is that while originally the driver statically # allocated several structures {urb + N * iso packet descriptors}, # the update forgot to allocate the ISO descriptors. # # Likely not many folk noticed this on 32 bit machines, where # sizeof urb == 92, because kmalloc rounds that up to 128, # adding 36 bytes of external padding. The ISO descriptors # took up 32 bytes of that, which "just happened" to already # have been allocated but unused. # -------------------------------------------- # diff -Nru a/drivers/usb/audio.c b/drivers/usb/audio.c --- a/drivers/usb/audio.c Wed Feb 27 15:44:28 2002 +++ b/drivers/usb/audio.c Wed Feb 27 15:44:28 2002 @@ -124,9 +124,7 @@ * conversions. We never do sample rate conversion; these are too * expensive to be performed in the kernel. * - * Current status: - * - Pretty stable on UHCI-Acher/Fliegl/Sailer - * - Does not work on OHCI due to lack of OHCI driver supporting URB's + * Current status: no known HCD-specific issues. * * Generally: Due to the brokenness of the Audio Class spec * it seems generally impossible to write a generic Audio Class driver, @@ -298,12 +296,10 @@ struct my_data_urb { struct urb *urb; - struct usb_iso_packet_descriptor isoframe[DESCFRAMES]; }; struct my_sync_urb { struct urb *urb; - struct usb_iso_packet_descriptor isoframe[SYNCFRAMES]; }; @@ -2829,14 +2825,14 @@ init_waitqueue_head(&as->usbin.dma.wait); init_waitqueue_head(&as->usbout.dma.wait); spin_lock_init(&as->lock); - as->usbin.durb[0].urb = usb_alloc_urb(0, GFP_KERNEL); - as->usbin.durb[1].urb = usb_alloc_urb(0, GFP_KERNEL); - as->usbin.surb[0].urb = usb_alloc_urb(0, GFP_KERNEL); - as->usbin.surb[1].urb = usb_alloc_urb(0, GFP_KERNEL); - as->usbout.durb[0].urb = usb_alloc_urb(0, GFP_KERNEL); - as->usbout.durb[1].urb = usb_alloc_urb(0, GFP_KERNEL); - as->usbout.surb[0].urb = usb_alloc_urb(0, GFP_KERNEL); - as->usbout.surb[1].urb = usb_alloc_urb(0, GFP_KERNEL); + as->usbin.durb[0].urb = usb_alloc_urb (DESCFRAMES, GFP_KERNEL); + as->usbin.durb[1].urb = usb_alloc_urb (DESCFRAMES, GFP_KERNEL); + as->usbin.surb[0].urb = usb_alloc_urb (SYNCFRAMES, GFP_KERNEL); + as->usbin.surb[1].urb = usb_alloc_urb (SYNCFRAMES, GFP_KERNEL); + as->usbout.durb[0].urb = usb_alloc_urb (DESCFRAMES, GFP_KERNEL); + as->usbout.durb[1].urb = usb_alloc_urb (DESCFRAMES, GFP_KERNEL); + as->usbout.surb[0].urb = usb_alloc_urb (SYNCFRAMES, GFP_KERNEL); + as->usbout.surb[1].urb = usb_alloc_urb (SYNCFRAMES, GFP_KERNEL); if ((!as->usbin.durb[0].urb) || (!as->usbin.durb[1].urb) || (!as->usbin.surb[0].urb) ||