From nobody Thu Jun 06 10:39:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vw16N6P7Dz5MffT; Thu, 06 Jun 2024 10:39:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vw16N3LWTz4jL0; Thu, 6 Jun 2024 10:39:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717670364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fark+VBbcrVMexKGUMo/ZUu2OzTVgOWrSmZfVGqEHjg=; b=f+Fyzo0gRhJvRboAn1VThHzxZVQrV0BqsgawacBBw3BGAgZAQM2fJrD4U/nxdLacHQIF+N kfSUYIkrETATpFhV8MgSqxQk+QYTMfD0uRfEUsRJi/XCxnLi8YeUim8YS5VZNk90uTkKnB 6aXo2AoAuXHGH5t/CG+X2z2EZwxEc5110jUcl2X1vLGZ8dzmlHhlmluELKRTj02jsoD7rG Dcv7b7Psr5H2/4zvKinxHJf2pyYJtxllmedu5qENimGy2bfecqYXdO5izSRboxsPVF0zn0 /kp7zY6vVeNMV1VGoaEfaYnKucHwW82WwHLWsVzjlIUKtO8EY1R85gsGSTamrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717670364; a=rsa-sha256; cv=none; b=ceH+PfFhikGfgGzH25f7FTfcHRWfqGeI85v3OXZNQjNx9tBxjr995xT7/yfRVGrY4hSYn/ USl2ojVd4JDEjY8uuCCNkiwm3vsg+Djv/AsgaBNfm0Zn0scPvQzV3HoPYxggpuwchR+UT9 EDQaPfLE8Ir+1SAl/THWOGNwfA7lWzlGwtvFFeZOt+Mv4k86jliAUQ7uA2/yYuQPbvRKpb 8Lh8ILK1A8q5+tDKt9Cnea0+HWwJWY/Xd8bT/1wK2H/w+GEndwU92rTfU+nRn0SwHJ6dCV 15MRnISSGKMvKGE+GWLCjsC5DOqM7/XFkH1IWYtkdpc58ShcZOaxVukxXlEhHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717670364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fark+VBbcrVMexKGUMo/ZUu2OzTVgOWrSmZfVGqEHjg=; b=AppKGdvtxxhNDT6Tez03WYTOnU4TqpuByZM6bqyXMSdjaDNieQ0muzCcE5y1b0nCEwVBNq rkIRQGhzkJqnMGe4GxOzbe8eWekpXgU71i6bsOBb0n5afEmHMdr6cA91H67YBNAIVCdDuC dLvqCSKDwg0PQqrTQhXnrJ+pQ099J8YDTezzixrC3xusJOxVrJ8vdjvU0jDSSLf3BtRMep xqyA2cpwagT3ogCeidcTS2GZrE/8zA5UJjvi+rFOGanGgVC4L9zynxgVp0WBN5PS1Ai5ba Gbxi/ZFAoGBHqC8Ip38eB7shjpv9l1we/SXdGS5/XpJH1JH4HolsuuqabqN4Gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vw16N2BmCzj6t; Thu, 6 Jun 2024 10:39:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 456AdObe089691; Thu, 6 Jun 2024 10:39:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 456AdO0w089688; Thu, 6 Jun 2024 10:39:24 GMT (envelope-from git) Date: Thu, 6 Jun 2024 10:39:24 GMT Message-Id: <202406061039.456AdO0w089688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Sumit Saxena Subject: git: 571f1d0638fa - main - mpi3mr: Decrement per controller and per target counter post reset List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 571f1d0638fa6b3a08f84118a33e53f941f0820c Auto-Submitted: auto-generated The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=571f1d0638fa6b3a08f84118a33e53f941f0820c commit 571f1d0638fa6b3a08f84118a33e53f941f0820c Author: Chandrakanth patil AuthorDate: 2024-03-14 18:12:49 +0000 Commit: Sumit Saxena CommitDate: 2024-06-06 10:39:15 +0000 mpi3mr: Decrement per controller and per target counter post reset Post controller reset, If any device removal events arrive, and if there are any outstanding IOs then the driver will unnecessarily wait in the loop for 30 seconds before removing the device from the OS. reset target outstanding IO counter and controller outstanding IO counter and remove the redundant wait loop. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D44424 --- sys/dev/mpi3mr/mpi3mr.c | 2 ++ sys/dev/mpi3mr/mpi3mr_cam.c | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr.c b/sys/dev/mpi3mr/mpi3mr.c index 72abe76ad085..ba649edbe070 100644 --- a/sys/dev/mpi3mr/mpi3mr.c +++ b/sys/dev/mpi3mr/mpi3mr.c @@ -5692,6 +5692,8 @@ static void mpi3mr_flush_io(struct mpi3mr_softc *sc) if (cmd->callout_owner) { ccb = (union ccb *)(cmd->ccb); ccb->ccb_h.status = CAM_SCSI_BUS_RESET; + mpi3mr_atomic_dec(&sc->fw_outstanding); + mpi3mr_atomic_dec(&cmd->targ->outstanding); mpi3mr_cmd_done(sc, cmd); } else { cmd->ccb = NULL; diff --git a/sys/dev/mpi3mr/mpi3mr_cam.c b/sys/dev/mpi3mr/mpi3mr_cam.c index b8e4e350dfa1..4843aa6ea721 100644 --- a/sys/dev/mpi3mr/mpi3mr_cam.c +++ b/sys/dev/mpi3mr/mpi3mr_cam.c @@ -1802,7 +1802,6 @@ out: int mpi3mr_remove_device_from_os(struct mpi3mr_softc *sc, U16 handle) { - U32 i = 0; int retval = 0; struct mpi3mr_target *target; @@ -1833,17 +1832,6 @@ int mpi3mr_remove_device_from_os(struct mpi3mr_softc *sc, U16 handle) target->per_id); } - while (mpi3mr_atomic_read(&target->outstanding) && (i < 30)) { - i++; - if (!(i % 2)) { - mpi3mr_dprint(sc, MPI3MR_INFO, - "[%2d]waiting for " - "waiting for outstanding commands to complete on target: %d\n", - i, target->per_id); - } - DELAY(1000 * 1000); - } - if (target->exposed_to_os && !sc->reset_in_progress) { mpi3mr_rescan_target(sc, target); mpi3mr_dprint(sc, MPI3MR_INFO,