All of lore.kernel.org
 help / color / mirror / Atom feed
From: cdupuis1@gmail.com
To: Laurence Oberman <loberman@redhat.com>,
	QLogic-Storage-Upstream@qlogic.com, linux-scsi@vger.kernel.org,
	djeffery@redhat.com, jpittman@redhat.com
Subject: Re: [PATCH] bnx2fc: timeout calculation invalid for bnx2fc_eh_abort()
Date: Tue, 19 Nov 2019 22:14:32 -0500	[thread overview]
Message-ID: <4542ba273577056dbe530714f43af29ce5258814.camel@gmail.com> (raw)
In-Reply-To: <1574178394-16635-1-git-send-email-loberman@redhat.com>

Looks like the original calculation assumed that rp->r_a_tov was
specified in seconds hence the HZ multiplier.  Converting using
msecs_to_jiffies() would seem to be the correct way to do it.

Reviewed-by: Chad Dupuis <cdupuis1@gmail.com>

On Tue, 2019-11-19 at 10:46 -0500, Laurence Oberman wrote:
> In the bnx2fc_eh_abort() function there is a calculation for
> wait_for_completion that uses a HZ multiplier.
> This is incorrect, it scales the timeout by 1000 seconds
> instead of converting the ms value to jiffies.
> Therefore change the calculation.
> 
> Reported-by: David Jeffery <djeffery@redhat.com>
> Reviewed-by: John Pittman .jpittman@redhat.com>
> Signed-off-by: Laurence Oberman <loberman@redhat.com>
> ---
>  drivers/scsi/bnx2fc/bnx2fc_io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c
> b/drivers/scsi/bnx2fc/bnx2fc_io.c
> index 401743e..d8ae6d0 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_io.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
> @@ -1242,7 +1242,7 @@ int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd)
>  
>  	/* Wait 2 * RA_TOV + 1 to be sure timeout function hasn't fired
> */
>  	time_left = wait_for_completion_timeout(&io_req->abts_done,
> -						(2 * rp->r_a_tov + 1) *
> HZ);
> +					msecs_to_jiffies(2 * rp-
> >r_a_tov + 1));
>  	if (time_left)
>  		BNX2FC_IO_DBG(io_req,
>  			      "Timed out in eh_abort waiting for
> abts_done");


  reply	other threads:[~2019-11-20  3:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 15:46 [PATCH] bnx2fc: timeout calculation invalid for bnx2fc_eh_abort() Laurence Oberman
2019-11-20  3:14 ` cdupuis1 [this message]
2019-11-20  3:32 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4542ba273577056dbe530714f43af29ce5258814.camel@gmail.com \
    --to=cdupuis1@gmail.com \
    --cc=QLogic-Storage-Upstream@qlogic.com \
    --cc=djeffery@redhat.com \
    --cc=jpittman@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loberman@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.