mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] scsi: mpi3mr: Fix error return, start_time, and timeout check in mpi3mr_bring_ioc_ready()
@ 2026-11-20 19:00 Ian Rogers
  2026-11-20 19:00 ` [PATCH v2 1/3] scsi: mpi3mr: Return error on all failure exits " Ian Rogers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ian Rogers @ 2026-11-20 19:00 UTC (permalink / raw)
  To: Sathya Prakash Veerichetty, Kashyap Desai, Sumit Saxena,
	Sreekanth Reddy, James E.J. Bottomley, Martin K. Petersen
  Cc: Laurence Oberman, mpi3mr-linuxdrv.pdl, linux-scsi, linux-kernel,
	llvm, Elkin Cruz, Ian Rogers

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/20261119170900.1530138-1-irogers@google.com

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

-- 
2.56.1.750.gf70dc682cf-goog


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

end of thread, other threads:[~2026-11-20 19:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20 19:00 [PATCH v2 0/3] scsi: mpi3mr: Fix error return, start_time, and timeout check in mpi3mr_bring_ioc_ready() Ian Rogers
2026-11-20 19:00 ` [PATCH v2 1/3] scsi: mpi3mr: Return error on all failure exits " Ian Rogers
2026-11-20 19:00 ` [PATCH v2 2/3] scsi: mpi3mr: Initialize start_time on all paths " Ian Rogers
2026-11-20 19:00 ` [PATCH v2 3/3] scsi: mpi3mr: Avoid ready_timeout underflow " Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®