diag: Do not wait for the intent availability indefinetly
While sending data to WDSP do not wait for the intent to be available for ever so that diag is not blocked to send data to other peripherals. Change-Id: I5e410ebabf4e8066abedda147879444a38b8871b Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
This commit is contained in:
parent
46692be6dd
commit
35fa3e5dce
2 changed files with 13 additions and 14 deletions
|
@ -413,19 +413,16 @@ static int diag_glink_write(void *ctxt, unsigned char *buf, int len)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
err = wait_event_interruptible(glink_info->wait_q,
|
||||
atomic_read(&glink_info->tx_intent_ready));
|
||||
if (err) {
|
||||
diagfwd_write_buffer_done(glink_info->fwd_ctxt, buf);
|
||||
return -ERESTARTSYS;
|
||||
}
|
||||
|
||||
atomic_dec(&glink_info->tx_intent_ready);
|
||||
err = glink_tx(glink_info->hdl, glink_info, buf, len, tx_flags);
|
||||
if (!err) {
|
||||
DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s wrote to glink, len: %d\n",
|
||||
glink_info->name, len);
|
||||
}
|
||||
if (atomic_read(&glink_info->tx_intent_ready)) {
|
||||
atomic_dec(&glink_info->tx_intent_ready);
|
||||
err = glink_tx(glink_info->hdl, glink_info, buf, len, tx_flags);
|
||||
if (!err) {
|
||||
DIAG_LOG(DIAG_DEBUG_PERIPHERALS,
|
||||
"%s wrote to glink, len: %d\n",
|
||||
glink_info->name, len);
|
||||
}
|
||||
} else
|
||||
err = -ENOMEM;
|
||||
|
||||
return err;
|
||||
|
||||
|
|
|
@ -751,7 +751,9 @@ int diagfwd_write(uint8_t peripheral, uint8_t type, void *buf, int len)
|
|||
|
||||
if (!err)
|
||||
fwd_info->write_bytes += len;
|
||||
|
||||
else
|
||||
if (fwd_info->transport == TRANSPORT_GLINK)
|
||||
diagfwd_write_buffer_done(fwd_info, buf_ptr);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue