diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2010-08-06 04:02:40 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-09-05 12:45:27 -0400 |
commit | 8196a934eea3810be6243b307b336136d63bbc48 (patch) | |
tree | 76348d851b8ad6d663d02306b6c7495f3c002ab1 | |
parent | 143beaa811aa3cfc4ae8b4a2092f232ad78b33da (diff) |
[SCSI] fnic: do not reset dev_loss_tmo in slave callout
This fixes a bug where the driver was resetting the
rport dev_loss_tmo when devices were added by adding
support for the get_host_def_dev_loss_tmo callout.
Patch has only been compile tested.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/fnic/fnic_main.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index 9eb7a9ebcca..df91a61591b 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c | |||
@@ -80,8 +80,6 @@ static struct libfc_function_template fnic_transport_template = { | |||
80 | static int fnic_slave_alloc(struct scsi_device *sdev) | 80 | static int fnic_slave_alloc(struct scsi_device *sdev) |
81 | { | 81 | { |
82 | struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); | 82 | struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); |
83 | struct fc_lport *lp = shost_priv(sdev->host); | ||
84 | struct fnic *fnic = lport_priv(lp); | ||
85 | 83 | ||
86 | sdev->tagged_supported = 1; | 84 | sdev->tagged_supported = 1; |
87 | 85 | ||
@@ -89,8 +87,6 @@ static int fnic_slave_alloc(struct scsi_device *sdev) | |||
89 | return -ENXIO; | 87 | return -ENXIO; |
90 | 88 | ||
91 | scsi_activate_tcq(sdev, FNIC_DFLT_QUEUE_DEPTH); | 89 | scsi_activate_tcq(sdev, FNIC_DFLT_QUEUE_DEPTH); |
92 | rport->dev_loss_tmo = fnic->config.port_down_timeout / 1000; | ||
93 | |||
94 | return 0; | 90 | return 0; |
95 | } | 91 | } |
96 | 92 | ||
@@ -113,6 +109,15 @@ static struct scsi_host_template fnic_host_template = { | |||
113 | .shost_attrs = fnic_attrs, | 109 | .shost_attrs = fnic_attrs, |
114 | }; | 110 | }; |
115 | 111 | ||
112 | static void | ||
113 | fnic_get_host_def_loss_tmo(struct Scsi_Host *shost) | ||
114 | { | ||
115 | struct fc_lport *lp = shost_priv(shost); | ||
116 | struct fnic *fnic = lport_priv(lp); | ||
117 | |||
118 | fc_host_def_dev_loss_tmo(shost) = fnic->config.port_down_timeout / 1000; | ||
119 | } | ||
120 | |||
116 | static void fnic_get_host_speed(struct Scsi_Host *shost); | 121 | static void fnic_get_host_speed(struct Scsi_Host *shost); |
117 | static struct scsi_transport_template *fnic_fc_transport; | 122 | static struct scsi_transport_template *fnic_fc_transport; |
118 | static struct fc_host_statistics *fnic_get_stats(struct Scsi_Host *); | 123 | static struct fc_host_statistics *fnic_get_stats(struct Scsi_Host *); |
@@ -142,6 +147,7 @@ static struct fc_function_template fnic_fc_functions = { | |||
142 | .show_rport_dev_loss_tmo = 1, | 147 | .show_rport_dev_loss_tmo = 1, |
143 | .issue_fc_host_lip = fnic_reset, | 148 | .issue_fc_host_lip = fnic_reset, |
144 | .get_fc_host_stats = fnic_get_stats, | 149 | .get_fc_host_stats = fnic_get_stats, |
150 | .get_host_def_dev_loss_tmo = fnic_get_host_def_loss_tmo, | ||
145 | .dd_fcrport_size = sizeof(struct fc_rport_libfc_priv), | 151 | .dd_fcrport_size = sizeof(struct fc_rport_libfc_priv), |
146 | .terminate_rport_io = fnic_terminate_rport_io, | 152 | .terminate_rport_io = fnic_terminate_rport_io, |
147 | .bsg_request = fc_lport_bsg_request, | 153 | .bsg_request = fc_lport_bsg_request, |