This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 11a8423  drivers: wireless: Fix ASSERT() in _read_data_len() in 
gs2200m.c
11a8423 is described below

commit 11a842333f0514b17dbdaed5f5df0fee8f5cdaab
Author: Masayuki Ishikawa <masayuki.ishik...@gmail.com>
AuthorDate: Mon Jan 18 10:36:51 2021 +0900

    drivers: wireless: Fix ASSERT() in _read_data_len() in gs2200m.c
    
    Summary:
    - During stress test with spresense:wifi (non-SMP), I noticed
      sometimes ASSERT() happened in _read_data_len()
    - Actually, up_udelay(50) has been added to avoid the ASSERT
    - However, I finally noticed that it should be moved before
      calling dready()
    - Also, I cofirmed that we can reduced the time from 50 to 30
    - NOTE: we need at least 15us in my experience
    
    Impact:
    - gs2200m.c only
    
    Testing:
    - Tested with following configurations
    - spresense:wifi, spresense:wifi_smp, stm32f4discovery:wifi
    
    Signed-off-by: Masayuki Ishikawa <masayuki.ishik...@jp.sony.com>
---
 drivers/wireless/gs2200m.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/wireless/gs2200m.c b/drivers/wireless/gs2200m.c
index d757888..ac9c597 100644
--- a/drivers/wireless/gs2200m.c
+++ b/drivers/wireless/gs2200m.c
@@ -865,6 +865,12 @@ retry:
 
   _write_data(dev, hdr, sizeof(hdr));
 
+  /* NOTE: busy wait 30us
+   * workaround to avoid an invalid frame response
+   */
+
+  up_udelay(30);
+
   /* Wait for data ready */
 
   while (!dev->lower->dready(NULL))
@@ -872,12 +878,6 @@ retry:
       /* TODO: timeout */
     }
 
-  /* NOTE: busy wait 50us
-   * workaround to avoid an invalid frame response
-   */
-
-  up_udelay(50);
-
   /* Read frame response */
 
   _read_data(dev, res, sizeof(res));

Reply via email to