From nobody Tue Mar 12 10:08:14 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 4Tv8V61hCVz5DXBL; Tue, 12 Mar 2024 10:08:14 +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 4Tv8V61DjQz4K4S; Tue, 12 Mar 2024 10:08:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710238094; 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=+du4xYwOBCrJKJ+9gdNgJVPtnQkUky5Pi0J5/yBMWys=; b=d71q6v4uLG4yfJ0BeAVovDEryEP9WN3eU+yV6qWmbXoOJeO45v2mk4wUqDKJNqBj29vJ9C xmhoCV9v3dcSz7kTQH2lDM/6rt6Y7Rz55b6I2RFNtDSus3QFzQBZmpr0TtJAYyN4+Uffxm RydTbbnqMqXW2Bz+nh11sgB+0xOjLZ0HZ7V6ex1yOSaF84df0EbJuzQ6Qlk/PNOgnHlepO NRsGmp6bt1zVEVVsYr8tjvPi84NniK61KdDMlOuit4Nq99RiQS1JiMsDLmPEcjsdpfGo64 1IzahCSrgHjAImiRTLx21xKFdgivUJsYr3Nn8goMmW3dwLi4AAsYPcDuxImkAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710238094; a=rsa-sha256; cv=none; b=D6u0MnJINQgSGwj3LVSrqtndk2IBBrCrot4bKG8hYc92hdwp/xNL1ZUbtSBmyK2TxeDme/ 8Qdu4R/39KqovsASdn7US7e+PogogkZKYsz3CiyGkho9DEM+gb4Tkwb9AAAT7jUnT9kZ/J Z2bszgK4NxswR/Ax9/S2JSw8QmCSEiFfO8eR5Kio5JKJRvyPy8LH+uRKbyvTRcIu90qQeS Xa4URtioj0SUnzMQbOKyYREHDSWPublYWfHq54/2B0rOkFJcjTlJI+UfNKJRLwsaLPwCpd JaPMOEsj89zAou9qBipm1ECvGzigR/F0Z+98DltvyMrgJMh7qwlFntWVPWVYRw== 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=1710238094; 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=+du4xYwOBCrJKJ+9gdNgJVPtnQkUky5Pi0J5/yBMWys=; b=jlmuhGtTZ/WuubLP/4f24xa9hYPjGiD18fKTM1IBBQDkgG8WpMme6VFL4hO5VddKiBvsc3 5iasrvy1JQAEz0x4SX0xXJovNao+jRmMocw6ageVerY8vc2eLK56t5mBBI6IAfFEL8pwPi Wk6ov+wE9Xi4lWjNe55MvnWaiKLDH/PrH6csZ9jNfnhgvdAqGI9Xx6QERrbt8Hjhs7+3NG KUMhXJkfvZNWrl0sgPKehiW8bRIuq/0wzrys/0BAxYKUZnWjHwz+EZDhq1PdMxVztOmVOk tqpxrTn2+4SlHmLDxEaApDegAuYXQYpxjRVrez4Owqi071oNswJng+LLv+o1mA== 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 4Tv8V60nKqz18mb; Tue, 12 Mar 2024 10:08:14 +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 42CA8EFg011496; Tue, 12 Mar 2024 10:08:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42CA8ElU011493; Tue, 12 Mar 2024 10:08:14 GMT (envelope-from git) Date: Tue, 12 Mar 2024 10:08:14 GMT Message-Id: <202403121008.42CA8ElU011493@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: 835b12a5f9c5 - main - mrsas: don't reference the removed physical disk of RAID1 during IO submission 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 835b12a5f9c5dfaec3bcd9446369fdad995ee538 Auto-Submitted: auto-generated The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=835b12a5f9c5dfaec3bcd9446369fdad995ee538 commit 835b12a5f9c5dfaec3bcd9446369fdad995ee538 Author: Sumit Saxena AuthorDate: 2024-03-12 06:51:09 +0000 Commit: Sumit Saxena CommitDate: 2024-03-12 09:51:48 +0000 mrsas: don't reference the removed physical disk of RAID1 during IO submission When a physical disk(PD) [belonging to a RAID1 Virtual disk(VD)] is removed, driver may still use the reference to the removed PD while submitting IO to the controller. Controller firmware faults upon receipt of such IO. This patch fixes this issue by not using any reference to the removed PD. Reviewed by: imp Approved by: imp Sponsored by: Broadcom Inc Differential Revision: https://reviews.freebsd.org/D44282 --- sys/dev/mrsas/mrsas_fp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/mrsas/mrsas_fp.c b/sys/dev/mrsas/mrsas_fp.c index 9fdb24cc0569..c08558e78b46 100644 --- a/sys/dev/mrsas/mrsas_fp.c +++ b/sys/dev/mrsas/mrsas_fp.c @@ -964,7 +964,8 @@ mr_spanset_get_phy_params(struct mrsas_softc *sc, u_int32_t ld, u_int64_t stripR raid->regTypeReqOnRead != REGION_TYPE_UNUSED))) pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE; else if (raid->level == 1) { - pd = MR_ArPdGet(arRef, physArm + 1, map); + physArm++; + pd = MR_ArPdGet(arRef, physArm, map); if (pd != MR_PD_INVALID) { *pDevHandle = MR_PdDevHandleGet(pd, map); *pPdInterface = MR_PdInterfaceTypeGet(pd, map); @@ -1711,7 +1712,8 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t ld, pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE; else if (raid->level == 1) { /* Get Alternate Pd. */ - pd = MR_ArPdGet(arRef, physArm + 1, map); + physArm++; + pd = MR_ArPdGet(arRef, physArm, map); if (pd != MR_PD_INVALID) { /* Get dev handle from Pd. */ *pDevHandle = MR_PdDevHandleGet(pd, map);