On Fri, 2 Apr 2010, Sujith wrote: > > > 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. > > Well, printing use_count in the RX callback shows the increasing value of use_count. > > As a hack, I tried moving the line, atomic_dec(&urb->use_count) before calling > urb->complete() in usb_hcd_giveback_urb() and it fixes the issue - the use_count > stays steady. Though, I have no real explanation as to why this fixes the issue. > Perhaps you might have some idea. Nope. A decrement is a decrement no matter where it occurs. I guess the next thing to try is putting the atomic_dec() back where it's supposed to be, but printing out the usage_count values both before and after calling urb->complete(), as well as after the atomic_dec. You should also print out the values at various places in ath9k_hif_usb_rx_cb() -- particularly the beginning and the end. It should go up by 1 during the resubmission but otherwise it shouldn't change. 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