Date: Thu, 6 Jun 2024 10:39:21 GMT From: Sumit Saxena <ssaxena@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 042808f74707 - main - mpi3mr: Controller state check before enabling PEL Message-ID: <202406061039.456AdLUR089573@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=042808f74707d3ce89e89463d4a03f81df6fd45a commit 042808f74707d3ce89e89463d4a03f81df6fd45a Author: Chandrakanth patil <chandrakanth.patil@broadcom.com> AuthorDate: 2024-03-14 17:14:53 +0000 Commit: Sumit Saxena <ssaxena@FreeBSD.org> 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))) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202406061039.456AdLUR089573>