On Thu, May 16, 2002, David Brownell <[EMAIL PROTECTED]> wrote: > > Good point. One other thing we can also do to ensure that the address > > doesn't get reused is to move the call to: > > > > clear_bit(dev->devnum, &dev->bus->devmap.devicemap); > > > > into the code that is executed when the reference count hits 0 > > Why -- what's wrong with reusing that device's address as soon > as it's fully disconnected?
Because the deallocate() callback doesn't have guarantees that the HC has to be completely done with any references to the device address. This is another case of dumb luck that it hasn't been a problem since there were no guarantees along those lines. In fact the existing 2.4 is racy that way. We free up the bit for the device address before we call deallocate() which in usb-ohci atleast unlinks HC state with the device address (the ED). > If you did that, the dev->bus linkage wouldn't be broken ... so > those clean failures wouldn't be possible, and the HCDs could > be in the business of creating new state for disconnected HW! That's just because we overload the meaning of dev->bus to mean the device is valid or not. That could be changed. I was asking more on a logical level, but you are correct that just moving the line won't work with your change to NULL out dev->bus. JE _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel