FreeBSD Bugzilla – Attachment 181725 Details for
Bug 218597
[CRYPTODEV] spurious wakeup and synchronisation problem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
patch (text/plain), 1.72 KB, created by
Alexandre martins
on 2017-04-12 16:07:03 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Alexandre martins
Created:
2017-04-12 16:07:03 UTC
Size:
1.72 KB
patch
obsolete
>diff --git sys/opencrypto/cryptodev.c sys/opencrypto/cryptodev.c >index bda77c79b96..c04abd89fcc 100644 >--- sys/opencrypto/cryptodev.c >+++ sys/opencrypto/cryptodev.c >@@ -286,6 +286,7 @@ struct csession { > struct iovec iovec; > struct uio uio; > int error; >+ int done; > }; > > struct fcrypt { >@@ -815,6 +816,7 @@ cryptodev_op( > goto bail; > } > >+ cse->done = 0; > again: > /* > * Let the dispatch run unlocked, then, interlock against the >@@ -825,7 +827,7 @@ again: > */ > error = crypto_dispatch(crp); > mtx_lock(&cse->lock); >- if (error == 0 && (crp->crp_flags & CRYPTO_F_DONE) == 0) >+ while (error == 0 && !cse->done) > error = msleep(crp, &cse->lock, PWAIT, "crydev", 0); > mtx_unlock(&cse->lock); > >@@ -835,6 +837,7 @@ again: > } > > if (crp->crp_etype == EAGAIN) { >+ cse->done = 0; > crp->crp_etype = 0; > crp->crp_flags &= ~CRYPTO_F_DONE; > goto again; >@@ -972,6 +975,8 @@ cryptodev_aead( > if ((error = copyin(caead->tag, (caddr_t)cse->uio.uio_iov[0].iov_base + > caead->len + caead->aadlen, cse->thash->hashsize))) > goto bail; >+ >+ cse->done = 0; > again: > /* > * Let the dispatch run unlocked, then, interlock against the >@@ -982,7 +987,7 @@ again: > */ > error = crypto_dispatch(crp); > mtx_lock(&cse->lock); >- if (error == 0 && (crp->crp_flags & CRYPTO_F_DONE) == 0) >+ while (error == 0 && !cse->done) > error = msleep(crp, &cse->lock, PWAIT, "crydev", 0); > mtx_unlock(&cse->lock); > >@@ -990,6 +995,7 @@ again: > goto bail; > > if (crp->crp_etype == EAGAIN) { >+ cse->done = 0; > crp->crp_etype = 0; > crp->crp_flags &= ~CRYPTO_F_DONE; > goto again; >@@ -1028,6 +1034,7 @@ cryptodev_cb(void *op) > > mtx_lock(&cse->lock); > cse->error = crp->crp_etype; >+ cse->done = 1; > wakeup_one(crp); > mtx_unlock(&cse->lock); > return (0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 218597
: 181725