[PATCH] wcn36xx: Wait longer for SMD commands to complete

Eugene Krasnikov k.eugene.e at gmail.com
Fri Dec 13 11:00:07 EST 2013


Looks good to me, thanx!

On 13 декабря 2013 г., 8:38, Pontus Fuchs <pontus.fuchs at gmail.com> wrote:
> On some wcnss firmwares the start command can take up to 300ms to
> complete. Currently there is a 200ms timeout for SMD command to
> complete which causes the start to fail.
>
> Increase the timeout to 500ms. Also improve debug information
> regarding SMD command completion time.
>
> Signed-off-by: Pontus Fuchs <pontus.fuchs at gmail.com>
> ---
>  smd.c | 7 ++++++-
>  smd.h | 2 +-
>  2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/smd.c b/smd.c
> index 36b8f03..b662617 100644
> --- a/smd.c
> +++ b/smd.c
> @@ -196,9 +196,11 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
>  static int wcn36xx_smd_send_and_wait(struct wcn36xx *wcn, size_t len)
>  {
>         int ret = 0;
> +       unsigned long start;
>         wcn36xx_dbg_dump(WCN36XX_DBG_SMD_DUMP, "HAL >>> ", wcn->hal_buf, len);
>
>         init_completion(&wcn->hal_rsp_compl);
> +       start = jiffies;
>         ret = wcn->ctrl_ops->tx(wcn->hal_buf, len);
>         if (ret) {
>                 wcn36xx_err("HAL TX failed\n");
> @@ -206,10 +208,13 @@ static int wcn36xx_smd_send_and_wait(struct wcn36xx *wcn, size_t len)
>         }
>         if (wait_for_completion_timeout(&wcn->hal_rsp_compl,
>                 msecs_to_jiffies(HAL_MSG_TIMEOUT)) <= 0) {
> -               wcn36xx_err("Timeout while waiting SMD response\n");
> +               wcn36xx_err("Timeout! No SMD response in %dms\n",
> +                           HAL_MSG_TIMEOUT);
>                 ret = -ETIME;
>                 goto out;
>         }
> +       wcn36xx_dbg(WCN36XX_DBG_SMD, "SMD command completed in %dms",
> +                   jiffies_to_msecs(jiffies - start));
>  out:
>         return ret;
>  }
> diff --git a/smd.h b/smd.h
> index cba3a96..751b62b 100644
> --- a/smd.h
> +++ b/smd.h
> @@ -25,7 +25,7 @@
>
>  #define WCN36XX_HAL_BUF_SIZE                           4096
>
> -#define HAL_MSG_TIMEOUT 200
> +#define HAL_MSG_TIMEOUT 500
>  #define WCN36XX_SMSM_WLAN_TX_ENABLE                    0x00000400
>  #define WCN36XX_SMSM_WLAN_TX_RINGS_EMPTY               0x00000200
>  /* The PNO version info be contained in the rsp msg */
> --
> 1.8.3.2
>
>
> _______________________________________________
> wcn36xx mailing list
> wcn36xx at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/wcn36xx



-- 
Best regards,
Eugene



More information about the wcn36xx mailing list