Skip to content

Commit 4dde506

Browse files
Vijaya Mohan GuvvaJames Bottomley
authored andcommitted
[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>
1 parent f9c867b commit 4dde506

1 file changed

Lines changed: 7 additions & 26 deletions

File tree

‎drivers/scsi/bfa/bfad_attr.c‎

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -334,40 +334,23 @@ bfad_im_reset_stats(struct Scsi_Host *shost)
334334
return;
335335
}
336336

337-
/*
338-
* FC transport template entry, get rport loss timeout.
339-
*/
340-
static void
341-
bfad_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-
353337
/*
354338
* 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
355342
*/
356343
static void
357344
bfad_im_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout)
358345
{
359346
struct bfad_itnim_data_s *itnim_data = rport->dd_data;
360347
struct bfad_itnim_s *itnim = itnim_data->itnim;
361348
struct bfad_s *bfad = itnim->im->bfad;
362-
unsigned long flags;
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-
}
349+
uint16_t path_tov = bfa_fcpim_path_tov_get(&bfad->bfa);
370350

351+
rport->dev_loss_tmo = timeout;
352+
if (timeout < path_tov)
353+
rport->dev_loss_tmo = path_tov + 1;
371354
}
372355

373356
static int
@@ -665,7 +648,6 @@ struct fc_function_template bfad_im_fc_function_template = {
665648
.show_rport_maxframe_size = 1,
666649
.show_rport_supported_classes = 1,
667650
.show_rport_dev_loss_tmo = 1,
668-
.get_rport_dev_loss_tmo = bfad_im_get_rport_loss_tmo,
669651
.set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo,
670652
.issue_fc_host_lip = bfad_im_issue_fc_host_lip,
671653
.vport_create = bfad_im_vport_create,
@@ -723,7 +705,6 @@ struct fc_function_template bfad_im_vport_fc_function_template = {
723705
.show_rport_maxframe_size = 1,
724706
.show_rport_supported_classes = 1,
725707
.show_rport_dev_loss_tmo = 1,
726-
.get_rport_dev_loss_tmo = bfad_im_get_rport_loss_tmo,
727708
.set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo,
728709
};
729710

0 commit comments

Comments
 (0)