From ed5513284c9e02b388f1ce37926bfa6b91ce8b6a Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 22 Oct 2009 12:39:36 +0000 Subject: [PATCH] From ac2ef12020817c8e8edb7b4fe57f053c62cc833e Mon Sep 17 00:00:00 2001 From: Andrew Vasquez Date: Thu, 14 Aug 2008 09:39:35 -0700 Subject: qla2xxx: Set an rport's dev_loss_tmo value in a consistent manner. [ Upstream commit 85821c906cf3563a00a3d98fa380a2581a7a5ff1 ] As there's no point in adding a fixed-fudge value (originally 5 seconds), honor the user settings only. We also remove the driver's dead-callback get_rport_dev_loss_tmo function (qla2x00_get_rport_loss_tmo()). Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman Submitted by Gal Rosen git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1239 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_attr.c | 20 ++------------------ qla2x00t/qla_os.c | 2 +- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/qla2x00t/qla_attr.c b/qla2x00t/qla_attr.c index d649c1561..345b0b04f 100644 --- a/qla2x00t/qla_attr.c +++ b/qla2x00t/qla_attr.c @@ -1467,27 +1467,13 @@ qla2x00_get_starget_port_id(struct scsi_target *starget) fc_starget_port_id(starget) = port_id; } -static void -qla2x00_get_rport_loss_tmo(struct fc_rport *rport) -{ - struct Scsi_Host *host = rport_to_shost(rport); - scsi_qla_host_t *ha = shost_priv(host); - - rport->dev_loss_tmo = ha->port_down_retry_count + 5; -} - static void qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) { - struct Scsi_Host *host = rport_to_shost(rport); - scsi_qla_host_t *ha = shost_priv(host); - if (timeout) - ha->port_down_retry_count = timeout; + rport->dev_loss_tmo = timeout; else - ha->port_down_retry_count = 1; - - rport->dev_loss_tmo = ha->port_down_retry_count + 5; + rport->dev_loss_tmo = 1; } static void @@ -1771,7 +1757,6 @@ struct fc_function_template qla2xxx_transport_functions = { .get_starget_port_id = qla2x00_get_starget_port_id, .show_starget_port_id = 1, - .get_rport_dev_loss_tmo = qla2x00_get_rport_loss_tmo, .set_rport_dev_loss_tmo = qla2x00_set_rport_loss_tmo, .show_rport_dev_loss_tmo = 1, @@ -1816,7 +1801,6 @@ struct fc_function_template qla2xxx_transport_vport_functions = { .get_starget_port_id = qla2x00_get_starget_port_id, .show_starget_port_id = 1, - .get_rport_dev_loss_tmo = qla2x00_get_rport_loss_tmo, .set_rport_dev_loss_tmo = qla2x00_set_rport_loss_tmo, .show_rport_dev_loss_tmo = 1, diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index c9c41a231..5e94df526 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -1138,7 +1138,7 @@ qla2xxx_slave_configure(struct scsi_device *sdev) else scsi_deactivate_tcq(sdev, ha->max_q_depth); - rport->dev_loss_tmo = ha->port_down_retry_count + 5; + rport->dev_loss_tmo = ha->port_down_retry_count; return 0; }