aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2009-07-29 20:04:54 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-08-22 18:52:07 -0400
commit201e5795b7b9582accb6d83316e30f24d7d40fd3 (patch)
tree76a3d31b5879db683682eb111f90ce6d16e3956e /drivers/scsi/libfc
parent5f7ea3b7f81d5e5180647a071998b73a841bdba9 (diff)
[SCSI] libfc: fix: cancel rport retry timer
The timer for rport retries wasn't getting canceled, and would occasionally go off after the module was unloaded. Add logic to cancel the timer in fc_rport_work(). Since we cancel the timer before deleting the rdata, it is no longer necessary to do a get_device() for the pending timer. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r--drivers/scsi/libfc/fc_rport.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index a86df0b41ae..90cc90dd3b5 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -276,6 +276,7 @@ static void fc_rport_work(struct work_struct *work)
276 mutex_unlock(&rdata->rp_mutex); 276 mutex_unlock(&rdata->rp_mutex);
277 if (rport_ops->event_callback) 277 if (rport_ops->event_callback)
278 rport_ops->event_callback(lport, rport, event); 278 rport_ops->event_callback(lport, rport, event);
279 cancel_delayed_work_sync(&rdata->retry_work);
279 if (trans_state == FC_PORTSTATE_ROGUE) 280 if (trans_state == FC_PORTSTATE_ROGUE)
280 put_device(&rport->dev); 281 put_device(&rport->dev);
281 else { 282 else {
@@ -433,7 +434,6 @@ static void fc_rport_timeout(struct work_struct *work)
433 } 434 }
434 435
435 mutex_unlock(&rdata->rp_mutex); 436 mutex_unlock(&rdata->rp_mutex);
436 put_device(&rport->dev);
437} 437}
438 438
439/** 439/**
@@ -494,7 +494,6 @@ static void fc_rport_error_retry(struct fc_rport *rport, struct fc_frame *fp)
494 /* no additional delay on exchange timeouts */ 494 /* no additional delay on exchange timeouts */
495 if (PTR_ERR(fp) == -FC_EX_TIMEOUT) 495 if (PTR_ERR(fp) == -FC_EX_TIMEOUT)
496 delay = 0; 496 delay = 0;
497 get_device(&rport->dev);
498 schedule_delayed_work(&rdata->retry_work, delay); 497 schedule_delayed_work(&rdata->retry_work, delay);
499 return; 498 return;
500 } 499 }