linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] scsi: qla2xxx: Use secs_to_jiffies() instead of msecs_to_jiffies()
@ 2025-08-28 16:11 Thorsten Blum
  2025-08-28 16:44 ` Himanshu Madhani
  2025-08-31  1:48 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2025-08-28 16:11 UTC (permalink / raw)
  To: Nilesh Javali, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen
  Cc: Thorsten Blum, linux-scsi, linux-kernel

Use secs_to_jiffies() instead of msecs_to_jiffies() and avoid scaling
'ratov_j' to milliseconds.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/scsi/qla2xxx/qla_bsg.c | 4 ++--
 drivers/scsi/qla2xxx/qla_os.c  | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index 10431a67d202..ccfc2d26dd37 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -3106,8 +3106,8 @@ static bool qla_bsg_found(struct qla_qpair *qpair, struct bsg_job *bsg_job)
 	switch (rval) {
 	case QLA_SUCCESS:
 		/* Wait for the command completion. */
-		ratov_j = ha->r_a_tov / 10 * 4 * 1000;
-		ratov_j = msecs_to_jiffies(ratov_j);
+		ratov_j = ha->r_a_tov / 10 * 4;
+		ratov_j = secs_to_jiffies(ratov_j);
 
 		if (!wait_for_completion_timeout(&comp, ratov_j)) {
 			ql_log(ql_log_info, vha, 0x7089,
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index d4b484c0fd9d..9a2f328200ab 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1291,8 +1291,8 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 	       "Abort command mbx cmd=%p, rval=%x.\n", cmd, rval);
 
 	/* Wait for the command completion. */
-	ratov_j = ha->r_a_tov/10 * 4 * 1000;
-	ratov_j = msecs_to_jiffies(ratov_j);
+	ratov_j = ha->r_a_tov / 10 * 4;
+	ratov_j = secs_to_jiffies(ratov_j);
 	switch (rval) {
 	case QLA_SUCCESS:
 		if (!wait_for_completion_timeout(&comp, ratov_j)) {
@@ -1806,8 +1806,8 @@ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res,
 		rval = ha->isp_ops->abort_command(sp);
 		/* Wait for command completion. */
 		ret_cmd = false;
-		ratov_j = ha->r_a_tov/10 * 4 * 1000;
-		ratov_j = msecs_to_jiffies(ratov_j);
+		ratov_j = ha->r_a_tov / 10 * 4;
+		ratov_j = secs_to_jiffies(ratov_j);
 		switch (rval) {
 		case QLA_SUCCESS:
 			if (wait_for_completion_timeout(&comp, ratov_j)) {
-- 
2.50.1


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

* Re: [PATCH RESEND] scsi: qla2xxx: Use secs_to_jiffies() instead of msecs_to_jiffies()
  2025-08-28 16:11 [PATCH RESEND] scsi: qla2xxx: Use secs_to_jiffies() instead of msecs_to_jiffies() Thorsten Blum
@ 2025-08-28 16:44 ` Himanshu Madhani
  2025-08-31  1:48 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Himanshu Madhani @ 2025-08-28 16:44 UTC (permalink / raw)
  To: Thorsten Blum, Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel

On 8/28/25 9:11 AM, Thorsten Blum wrote:
> Use secs_to_jiffies() instead of msecs_to_jiffies() and avoid scaling
> 'ratov_j' to milliseconds.
> 
> No functional changes intended.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>   drivers/scsi/qla2xxx/qla_bsg.c | 4 ++--
>   drivers/scsi/qla2xxx/qla_os.c  | 8 ++++----
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
> index 10431a67d202..ccfc2d26dd37 100644
> --- a/drivers/scsi/qla2xxx/qla_bsg.c
> +++ b/drivers/scsi/qla2xxx/qla_bsg.c
> @@ -3106,8 +3106,8 @@ static bool qla_bsg_found(struct qla_qpair *qpair, struct bsg_job *bsg_job)
>   	switch (rval) {
>   	case QLA_SUCCESS:
>   		/* Wait for the command completion. */
> -		ratov_j = ha->r_a_tov / 10 * 4 * 1000;
> -		ratov_j = msecs_to_jiffies(ratov_j);
> +		ratov_j = ha->r_a_tov / 10 * 4;
> +		ratov_j = secs_to_jiffies(ratov_j);
>   
>   		if (!wait_for_completion_timeout(&comp, ratov_j)) {
>   			ql_log(ql_log_info, vha, 0x7089,
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index d4b484c0fd9d..9a2f328200ab 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -1291,8 +1291,8 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
>   	       "Abort command mbx cmd=%p, rval=%x.\n", cmd, rval);
>   
>   	/* Wait for the command completion. */
> -	ratov_j = ha->r_a_tov/10 * 4 * 1000;
> -	ratov_j = msecs_to_jiffies(ratov_j);
> +	ratov_j = ha->r_a_tov / 10 * 4;
> +	ratov_j = secs_to_jiffies(ratov_j);
>   	switch (rval) {
>   	case QLA_SUCCESS:
>   		if (!wait_for_completion_timeout(&comp, ratov_j)) {
> @@ -1806,8 +1806,8 @@ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res,
>   		rval = ha->isp_ops->abort_command(sp);
>   		/* Wait for command completion. */
>   		ret_cmd = false;
> -		ratov_j = ha->r_a_tov/10 * 4 * 1000;
> -		ratov_j = msecs_to_jiffies(ratov_j);
> +		ratov_j = ha->r_a_tov / 10 * 4;
> +		ratov_j = secs_to_jiffies(ratov_j);
>   		switch (rval) {
>   		case QLA_SUCCESS:
>   			if (wait_for_completion_timeout(&comp, ratov_j)) {

Looks okay.

Reviewed-by: Himanshu Madhani <hmadhani2024@gmail.com>

---
Himanshu Madhani

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

* Re: [PATCH RESEND] scsi: qla2xxx: Use secs_to_jiffies() instead of msecs_to_jiffies()
  2025-08-28 16:11 [PATCH RESEND] scsi: qla2xxx: Use secs_to_jiffies() instead of msecs_to_jiffies() Thorsten Blum
  2025-08-28 16:44 ` Himanshu Madhani
@ 2025-08-31  1:48 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-08-31  1:48 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Nilesh Javali, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel


Thorsten,

> Use secs_to_jiffies() instead of msecs_to_jiffies() and avoid scaling
> 'ratov_j' to milliseconds.

Applied to 6.18/scsi-staging, thanks!

-- 
Martin K. Petersen

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

end of thread, other threads:[~2025-08-31  1:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 16:11 [PATCH RESEND] scsi: qla2xxx: Use secs_to_jiffies() instead of msecs_to_jiffies() Thorsten Blum
2025-08-28 16:44 ` Himanshu Madhani
2025-08-31  1:48 ` Martin K. Petersen

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).