mpi3mr: Controller state check before enabling PEL
Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D44422
This commit is contained in:
committed by
Sumit Saxena
parent
0d7056458d
commit
042808f747
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user