git: 1fc80c01391e - stable/14 - mpi3mr: Track IO per target counter during queue poll with local variable
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 30 Apr 2025 17:21:47 UTC
The branch stable/14 has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=1fc80c01391e58fa484021e37b4ca36307bb340b
commit 1fc80c01391e58fa484021e37b4ca36307bb340b
Author: Chandrakanth patil <chandrakanth.patil@broadcom.com>
AuthorDate: 2024-06-06 10:28:38 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-04-30 17:05:52 +0000
mpi3mr: Track IO per target counter during queue poll with local variable
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D44494
(cherry picked from commit 8d3c3b52423f9740da424aa6dd73a20e694a9e08)
---
sys/dev/mpi3mr/mpi3mr_cam.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/sys/dev/mpi3mr/mpi3mr_cam.c b/sys/dev/mpi3mr/mpi3mr_cam.c
index dca194a5c8cd..537811077164 100644
--- a/sys/dev/mpi3mr/mpi3mr_cam.c
+++ b/sys/dev/mpi3mr/mpi3mr_cam.c
@@ -1840,6 +1840,7 @@ int mpi3mr_remove_device_from_os(struct mpi3mr_softc *sc, U16 handle)
{
int retval = 0;
struct mpi3mr_target *target;
+ unsigned int target_outstanding;
mpi3mr_dprint(sc, MPI3MR_EVENT,
"Removing Device (dev_handle: %d)\n", handle);
@@ -1857,16 +1858,17 @@ int mpi3mr_remove_device_from_os(struct mpi3mr_softc *sc, U16 handle)
target->flags |= MPI3MRSAS_TARGET_INREMOVAL;
- if (mpi3mr_atomic_read(&target->outstanding)) {
- mpi3mr_dprint(sc, MPI3MR_ERROR, "there are [%2d] outstanding IOs on target: %d"
- "Poll reply queue once\n", mpi3mr_atomic_read(&target->outstanding),
- target->per_id);
- mpi3mr_poll_pend_io_completions(sc);
- if (mpi3mr_atomic_read(&target->outstanding))
- mpi3mr_dprint(sc, MPI3MR_ERROR, "[%2d] outstanding IOs present on target: %d"
- "despite poll\n", mpi3mr_atomic_read(&target->outstanding),
- target->per_id);
- }
+ target_outstanding = mpi3mr_atomic_read(&target->outstanding);
+ if (target_outstanding) {
+ mpi3mr_dprint(sc, MPI3MR_ERROR, "there are [%2d] outstanding IOs on target: %d "
+ "Poll reply queue once\n", target_outstanding, target->per_id);
+ mpi3mr_poll_pend_io_completions(sc);
+ target_outstanding = mpi3mr_atomic_read(&target->outstanding);
+ if (target_outstanding)
+ target_outstanding = mpi3mr_atomic_read(&target->outstanding);
+ mpi3mr_dprint(sc, MPI3MR_ERROR, "[%2d] outstanding IOs present on target: %d "
+ "despite poll\n", target_outstanding, target->per_id);
+ }
if (target->exposed_to_os && !sc->reset_in_progress) {
mpi3mr_rescan_target(sc, target);