From: Joe Eykholt Date: Thu, 30 Jul 2009 00:04:54 +0000 (-0700) Subject: [SCSI] libfc: fix: cancel rport retry timer X-Git-Tag: v2.6.32-rc1~689^2~174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=201e5795b7b9582accb6d83316e30f24d7d40fd3;p=profile%2Fivi%2Fkernel-x86-ivi.git [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 Signed-off-by: Robert Love Signed-off-by: James Bottomley Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index a86df0b..90cc90d 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) mutex_unlock(&rdata->rp_mutex); if (rport_ops->event_callback) rport_ops->event_callback(lport, rport, event); + cancel_delayed_work_sync(&rdata->retry_work); if (trans_state == FC_PORTSTATE_ROGUE) put_device(&rport->dev); else { @@ -433,7 +434,6 @@ static void fc_rport_timeout(struct work_struct *work) } mutex_unlock(&rdata->rp_mutex); - put_device(&rport->dev); } /** @@ -494,7 +494,6 @@ static void fc_rport_error_retry(struct fc_rport *rport, struct fc_frame *fp) /* no additional delay on exchange timeouts */ if (PTR_ERR(fp) == -FC_EX_TIMEOUT) delay = 0; - get_device(&rport->dev); schedule_delayed_work(&rdata->retry_work, delay); return; }