Add sanity check in IO and IOCTL path not to process command further if controller is in

HW_CRITICAL_ERROR.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies
This commit is contained in:
Kashyap D Desai 2016-11-29 12:55:01 +00:00
parent f9c630813e
commit 808517a4f9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=309286
2 changed files with 15 additions and 2 deletions

View File

@ -1359,9 +1359,11 @@ mrsas_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag,
if (!sc)
return ENOENT;
if (sc->remove_in_progress) {
if (sc->remove_in_progress ||
(sc->adprecovery == MRSAS_HW_CRITICAL_ERROR)) {
mrsas_dprint(sc, MRSAS_INFO,
"Driver remove or shutdown called.\n");
"Either driver remove or shutdown called or "
"HW is in unrecoverable critical error state.\n");
return ENOENT;
}
mtx_lock_spin(&sc->ioctl_lock);

View File

@ -260,6 +260,17 @@ mrsas_action(struct cam_sim *sim, union ccb *ccb)
struct ccb_hdr *ccb_h = &(ccb->ccb_h);
u_int32_t device_id;
/*
* Check if the system going down
* or the adapter is in unrecoverable critical error
*/
if (sc->remove_in_progress ||
(sc->adprecovery == MRSAS_HW_CRITICAL_ERROR)) {
ccb->ccb_h.status |= CAM_DEV_NOT_THERE;
xpt_done(ccb);
return;
}
switch (ccb->ccb_h.func_code) {
case XPT_SCSI_IO:
{