On Thu, 1 Apr 2010, Sujith wrote: > Hi, > > I am encountering an issue with ath9k_htc. > > (http://git.kernel.org/?p=linux/kernel/git/linville/wireless-testing.git;a=tree;f=drivers/net/wireless/ath/ath9k;h=3b424cc4b338bac3bf8b09eee08fd24ed25b7abb;hb=HEAD). > > The USB code is present in hif_usb.c > > We use eight bulk URBs for RX, resubmitted in the completion callback. Where do these URBs ever get deallocated? ath9k_hif_usb_dealloc_rx_urbs() takes them off the anchor and kills them, but doesn't actually deallocate them. And doesn't hif_usb_regout_cb() leak URBs in the -ENODEV, -ESHUTDOWN, and !cmd cases? In fact, why does this routine test for !cmd at all, given that hif_usb_send_regout() already has such a test? > But the use_count of the URBs keeps increasing when running traffic, > and eventually, when unloading the module, kill_urb() blocks, waiting > for 'use_count' to reach zero. > > My understanding was that a re-submission of a URB would increment > use_count - which would be decremented immediately on returning from > the completion handler. Is this correct ? Yes. > Any pointers on how to handle this problem of increasing 'use_count' > would be greatly appreciated. You could try printing out the values of urb->use_count in ath9k_hif_usb_rx_cb(). That might provide a clue. If nothing else works, use the hw_breakpoint facility to track changes to the use_count field. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html