OpenCloudOS-Kernel/drivers/firewire
Stefan Richter 7c45d1913f firewire: fw-sbp2: fix refcounting
Since patch "fw-sbp2: use an own workqueue (fix system responsiveness)"
increased parallelism between fw-sbp2 and fw-core, it was possible that
fw-sbp2 didn't release the SCSI device when the FireWire device was
disconnected.

This happened if sbp2_update() ran during sbp2_login(), because a bus
reset occurred during sbp2_login().  The sbp2_login() work would [try
to] reschedule itself because it failed due to the bus reset, and it
would _not_ drop its reference on the target.  However, sbp2_update()
would schedule sbp2_login() too before sbp2_login() rescheduled itself
and hence sbp2_update() would take an additional reference.  And then
we would have one reference too many.

The fix is to _always_ drop the reference when leaving the sbp2_login()
work.  If the sbp2_login() work reschedules itself, it takes a
reference, but only if it wasn't already rescheduled by sbp2_update().

Ditto in the sbp2_reconnect() work.

The resulting code is actually simpler than before:  We _always_ take
a reference when successfully scheduling work.  And we _always_ drop
a reference when leaving a workqueue job.  No exceptions.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-11-07 01:59:28 +01:00
..
Kconfig firewire: point to migration document 2007-10-07 13:48:41 +02:00
Makefile firewire: prefix modules with firewire- instead of fw- 2007-05-27 23:21:01 +02:00
fw-card.c firewire: fix unloading of fw-ohci while devices are attached 2007-08-25 18:00:27 +02:00
fw-cdev.c firewire: fw-cdev: reorder wakeup vs. spinlock 2007-10-17 00:00:10 +02:00
fw-device.c Driver core: change add_uevent_var to use a struct 2007-10-12 14:51:01 -07:00
fw-device.h firewire: fw-sbp2: add support for multiple logical units per target 2007-10-17 00:00:03 +02:00
fw-iso.c firewire: Clean up comment style. 2007-05-10 18:24:13 +02:00
fw-ohci.c firewire: Fix pci resume to not pass in a __be32 config rom. 2007-10-31 19:02:19 +01:00
fw-ohci.h firewire: fw-ohci: check for misconfigured bus (phyID == 63) 2007-10-17 00:00:08 +02:00
fw-sbp2.c firewire: fw-sbp2: fix refcounting 2007-11-07 01:59:28 +01:00
fw-topology.c firewire: in-code doc updates. 2007-10-17 00:00:09 +02:00
fw-topology.h firewire: a header cleanup 2007-10-17 00:00:09 +02:00
fw-transaction.c fix typo "insted" -> "instead" 2007-10-20 01:55:04 +02:00
fw-transaction.h firewire: fw-sbp2: set correct maximum payload (fixes CardBus adapters) 2007-08-02 20:34:16 +02:00