diff options
author | hselasky <hselasky@FreeBSD.org> | 2016-05-25 09:04:06 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2016-05-25 09:04:06 +0000 |
commit | dbcba89131b58b7216efb8356da2adfc1a788cb7 (patch) | |
tree | b5692322399cbb88c01e1d6789f5a87750374cfb /sys/compat/linuxkpi/common/src/linux_compat.c | |
parent | 6a7280215260369b317474512d2b44c105a020a8 (diff) | |
download | FreeBSD-src-dbcba89131b58b7216efb8356da2adfc1a788cb7.zip FreeBSD-src-dbcba89131b58b7216efb8356da2adfc1a788cb7.tar.gz |
Add checks for SCHEDULER_STOPPED() so that code using the LinuxKPI can
run after a panic(). This for example allows a LinuxKPI based graphics
stack to receive prints during a panic.
Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/compat/linuxkpi/common/src/linux_compat.c')
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_compat.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index faaa1d4..1fc0bc4 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1093,6 +1093,8 @@ linux_complete_common(struct completion *c, int all) long linux_wait_for_common(struct completion *c, int flags) { + if (unlikely(SCHEDULER_STOPPED())) + return (0); if (flags != 0) flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; @@ -1123,6 +1125,9 @@ linux_wait_for_timeout_common(struct completion *c, long timeout, int flags) { long end = jiffies + timeout; + if (unlikely(SCHEDULER_STOPPED())) + return (0); + if (flags != 0) flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; else |