firewire: core: fix iso context shutdown on card removal
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 16 Jun 2009 17:15:25 +0000 (19:15 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 16 Jun 2009 20:48:09 +0000 (22:48 +0200)
commitd645f4dad056a98089df904294f66b96d04e91b6
tree993ec9d0c64dac6fb4e1214f213220fbc0e29f63
parent29ad14cddd6246d17ff22f496363dfd6b3de8964
firewire: core: fix iso context shutdown on card removal

If isochronous contexts existed when firewire-ohci was unloaded, the
core iso shutdown functions crashed with NULL dereferences, and buffers
etc. weren't released.

How the fix works:  We first copy the card driver's iso shutdown hooks
into the dummy driver, then fw_destroy_nodes notifies upper layers of
devices going away, these should shut down (including their iso
contexts), wait_for_completion(&card->done) will be triggered after
upper layers gave up all fw_device references, after which the card
driver's shutdown proceeds.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/core-card.c