aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa
diff options
context:
space:
mode:
authorVijaya Mohan Guvva <vmohan@brocade.com>2013-05-13 05:33:34 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-06-26 20:27:08 -0400
commit4dde506944f8ea3431bf4a250c13621c8f3939bb (patch)
treedacc6a11038c4dcf3a4e241993affbcba38132aa /drivers/scsi/bfa
parentf9c867b45c7c1be4c4920471250a52a053c7a8c2 (diff)
[SCSI] bfa: dis-associate bfa path_tov with dev_loss_tmo
Disassoicate path_tov in the driver with the dev_loss_tmo set by the application. Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r--drivers/scsi/bfa/bfad_attr.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c
index 72f5dc32cc12..e9a681d31223 100644
--- a/drivers/scsi/bfa/bfad_attr.c
+++ b/drivers/scsi/bfa/bfad_attr.c
@@ -335,23 +335,10 @@ bfad_im_reset_stats(struct Scsi_Host *shost)
335} 335}
336 336
337/* 337/*
338 * FC transport template entry, get rport loss timeout.
339 */
340static void
341bfad_im_get_rport_loss_tmo(struct fc_rport *rport)
342{
343 struct bfad_itnim_data_s *itnim_data = rport->dd_data;
344 struct bfad_itnim_s *itnim = itnim_data->itnim;
345 struct bfad_s *bfad = itnim->im->bfad;
346 unsigned long flags;
347
348 spin_lock_irqsave(&bfad->bfad_lock, flags);
349 rport->dev_loss_tmo = bfa_fcpim_path_tov_get(&bfad->bfa);
350 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
351}
352
353/*
354 * FC transport template entry, set rport loss timeout. 338 * FC transport template entry, set rport loss timeout.
339 * Update dev_loss_tmo based on the value pushed down by the stack
340 * In case it is lesser than path_tov of driver, set it to path_tov + 1
341 * to ensure that the driver times out before the application
355 */ 342 */
356static void 343static void
357bfad_im_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout) 344bfad_im_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout)
@@ -359,15 +346,11 @@ bfad_im_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout)
359 struct bfad_itnim_data_s *itnim_data = rport->dd_data; 346 struct bfad_itnim_data_s *itnim_data = rport->dd_data;
360 struct bfad_itnim_s *itnim = itnim_data->itnim; 347 struct bfad_itnim_s *itnim = itnim_data->itnim;
361 struct bfad_s *bfad = itnim->im->bfad; 348 struct bfad_s *bfad = itnim->im->bfad;
362 unsigned long flags; 349 uint16_t path_tov = bfa_fcpim_path_tov_get(&bfad->bfa);
363
364 if (timeout > 0) {
365 spin_lock_irqsave(&bfad->bfad_lock, flags);
366 bfa_fcpim_path_tov_set(&bfad->bfa, timeout);
367 rport->dev_loss_tmo = bfa_fcpim_path_tov_get(&bfad->bfa);
368 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
369 }
370 350
351 rport->dev_loss_tmo = timeout;
352 if (timeout < path_tov)
353 rport->dev_loss_tmo = path_tov + 1;
371} 354}
372 355
373static int 356static int
@@ -665,7 +648,6 @@ struct fc_function_template bfad_im_fc_function_template = {
665 .show_rport_maxframe_size = 1, 648 .show_rport_maxframe_size = 1,
666 .show_rport_supported_classes = 1, 649 .show_rport_supported_classes = 1,
667 .show_rport_dev_loss_tmo = 1, 650 .show_rport_dev_loss_tmo = 1,
668 .get_rport_dev_loss_tmo = bfad_im_get_rport_loss_tmo,
669 .set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo, 651 .set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo,
670 .issue_fc_host_lip = bfad_im_issue_fc_host_lip, 652 .issue_fc_host_lip = bfad_im_issue_fc_host_lip,
671 .vport_create = bfad_im_vport_create, 653 .vport_create = bfad_im_vport_create,
@@ -723,7 +705,6 @@ struct fc_function_template bfad_im_vport_fc_function_template = {
723 .show_rport_maxframe_size = 1, 705 .show_rport_maxframe_size = 1,
724 .show_rport_supported_classes = 1, 706 .show_rport_supported_classes = 1,
725 .show_rport_dev_loss_tmo = 1, 707 .show_rport_dev_loss_tmo = 1,
726 .get_rport_dev_loss_tmo = bfad_im_get_rport_loss_tmo,
727 .set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo, 708 .set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo,
728}; 709};
729 710