Skip to contentSkip to conversation

scsi: qla2xxx: Use secs_to_jiffies() instead of msecs_to_jiffies()

PATCH RESEND Applied Thorsten Blum 3 participants 4 messages Aug 28, 2025 – Sep 10, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 scsi: qla2xxx: Use secs_to_jiffies() instead of msecs_to_jiffies()

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

No functional changes intended.

---
 drivers/scsi/qla2xxx/qla_bsg.c | 4 ++--
 drivers/scsi/qla2xxx/qla_os.c  | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/qla2xxx/qla_bsg.c +2 -2
index 10431a67d202..ccfc2d26dd37 100644
@@ -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,
drivers/scsi/qla2xxx/qla_os.c +4 -4
index d4b484c0fd9d..9a2f328200ab 100644
@@ -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)) {
Signature · 1 line
2.50.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 42 lines · Thorsten Blum

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

No functional changes intended.

---
  drivers/scsi/qla2xxx/qla_bsg.c | 4 ++--
  drivers/scsi/qla2xxx/qla_os.c  | 8 ++++----
  2 files changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/qla2xxx/qla_bsg.c +2 -2
index 10431a67d202..ccfc2d26dd37 100644
@@ -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,
drivers/scsi/qla2xxx/qla_os.c +2 -2
index d4b484c0fd9d..9a2f328200ab 100644
@@ -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)) {

drivers/scsi/qla2xxx/qla_os.c static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res, · line 1813

Quoted 10 lines
drivers/scsi/qla2xxx/qla_os.c +2 -2
@@ -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.

---
Himanshu Madhani

#2 lore raw
In reply to Thorsten Blum

Thorsten,

Quoted 2 lines

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

Applied to 6.18/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen