mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
msm: mhi_dev: Avoiding delay in transfer completion
When size of user client buffer is smaller than the size of data read, client calls the mhi_uci_client_read API for the second time with the remaining bytes of data to be copied. In this, data is already read from host but copying to client buffer is pending. With the current logic device waits for read_wq and then eventually exits as there is no data to read from host. This is causing a delay in the transfer completion in the case where user client buffer is less than data read from host. To avoid this delay, entering the loop to read data from host only if it is a new transfer. For old transfers, as read from host is already done, waiting for read_wq is avoided with this change. Change-Id: I75b6f6e3673cf5c05693579acaddf189b5478926 Signed-off-by: Sai Chaitanya Kaveti <quic_skaveti@quicinc.com>
This commit is contained in:
parent
70e9561de3
commit
3baa0daae9
1 changed files with 2 additions and 2 deletions
|
|
@ -1327,7 +1327,7 @@ static int __mhi_uci_client_read(struct uci_client *uci_handle,
|
|||
{
|
||||
int ret_val = 0;
|
||||
|
||||
do {
|
||||
while (!uci_handle->pkt_loc) {
|
||||
if (!mhi_uci_are_channels_connected(uci_handle)) {
|
||||
uci_log(UCI_DBG_ERROR, "Channels are not connected\n");
|
||||
return -ENODEV;
|
||||
|
|
@ -1371,7 +1371,7 @@ static int __mhi_uci_client_read(struct uci_client *uci_handle,
|
|||
uci_handle->in_chan);
|
||||
break;
|
||||
}
|
||||
} while (!uci_handle->pkt_loc);
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue