Commit a74bdf46 authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[SCSI] qla2xxx: 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.
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent b8ef3204
...@@ -1529,6 +1529,15 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) ...@@ -1529,6 +1529,15 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
rport->dev_loss_tmo = 1; rport->dev_loss_tmo = 1;
} }
static void
qla2x00_get_host_def_loss_tmo(struct Scsi_Host *shost)
{
scsi_qla_host_t *vha = shost_priv(shost);
struct qla_hw_data *ha = vha->hw;
fc_host_def_dev_loss_tmo(shost) = ha->port_down_retry_count;
}
static void static void
qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport)
{ {
...@@ -1903,6 +1912,7 @@ struct fc_function_template qla2xxx_transport_functions = { ...@@ -1903,6 +1912,7 @@ struct fc_function_template qla2xxx_transport_functions = {
.show_host_fabric_name = 1, .show_host_fabric_name = 1,
.get_host_port_state = qla2x00_get_host_port_state, .get_host_port_state = qla2x00_get_host_port_state,
.show_host_port_state = 1, .show_host_port_state = 1,
.get_host_def_dev_loss_tmo = qla2x00_get_host_def_loss_tmo,
.dd_fcrport_size = sizeof(struct fc_port *), .dd_fcrport_size = sizeof(struct fc_port *),
.show_rport_supported_classes = 1, .show_rport_supported_classes = 1,
...@@ -1949,6 +1959,7 @@ struct fc_function_template qla2xxx_transport_vport_functions = { ...@@ -1949,6 +1959,7 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
.show_host_fabric_name = 1, .show_host_fabric_name = 1,
.get_host_port_state = qla2x00_get_host_port_state, .get_host_port_state = qla2x00_get_host_port_state,
.show_host_port_state = 1, .show_host_port_state = 1,
.get_host_def_dev_loss_tmo = qla2x00_get_host_def_loss_tmo,
.dd_fcrport_size = sizeof(struct fc_port *), .dd_fcrport_size = sizeof(struct fc_port *),
.show_rport_supported_classes = 1, .show_rport_supported_classes = 1,
......
...@@ -1295,17 +1295,12 @@ static int ...@@ -1295,17 +1295,12 @@ static int
qla2xxx_slave_configure(struct scsi_device *sdev) qla2xxx_slave_configure(struct scsi_device *sdev)
{ {
scsi_qla_host_t *vha = shost_priv(sdev->host); scsi_qla_host_t *vha = shost_priv(sdev->host);
struct qla_hw_data *ha = vha->hw;
struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
struct req_que *req = vha->req; struct req_que *req = vha->req;
if (sdev->tagged_supported) if (sdev->tagged_supported)
scsi_activate_tcq(sdev, req->max_q_depth); scsi_activate_tcq(sdev, req->max_q_depth);
else else
scsi_deactivate_tcq(sdev, req->max_q_depth); scsi_deactivate_tcq(sdev, req->max_q_depth);
rport->dev_loss_tmo = ha->port_down_retry_count;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment