aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-02-03 17:10:47 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-02-16 09:40:35 -0500
commit0fa6dfdb0a2768541e998a5dab10b368de56c60a (patch)
tree3fac0c712c15107247c029f1802673e6553e57b7 /drivers
parent48f18c761c001a66ef1928b42799c717368b1d64 (diff)
firewire: fw-sbp2: don't add scsi_device twice
When a reconnect failed but re-login succeeded, __scsi_add_device was called again. In those cases, __scsi_add_device succeeded and returned the pointer to the existing scsi_device. fw-sbp2 then continued orderly, except that it missed to call sbp2_cancel_orbs. SCSI core would call fw-sbp2's eh_abort_handler eventually if there had been an outstanding command. This patch avoids the needless lookups and temporary allocations in SCSI core and I/O stall and timeout until eh_abort_handler hits. Also, __scsi_add_device tolerating calls for devices which already exist is undocumented behavior on which we shouldn't rely. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jarod Wilson <jwilson@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/fw-sbp2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 077f1c09dad4..914170bb50a8 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -741,6 +741,12 @@ static void sbp2_login(struct work_struct *work)
741 PREPARE_DELAYED_WORK(&lu->work, sbp2_reconnect); 741 PREPARE_DELAYED_WORK(&lu->work, sbp2_reconnect);
742 sbp2_agent_reset(lu); 742 sbp2_agent_reset(lu);
743 743
744 /* This was a re-login. */
745 if (lu->sdev) {
746 sbp2_cancel_orbs(lu);
747 goto out;
748 }
749
744 if (lu->tgt->workarounds & SBP2_WORKAROUND_DELAY_INQUIRY) 750 if (lu->tgt->workarounds & SBP2_WORKAROUND_DELAY_INQUIRY)
745 ssleep(SBP2_INQUIRY_DELAY); 751 ssleep(SBP2_INQUIRY_DELAY);
746 752