From nobody Thu Jun 06 10:39:21 2024 X-Original-To: dev-commits-src-main@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 4Vw16L64Ryz5MfcN; Thu, 06 Jun 2024 10:39:22 +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 4Vw16L2hVtz4jFb; Thu, 6 Jun 2024 10:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717670362; 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=81qSseryw60L08p0Qe9FMrD+V8TYiv96rYw6JUE3fnU=; b=UbZFIAWl7JMAgd2D3dJr41TnYKO0UG1rBw0NswWP7partLgtgVTs6erEIS9kR7PUp3WYSB UlpRsgHIPruSuegOKfsNVfcwpj9n4s4ygD7BRYUmMjyWJy+Yb/4FcbVAodUebzORCiYSiC hn8Kd7qG819K/8dS0kDTESMS6RDnRj694js+UKcNCSJuTG8BmoCx6I2rBcWBRw6kr9dT6M 9ADz9fpZi0ZaHAyzl/NX9r9Hs/RfIbhI3PSgFKTno+L3oMsuaQp69L2H9SzYNSNl/GF1qE eLeVcAm2Z4forxNSIFCJZnoW/3ROewvWid46Hm6Jt6sJtbadb54mEv8I4jTOZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717670362; a=rsa-sha256; cv=none; b=oqx+VKQUTrcQgLapJ/gqqhyzYXzWbEoHdiJgnG3nBsB6akLX96L/FKuWYaWWAv4v688aWp dKQP0MEu4Dh2empWTVU32AWaWfPz/90zIZuLoUvq5iQfdjXysXX6AHJsBYCo78Pu0dXpzK 5+Fj0NYkgVPAM0bD3R9E5nUSrt75A68JBP9xM60OVCQUAyfn3hFkLMGnyW94mBCjbGVSeW Ltz0Vd2PeSVdEnt/GBIPF1n2pL5QSrDihT7ptF7EzclOTN4uRkwu3kYRIOF2p64mgTeTgG Joy1yTQ0sODHnLPbbp4t00au/eBYCOZEz3a64MGk0YHdyjJGK7y0A0YnXkS6Jg== 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=1717670362; 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=81qSseryw60L08p0Qe9FMrD+V8TYiv96rYw6JUE3fnU=; b=eTvt65FanrqmijBgyUO8FDz+TS9BVj746DBuxtE6+akeTVoBnrzcNWNdsm+Syz5McOTNPe P0popuLFbNY/oQ8ulmEaL2EKuKv42lMSwvWupgleH/5+10C7Rk6uvUxsTRISAhdpZhu9Wz acIXKb0EBf2uh6/YXZMybRorxUxKZYtByG25qzRe3GkL2IKhLQLgk0jlo6VExewsGnxnoy 4NcpAvJ+uhskJ6oRQdABHHtOG9Gxt2OpBZrFA0JCZLoOds2Ofmdtm3XPTF9yU4In0MJLpL PMCIfAxrdjR0Nn14lZPefRBQD9e6N3zzs0soJHWa10A/VToUDg2z1FaIIxslsQ== 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 4Vw16L05nkzj4f; Thu, 6 Jun 2024 10:39:22 +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 456AdLFm089576; Thu, 6 Jun 2024 10:39:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 456AdLUR089573; Thu, 6 Jun 2024 10:39:21 GMT (envelope-from git) Date: Thu, 6 Jun 2024 10:39:21 GMT Message-Id: <202406061039.456AdLUR089573@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: 042808f74707 - main - mpi3mr: Controller state check before enabling PEL List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 042808f74707d3ce89e89463d4a03f81df6fd45a Auto-Submitted: auto-generated The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=042808f74707d3ce89e89463d4a03f81df6fd45a commit 042808f74707d3ce89e89463d4a03f81df6fd45a Author: Chandrakanth patil AuthorDate: 2024-03-14 17:14:53 +0000 Commit: Sumit Saxena CommitDate: 2024-06-06 10:39:14 +0000 mpi3mr: Controller state check before enabling PEL Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D44422 --- sys/dev/mpi3mr/mpi3mr_app.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/mpi3mr/mpi3mr_app.c b/sys/dev/mpi3mr/mpi3mr_app.c index 7bd926269018..60ef6765cb76 100644 --- a/sys/dev/mpi3mr/mpi3mr_app.c +++ b/sys/dev/mpi3mr/mpi3mr_app.c @@ -1641,6 +1641,18 @@ mpi3mr_pel_enable(struct mpi3mr_softc *sc, struct mpi3mr_ioctl_pel_enable pel_enable; mpi3mr_dprint(sc, MPI3MR_TRACE, "%s() line: %d\n", __func__, __LINE__); + if (sc->unrecoverable) { + device_printf(sc->mpi3mr_dev, "Issue IOCTL: controller is in unrecoverable state\n"); + return EFAULT; + } + if (sc->reset_in_progress) { + device_printf(sc->mpi3mr_dev, "Issue IOCTL: reset in progress\n"); + return EAGAIN; + } + if (sc->block_ioctls) { + device_printf(sc->mpi3mr_dev, "Issue IOCTL: IOCTLs are blocked\n"); + return EAGAIN; + } if ((data_out_sz != sizeof(pel_enable) || (pel_enable.pel_class > MPI3_PEL_CLASS_FAULT))) {