dm: pcidev: clean up assert() for some pci devices

Tracked-On: #3252
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Shuo A Liu
2019-06-18 13:59:56 +08:00
committed by wenlingz
parent 2b3dedfb9b
commit 1b7995387d
5 changed files with 45 additions and 20 deletions

View File

@@ -55,7 +55,6 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <pthread.h>
#include <sysexits.h>
#include <dlfcn.h>
@@ -312,17 +311,23 @@ virtio_hdcp_talk_to_daemon(void *param)
* - avoid vring processing due to spurious wakeups
* - catch missing notifications before acquiring rx_mtx
*/
while (!vq_has_descs(rvq)) {
ret = pthread_cond_wait(&vhdcp->rx_cond, &vhdcp->rx_mtx);
assert(ret == 0);
}
while (!vq_has_descs(rvq))
pthread_cond_wait(&vhdcp->rx_cond, &vhdcp->rx_mtx);
vhdcp->in_progress = 1;
pthread_mutex_unlock(&vhdcp->rx_mtx);
do {
ret = vq_getchain(rvq, &idx, &iov, 1, NULL);
assert(ret > 0);
if (ret < 1) {
pr_err("%s: fail to getchain!\n", __func__);
return NULL;
}
if (ret > 1) {
pr_warn("%s: invalid chain!\n", __func__);
vq_relchain(rvq, idx, 0);
continue;
}
msg = (struct SocketData*)(iov.iov_base);