summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-02-10 16:29:50 +0000
committermav <mav@FreeBSD.org>2014-02-10 16:29:50 +0000
commit511b6fbea4485268c9f78f220d016578d0486bc4 (patch)
tree19108c2a1bc424d30b7d9c710edfb64286d03f6d
parent44aad33d558d1db0c082ad7a05b503033a0d0de9 (diff)
downloadFreeBSD-src-511b6fbea4485268c9f78f220d016578d0486bc4.zip
FreeBSD-src-511b6fbea4485268c9f78f220d016578d0486bc4.tar.gz
MFC r261515:
Fix I/O freezes in some cases, caused by r257916. Delaying isp_reqodx update, we should be ready to update it every time we read it. Otherwise requests using several indexes may be requeued ndefinitely without ever updating the variable.
-rw-r--r--sys/dev/isp/isp_library.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c
index 62c651c..9d7cfe2 100644
--- a/sys/dev/isp/isp_library.c
+++ b/sys/dev/isp/isp_library.c
@@ -144,7 +144,9 @@ isp_send_cmd(ispsoftc_t *isp, void *fqe, void *segp, uint32_t nsegs, uint32_t to
while (seg < nsegs) {
nxtnxt = ISP_NXT_QENTRY(nxt, RQUEST_QUEUE_LEN(isp));
if (nxtnxt == isp->isp_reqodx) {
- return (CMD_EAGAIN);
+ isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp);
+ if (nxtnxt == isp->isp_reqodx)
+ return (CMD_EAGAIN);
}
ISP_MEMZERO(storage, QENTRY_LEN);
qe1 = ISP_QUEUE_ENTRY(isp->isp_rquest, nxt);
@@ -2210,7 +2212,9 @@ isp_send_tgt_cmd(ispsoftc_t *isp, void *fqe, void *segp, uint32_t nsegs, uint32_
while (seg < nsegs) {
nxtnxt = ISP_NXT_QENTRY(nxt, RQUEST_QUEUE_LEN(isp));
if (nxtnxt == isp->isp_reqodx) {
- return (CMD_EAGAIN);
+ isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp);
+ if (nxtnxt == isp->isp_reqodx)
+ return (CMD_EAGAIN);
}
ISP_MEMZERO(storage, QENTRY_LEN);
qe1 = ISP_QUEUE_ENTRY(isp->isp_rquest, nxt);
OpenPOWER on IntegriCloud