summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp_freebsd.h
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2000-12-05 07:41:53 +0000
committermjacob <mjacob@FreeBSD.org>2000-12-05 07:41:53 +0000
commitd08b7ab68bb5f2084f86e1004746c13fa9712489 (patch)
treebee3757c638de617bd6c0d8502133acd188a94f8 /sys/dev/isp/isp_freebsd.h
parent193916e579629ddfaf1d2f8525bce028cee25e97 (diff)
downloadFreeBSD-src-d08b7ab68bb5f2084f86e1004746c13fa9712489.zip
FreeBSD-src-d08b7ab68bb5f2084f86e1004746c13fa9712489.tar.gz
Only call ISP_UNLOCK/ISP_LOCK if isp->isp_osinfo.intsok in USEC_SLEEP.
Add a test against isp->isp_osinfo.islocked prior to trying to see whether --isp->isp_osinfo.islocked is zero to cause us to unlock (non-SMPLOCK case).
Diffstat (limited to 'sys/dev/isp/isp_freebsd.h')
-rw-r--r--sys/dev/isp/isp_freebsd.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h
index 3425460..5f9f47f 100644
--- a/sys/dev/isp/isp_freebsd.h
+++ b/sys/dev/isp/isp_freebsd.h
@@ -146,10 +146,12 @@ struct isposinfo {
#define SNPRINTF snprintf
#define STRNCAT strncat
#define USEC_DELAY DELAY
-#define USEC_SLEEP(isp, x) \
- ISP_UNLOCK(isp); \
- DELAY(x); \
- ISP_LOCK(isp)
+#define USEC_SLEEP(isp, x) \
+ if (isp->isp_osinfo.intsok) \
+ ISP_UNLOCK(isp); \
+ DELAY(x); \
+ if (isp->isp_osinfo.intsok) \
+ ISP_LOCK(isp)
#define NANOTIME_T struct timespec
#define GET_NANOTIME nanotime
@@ -332,8 +334,10 @@ static INLINE void isp_unlock(struct ispsoftc *);
static INLINE void
isp_unlock(struct ispsoftc *isp)
{
- if (--isp->isp_osinfo.islocked == 0) {
- splx(isp->isp_osinfo.splsaved);
+ if (isp->isp_osinfo.islocked) {
+ if (--isp->isp_osinfo.islocked == 0) {
+ splx(isp->isp_osinfo.splsaved);
+ }
}
}
#endif
OpenPOWER on IntegriCloud