aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mpi3mr
diff options
context:
space:
mode:
authorChandrakanth patil <chandrakanth.patil@broadcom.com>2024-06-06 10:28:38 +0000
committerSumit Saxena <ssaxena@FreeBSD.org>2024-06-06 10:39:16 +0000
commit8d3c3b52423f9740da424aa6dd73a20e694a9e08 (patch)
tree4724588724302b0e2446c36842eed6ea214a6c8d /sys/dev/mpi3mr
parent3f3a15543a6721100dda0e4219eb48ecbe35731a (diff)
Diffstat (limited to 'sys/dev/mpi3mr')
-rw-r--r--sys/dev/mpi3mr/mpi3mr_cam.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/dev/mpi3mr/mpi3mr_cam.c b/sys/dev/mpi3mr/mpi3mr_cam.c
index e3958ed8daf2..e00d61073d96 100644
--- a/sys/dev/mpi3mr/mpi3mr_cam.c
+++ b/sys/dev/mpi3mr/mpi3mr_cam.c
@@ -1839,6 +1839,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);
@@ -1856,16 +1857,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);