aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc
diff options
context:
space:
mode:
authorAbhijeet Joglekar <abjoglek@cisco.com>2009-02-27 13:54:41 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-03-06 16:36:28 -0500
commit571f824c3cd7b7f5a40ba100f7e576b6b0fe826a (patch)
tree2b3bd0708e541f6a37bcd67c5d71e60272641cd0 /drivers/scsi/libfc
parent1f6ff364ceda516f88351a8ab640e656beed0b26 (diff)
[SCSI] libfc: when rport goes away (re-plogi), clean up exchanges to/from rport
When a rport goes away, libFC does a plogi which will reset exchanges at the rport. Clean exchanges at our end, both in transport and libFC. If transport hooks into exch_mgr_reset, it will call back into fc_exch_mgr_reset() to clean up libFC exchanges. Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r--drivers/scsi/libfc/fc_rport.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index dec7bae0e56d..717575934152 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -214,6 +214,7 @@ static void fc_rport_state_enter(struct fc_rport *rport,
214 214
215static void fc_rport_work(struct work_struct *work) 215static void fc_rport_work(struct work_struct *work)
216{ 216{
217 u32 port_id;
217 struct fc_rport_libfc_priv *rdata = 218 struct fc_rport_libfc_priv *rdata =
218 container_of(work, struct fc_rport_libfc_priv, event_work); 219 container_of(work, struct fc_rport_libfc_priv, event_work);
219 enum fc_rport_event event; 220 enum fc_rport_event event;
@@ -279,8 +280,12 @@ static void fc_rport_work(struct work_struct *work)
279 rport_ops->event_callback(lport, rport, event); 280 rport_ops->event_callback(lport, rport, event);
280 if (trans_state == FC_PORTSTATE_ROGUE) 281 if (trans_state == FC_PORTSTATE_ROGUE)
281 put_device(&rport->dev); 282 put_device(&rport->dev);
282 else 283 else {
284 port_id = rport->port_id;
283 fc_remote_port_delete(rport); 285 fc_remote_port_delete(rport);
286 lport->tt.exch_mgr_reset(lport, 0, port_id);
287 lport->tt.exch_mgr_reset(lport, port_id, 0);
288 }
284 } else 289 } else
285 mutex_unlock(&rdata->rp_mutex); 290 mutex_unlock(&rdata->rp_mutex);
286} 291}