Skip to content

scsi: mpi3mr: Fix error return, start_time, and timeout check in mpi3mr_bring_ioc_ready()

Ian Rogers linux-scsi lkml llvm stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyIn review
  2. v11 patch 2 repliesSuperseded

Changes in v2 from the cover letter

- Split v1 into three patches, each with its own Fixes: tag (Laurence Oberman).
- Move 'if (!retval) retval = -1;' to 'out_device_not_present:' in patch 1 so a single hunk covers both out_failed fallthroughs and early out_device_not_present jumps cleanly for stable backports.
- Add Laurence's Reviewed-by tag on patches 1 and 2, and note the

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3scsi: mpi3mr: Return error on all failure exits in mpi3mr_bring_ioc_ready()drivers/scsi/mpi3mr/mpi3mr_fw.c+2 -00 replies
2/3scsi: mpi3mr: Initialize start_time on all paths in mpi3mr_bring_ioc_ready()drivers/scsi/mpi3mr/mpi3mr_fw.c+5 -20 replies
3/3scsi: mpi3mr: Avoid ready_timeout underflow in mpi3mr_bring_ioc_ready()drivers/scsi/mpi3mr/mpi3mr_fw.c+1 -10 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchLaurence Oberman
SeriesT-b
1/3R-b
2/3R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] scsi: mpi3mr: Fix error return, start_time, and timeout check in mpi3mr_bring_ioc_ready()

Split the mpi3mr_bring_ioc_ready() error-handling and retry fixes into three independent patches with individual Fixes: tags as requested by Laurence Oberman:

1. Return -1 instead of 0 on failure exits in mpi3mr_bring_ioc_ready() when retval is 0 (such as unrecoverable controller faults, hot-unplug during reset/diag-save waits, or ready-state faults and timeouts after mpi3mr_setup_admin_qpair() sets retval = 0).
2. Initialize start_time = jiffies on entry and guard the post-enable timestamp reset with a boolean flag so pre-enable failures and subsequent retries never read an uninitialized start_time.
3. Rewrite 'elapsed_time_sec < (mrioc->ready_timeout - 60)' as 'elapsed_time_sec + 60 < mrioc->ready_timeout' to avoid 32-bit unsigned underflow if a controller reports ready_timeout < 60.

v2:
- Split v1 into three patches, each with its own Fixes: tag (Laurence Oberman).
- Move 'if (!retval) retval = -1;' to 'out_device_not_present:' in patch 1 so a single hunk covers both out_failed fallthroughs and early out_device_not_present jumps cleanly for stable backports.
- Add Laurence's Reviewed-by tag on patches 1 and 2, and note the

    510s (570s - 60s) firmware timeout math from commit 9634bb07083c in
    patch 3.

v1: https://lore.kernel.org/r/[email protected]

Ian Rogers (3):
scsi: mpi3mr: Return error on all failure exits in
mpi3mr_bring_ioc_ready()
scsi: mpi3mr: Initialize start_time on all paths in
mpi3mr_bring_ioc_ready()
scsi: mpi3mr: Avoid ready_timeout underflow in
mpi3mr_bring_ioc_ready()

 drivers/scsi/mpi3mr/mpi3mr_fw.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
Signature · 1 line
2.56.1.750.gf70dc682cf-goog