diff options
author | mav <mav@FreeBSD.org> | 2009-12-06 11:48:53 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2009-12-06 11:48:53 +0000 |
commit | 3b25356a7f2fbaed46baab9878a76f64fb46aa41 (patch) | |
tree | 22687d4a4a7e84b87046c466907100e1e59e7ee8 /sys/cam | |
parent | 38d83668450370995d6ddef15aeaa9f87641e60d (diff) | |
download | FreeBSD-src-3b25356a7f2fbaed46baab9878a76f64fb46aa41.zip FreeBSD-src-3b25356a7f2fbaed46baab9878a76f64fb46aa41.tar.gz |
MFp4:
If we panicked with SIM lock held, do not try to flush caches.
Extra lock recursing will not make debugging easier.
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/ata/ata_da.c | 3 | ||||
-rw-r--r-- | sys/cam/cam_periph.h | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 4a9a9c3..f62af46 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -1040,6 +1040,9 @@ adashutdown(void * arg, int howto) TAILQ_FOREACH(periph, &adadriver.units, unit_links) { union ccb ccb; + /* If we paniced with lock held - not recurse here. */ + if (cam_periph_owned(periph)) + continue; cam_periph_lock(periph); softc = (struct ada_softc *)periph->softc; /* diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h index 07caf52..e207b19 100644 --- a/sys/cam/cam_periph.h +++ b/sys/cam/cam_periph.h @@ -190,5 +190,11 @@ cam_periph_unlock(struct cam_periph *periph) mtx_unlock(periph->sim->mtx); } +static __inline int +cam_periph_owned(struct cam_periph *periph) +{ + return (mtx_owned(periph->sim->mtx)); +} + #endif /* _KERNEL */ #endif /* _CAM_CAM_PERIPH_H */ |