linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qla4xxx: pass timeout as HZ independent value
@ 2015-05-27 20:10 Nicholas Mc Guire
  2015-06-08  6:22 ` Nilesh Javali
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2015-05-27 20:10 UTC (permalink / raw)
  To: QLogic-Storage-Upstream
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel, Nicholas Mc Guire

schedule_timeout_* takes a timeout in jiffies but the code currently is
passing in a constant which makes this timeout HZ dependent, so pass it
through msecs_to_jiffies() to fix this up.

patch was compile tested with x86_64_defconfig + SCSI_LOWLEVEL=y,
CONFIG_SCSI_QLA_ISCSI=m

Patch is against 4.1-rc5 (localversion-next is -next-20150527)

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

As there is no documentation of the intended timeout it might be wrong
to convert it with msecs_to_jiffies as this can reduces the actual
jiffies value by at least a factor of 10 - so someone that knows this
driver needs to check on the actual value - but in any case it needs
to be passed in a HZ independent way.

 drivers/scsi/qla4xxx/ql4_nx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 7c33658..7b53eab 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -1569,7 +1569,7 @@ static int qla4_82xx_cmdpeg_ready(struct scsi_qla_host *ha, int pegtune_val)
 			    (val == PHAN_INITIALIZE_ACK))
 				return 0;
 			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(500);
+			schedule_timeout(msecs_to_jiffies(500));
 
 		} while (--retries);
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] qla4xxx: pass timeout as HZ independent value
  2015-05-27 20:10 [PATCH] qla4xxx: pass timeout as HZ independent value Nicholas Mc Guire
@ 2015-06-08  6:22 ` Nilesh Javali
  0 siblings, 0 replies; 2+ messages in thread
From: Nilesh Javali @ 2015-06-08  6:22 UTC (permalink / raw)
  To: Nicholas Mc Guire, Dept-Eng QLogic Storage Upstream
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel


> -----Original Message-----
> From: Nicholas Mc Guire [mailto:hofrat@osadl.org]
> Sent: Thursday, May 28, 2015 1:40 AM
> To: Dept-Eng QLogic Storage Upstream
> Cc: James E.J. Bottomley; linux-scsi; linux-kernel; Nicholas Mc Guire
> Subject: [PATCH] qla4xxx: pass timeout as HZ independent value
> 
> schedule_timeout_* takes a timeout in jiffies but the code currently is
> passing in a constant which makes this timeout HZ dependent, so pass it
> through msecs_to_jiffies() to fix this up.
> 
> patch was compile tested with x86_64_defconfig + SCSI_LOWLEVEL=y,
> CONFIG_SCSI_QLA_ISCSI=m
> 
> Patch is against 4.1-rc5 (localversion-next is -next-20150527)
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
> 
> As there is no documentation of the intended timeout it might be wrong to
> convert it with msecs_to_jiffies as this can reduces the actual jiffies value by
> at least a factor of 10 - so someone that knows this driver needs to check on
> the actual value - but in any case it needs to be passed in a HZ independent
> way.
> 
>  drivers/scsi/qla4xxx/ql4_nx.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
> index 7c33658..7b53eab 100644
> --- a/drivers/scsi/qla4xxx/ql4_nx.c
> +++ b/drivers/scsi/qla4xxx/ql4_nx.c
> @@ -1569,7 +1569,7 @@ static int qla4_82xx_cmdpeg_ready(struct
> scsi_qla_host *ha, int pegtune_val)
>  			    (val == PHAN_INITIALIZE_ACK))
>  				return 0;
>  			set_current_state(TASK_UNINTERRUPTIBLE);
> -			schedule_timeout(500);
> +			schedule_timeout(msecs_to_jiffies(500));
> 
>  		} while (--retries);
> 
> --
> 1.7.10.4

Acked-by: Nilesh Javali <nilesh.javali@qlogic.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-08  6:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-27 20:10 [PATCH] qla4xxx: pass timeout as HZ independent value Nicholas Mc Guire
2015-06-08  6:22 ` Nilesh Javali

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).