diff options
author | James Smart <James.Smart@Emulex.Com> | 2009-01-05 12:14:18 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-01-06 10:43:33 -0500 |
commit | 4be98c0ca304c8a47998b29a7993664f71791250 (patch) | |
tree | f24eb119e2b3332c5d27473055e7d83493b6a225 | |
parent | 58607b30fc0f2230a189500112c7a7cca02804cf (diff) |
[SCSI] fc transport: restore missing dev_loss_tmo callback to LLDD
When we reworked the transport for the rport lifetimes, in cases where the
rport was reused as a container for tgt id bindings, we inadvertantly
removed the callback to the driver indicating that dev_loss_tmo had fired.
This patch restores that functionality.
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/scsi/scsi_transport_fc.c | 21 | ||||
-rw-r--r-- | include/scsi/scsi_transport_fc.h | 1 |
2 files changed, 20 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index dcef78776503..5f77417ed585 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -2407,8 +2407,12 @@ fc_rport_final_delete(struct work_struct *work) | |||
2407 | /* | 2407 | /* |
2408 | * Notify the driver that the rport is now dead. The LLDD will | 2408 | * Notify the driver that the rport is now dead. The LLDD will |
2409 | * also guarantee that any communication to the rport is terminated | 2409 | * also guarantee that any communication to the rport is terminated |
2410 | * | ||
2411 | * Avoid this call if we already called it when we preserved the | ||
2412 | * rport for the binding. | ||
2410 | */ | 2413 | */ |
2411 | if (i->f->dev_loss_tmo_callbk) | 2414 | if (!(rport->flags & FC_RPORT_DEVLOSS_CALLBK_DONE) && |
2415 | (i->f->dev_loss_tmo_callbk)) | ||
2412 | i->f->dev_loss_tmo_callbk(rport); | 2416 | i->f->dev_loss_tmo_callbk(rport); |
2413 | 2417 | ||
2414 | transport_remove_device(dev); | 2418 | transport_remove_device(dev); |
@@ -2647,7 +2651,8 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel, | |||
2647 | spin_lock_irqsave(shost->host_lock, flags); | 2651 | spin_lock_irqsave(shost->host_lock, flags); |
2648 | 2652 | ||
2649 | rport->flags &= ~(FC_RPORT_FAST_FAIL_TIMEDOUT | | 2653 | rport->flags &= ~(FC_RPORT_FAST_FAIL_TIMEDOUT | |
2650 | FC_RPORT_DEVLOSS_PENDING); | 2654 | FC_RPORT_DEVLOSS_PENDING | |
2655 | FC_RPORT_DEVLOSS_CALLBK_DONE); | ||
2651 | 2656 | ||
2652 | /* if target, initiate a scan */ | 2657 | /* if target, initiate a scan */ |
2653 | if (rport->scsi_target_id != -1) { | 2658 | if (rport->scsi_target_id != -1) { |
@@ -2944,6 +2949,7 @@ fc_timeout_deleted_rport(struct work_struct *work) | |||
2944 | struct fc_rport *rport = | 2949 | struct fc_rport *rport = |
2945 | container_of(work, struct fc_rport, dev_loss_work.work); | 2950 | container_of(work, struct fc_rport, dev_loss_work.work); |
2946 | struct Scsi_Host *shost = rport_to_shost(rport); | 2951 | struct Scsi_Host *shost = rport_to_shost(rport); |
2952 | struct fc_internal *i = to_fc_internal(shost->transportt); | ||
2947 | struct fc_host_attrs *fc_host = shost_to_fc_host(shost); | 2953 | struct fc_host_attrs *fc_host = shost_to_fc_host(shost); |
2948 | unsigned long flags; | 2954 | unsigned long flags; |
2949 | 2955 | ||
@@ -3011,6 +3017,7 @@ fc_timeout_deleted_rport(struct work_struct *work) | |||
3011 | rport->roles = FC_PORT_ROLE_UNKNOWN; | 3017 | rport->roles = FC_PORT_ROLE_UNKNOWN; |
3012 | rport->port_state = FC_PORTSTATE_NOTPRESENT; | 3018 | rport->port_state = FC_PORTSTATE_NOTPRESENT; |
3013 | rport->flags &= ~FC_RPORT_FAST_FAIL_TIMEDOUT; | 3019 | rport->flags &= ~FC_RPORT_FAST_FAIL_TIMEDOUT; |
3020 | rport->flags |= FC_RPORT_DEVLOSS_CALLBK_DONE; | ||
3014 | 3021 | ||
3015 | /* | 3022 | /* |
3016 | * Pre-emptively kill I/O rather than waiting for the work queue | 3023 | * Pre-emptively kill I/O rather than waiting for the work queue |
@@ -3046,8 +3053,18 @@ fc_timeout_deleted_rport(struct work_struct *work) | |||
3046 | * all attached scsi devices. | 3053 | * all attached scsi devices. |
3047 | */ | 3054 | */ |
3048 | fc_queue_work(shost, &rport->stgt_delete_work); | 3055 | fc_queue_work(shost, &rport->stgt_delete_work); |
3056 | |||
3057 | /* | ||
3058 | * Notify the driver that the rport is now dead. The LLDD will | ||
3059 | * also guarantee that any communication to the rport is terminated | ||
3060 | * | ||
3061 | * Note: we set the CALLBK_DONE flag above to correspond | ||
3062 | */ | ||
3063 | if (i->f->dev_loss_tmo_callbk) | ||
3064 | i->f->dev_loss_tmo_callbk(rport); | ||
3049 | } | 3065 | } |
3050 | 3066 | ||
3067 | |||
3051 | /** | 3068 | /** |
3052 | * fc_timeout_fail_rport_io - Timeout handler for a fast io failing on a disconnected SCSI target. | 3069 | * fc_timeout_fail_rport_io - Timeout handler for a fast io failing on a disconnected SCSI target. |
3053 | * @work: rport to terminate io on. | 3070 | * @work: rport to terminate io on. |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 6e04e6fe79c7..c9184f756cad 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -358,6 +358,7 @@ struct fc_rport { /* aka fc_starget_attrs */ | |||
358 | #define FC_RPORT_DEVLOSS_PENDING 0x01 | 358 | #define FC_RPORT_DEVLOSS_PENDING 0x01 |
359 | #define FC_RPORT_SCAN_PENDING 0x02 | 359 | #define FC_RPORT_SCAN_PENDING 0x02 |
360 | #define FC_RPORT_FAST_FAIL_TIMEDOUT 0x04 | 360 | #define FC_RPORT_FAST_FAIL_TIMEDOUT 0x04 |
361 | #define FC_RPORT_DEVLOSS_CALLBK_DONE 0x08 | ||
361 | 362 | ||
362 | #define dev_to_rport(d) \ | 363 | #define dev_to_rport(d) \ |
363 | container_of(d, struct fc_rport, dev) | 364 | container_of(d, struct fc_rport, dev) |