diff options
author | Jizhou Liao <Jizhou.Liao@nxp.com> | 2016-05-31 10:21:02 -0700 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2016-07-20 10:18:31 +0200 |
commit | 0e3eeae5ec8d7ea910407b81e2ba52abc9b84257 (patch) | |
tree | 81ec561899ea3c56881044680bcf20d0feaed337 | |
parent | e1e11dc29f1a81d3039c0cfd395d3a1289fc2559 (diff) | |
download | libnfc-nci-0e3eeae5ec8d7ea910407b81e2ba52abc9b84257.tar.gz |
Fix the syncronization issue between read thread and write threadandroid-cts_7.1_r1android-cts-7.1_r3android-cts-7.1_r2android-cts-7.1_r1android-7.1.1_r9android-7.1.1_r8android-7.1.1_r7android-7.1.1_r6android-7.1.1_r4android-7.1.1_r3android-7.1.1_r22android-7.1.1_r21android-7.1.1_r20android-7.1.1_r2android-7.1.1_r17android-7.1.1_r16android-7.1.1_r15android-7.1.1_r14android-7.1.1_r13android-7.1.1_r12android-7.1.1_r11android-7.1.1_r10android-7.1.1_r1nougat-mr1.2-releasenougat-mr1-dev
NFC stack hang if Read Interrupt is notified even before
the write callback is notified. Add 2ms delay to give priority to
write thread if it is busy.
Bug: 30240780
Change-Id: I732fd3c5412276d12f84103562997182b0e77aa1
-rw-r--r-- | halimpl/pn54x/tml/phTmlNfc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/halimpl/pn54x/tml/phTmlNfc.c b/halimpl/pn54x/tml/phTmlNfc.c index e50b49e..3d402df 100644 --- a/halimpl/pn54x/tml/phTmlNfc.c +++ b/halimpl/pn54x/tml/phTmlNfc.c @@ -394,6 +394,11 @@ static void phTmlNfc_TmlThread(void *pParam) gpphTmlNfc_Context->bWriteCbInvoked = FALSE; } } + if (gpphTmlNfc_Context->tWriteInfo.bThreadBusy) + { + NXPLOG_TML_D ("Delay Read if write thread is busy"); + usleep (2000); /*2ms delay to give prio to write complete */ + } /* Update the actual number of bytes read including header */ gpphTmlNfc_Context->tReadInfo.wLength = (uint16_t) (dwNoBytesWrRd); phNxpNciHal_print_packet("RECV", gpphTmlNfc_Context->tReadInfo.pBuffer, |