Date: Tue, 29 Nov 2016 12:55:01 +0000 (UTC) From: Kashyap D Desai <kadesai@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309286 - head/sys/dev/mrsas Message-ID: <201611291255.uATCt1uf053430@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kadesai Date: Tue Nov 29 12:55:01 2016 New Revision: 309286 URL: https://svnweb.freebsd.org/changeset/base/309286 Log: 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 Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:53:05 2016 (r309285) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:55:01 2016 (r309286) @@ -1359,9 +1359,11 @@ mrsas_ioctl(struct cdev *dev, u_long cmd 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); Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:53:05 2016 (r309285) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:55:01 2016 (r309286) @@ -260,6 +260,17 @@ mrsas_action(struct cam_sim *sim, union 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: {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611291255.uATCt1uf053430>