diff options
author | mav <mav@FreeBSD.org> | 2014-01-05 22:45:46 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-01-05 22:45:46 +0000 |
commit | 116abbfd1f102c63111657f01cc3761565131f66 (patch) | |
tree | 66fbf4bebcd0fd90ef2877868cb25911518fa2d4 /sys/dev/isp/isp_library.c | |
parent | 2ef8e6e39b77829132dba387adb1c4e19a04035b (diff) | |
download | FreeBSD-src-116abbfd1f102c63111657f01cc3761565131f66.zip FreeBSD-src-116abbfd1f102c63111657f01cc3761565131f66.tar.gz |
MFC r257916:
Save one more register read per command by not reading rqstoutrp register
every time. The purpose of that register is unlikely output queue overflow
detection, so read it only when its last known (and probably stale now)
value signals overflow.
Diffstat (limited to 'sys/dev/isp/isp_library.c')
-rw-r--r-- | sys/dev/isp/isp_library.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c index d5535f2..62c651c 100644 --- a/sys/dev/isp/isp_library.c +++ b/sys/dev/isp/isp_library.c @@ -322,9 +322,13 @@ isp_destroy_handle(ispsoftc_t *isp, uint32_t handle) void * isp_getrqentry(ispsoftc_t *isp) { - isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp); - if (ISP_NXT_QENTRY(isp->isp_reqidx, RQUEST_QUEUE_LEN(isp)) == isp->isp_reqodx) { - return (NULL); + uint32_t next; + + next = ISP_NXT_QENTRY(isp->isp_reqidx, RQUEST_QUEUE_LEN(isp)); + if (next == isp->isp_reqodx) { + isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp); + if (next == isp->isp_reqodx) + return (NULL); } return (ISP_QUEUE_ENTRY(isp->isp_rquest, isp->isp_reqidx)); } |