aboutsummaryrefslogtreecommitdiff
path: root/sys/cam
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2013-06-15 12:46:38 +0000
committerAlexander Motin <mav@FreeBSD.org>2013-06-15 12:46:38 +0000
commit2f87dfb0dbbb89a02cec8907d25703e3c75688b9 (patch)
tree93e98579cf19cbf974c37c1515b78393c230912f /sys/cam
parent8b02079f3689e5112eea231d552c46cef89a3f55 (diff)
downloadsrc-2f87dfb0dbbb89a02cec8907d25703e3c75688b9.tar.gz
src-2f87dfb0dbbb89a02cec8907d25703e3c75688b9.zip
Restore use of polling mode for disk cache flush in case of kernel panic.
While I am not sure that any extra hardware access is a good idea after panic, that is an existing behaviour that should better work correctly.
Notes
Notes: svn path=/head/; revision=251792
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/ata/ata_da.c12
-rw-r--r--sys/cam/scsi/scsi_da.c11
2 files changed, 19 insertions, 4 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index 0a4d4a3789f6..721d5b5b3790 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/eventhandler.h>
#include <sys/malloc.h>
#include <sys/cons.h>
+#include <sys/proc.h>
#include <sys/reboot.h>
#include <geom/geom_disk.h>
#endif /* _KERNEL */
@@ -1907,11 +1908,16 @@ adaflush(void)
int error;
CAM_PERIPH_FOREACH(periph, &adadriver) {
- /* If we paniced with lock held - not recurse here. */
- if (cam_periph_owned(periph))
+ softc = (struct ada_softc *)periph->softc;
+ if (SCHEDULER_STOPPED()) {
+ /* If we paniced with the lock held, do not recurse. */
+ if (!cam_periph_owned(periph) &&
+ (softc->flags & ADA_FLAG_OPEN)) {
+ adadump(softc->disk, NULL, 0, 0, 0);
+ }
continue;
+ }
cam_periph_lock(periph);
- softc = (struct ada_softc *)periph->softc;
/*
* We only sync the cache if the drive is still open, and
* if the drive is capable of it..
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 76a16ea599d8..e0e33d67f2fe 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/cons.h>
#include <sys/endian.h>
+#include <sys/proc.h>
#include <geom/geom.h>
#include <geom/geom_disk.h>
#endif /* _KERNEL */
@@ -3671,8 +3672,16 @@ dashutdown(void * arg, int howto)
int error;
CAM_PERIPH_FOREACH(periph, &dadriver) {
- cam_periph_lock(periph);
softc = (struct da_softc *)periph->softc;
+ if (SCHEDULER_STOPPED()) {
+ /* If we paniced with the lock held, do not recurse. */
+ if (!cam_periph_owned(periph) &&
+ (softc->flags & DA_FLAG_OPEN)) {
+ dadump(softc->disk, NULL, 0, 0, 0);
+ }
+ continue;
+ }
+ cam_periph_lock(periph);
/*
* We only sync the cache if the drive is still open, and