From 5dba3a3f9a7d94496f86be22d4182cc4156b7e80 Mon Sep 17 00:00:00 2001 From: Kiran Venkatappa Date: Wed, 1 Mar 2017 16:00:22 +0530 Subject: [PATCH] qcacmn: Fix init failure and DP detach crash Skip free of nbuf with physical address less than 0x50000000. This will ensure that same buffer is not getting allocated again resulting longer DP init time and affecting WMI init sequence. And use correct pointer in pdev detach function. Change-Id: Iaab70c92adef741d5f20115cba164bcd7718886b CRs-Fixed: 2013500 --- dp/wifi3.0/dp_main.c | 4 ++-- dp/wifi3.0/dp_rx.h | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index d516b565023c..cc689928b258 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -1150,7 +1150,6 @@ static inline void dp_reo_desc_freelist_destroy(struct dp_soc *soc) static void dp_soc_detach_wifi3(void *txrx_soc) { struct dp_soc *soc = (struct dp_soc *)txrx_soc; - struct dp_pdev *pdev = qdf_mem_malloc(sizeof(*pdev)); int i; soc->cmn_init_done = 0; @@ -1159,7 +1158,8 @@ static void dp_soc_detach_wifi3(void *txrx_soc) for (i = 0; i < MAX_PDEV_CNT; i++) { if (soc->pdev_list[i]) - dp_pdev_detach_wifi3((struct cdp_pdev *)pdev, 1); + dp_pdev_detach_wifi3( + (struct cdp_pdev *)soc->pdev_list[i], 1); } dp_peer_find_detach(soc); diff --git a/dp/wifi3.0/dp_rx.h b/dp/wifi3.0/dp_rx.h index e9e903d9db7f..ba9e40e2a353 100644 --- a/dp/wifi3.0/dp_rx.h +++ b/dp/wifi3.0/dp_rx.h @@ -255,7 +255,12 @@ static inline int check_x86_paddr(struct dp_soc *dp_soc, qdf_nbuf_t *rx_netbuf, if ((*rx_netbuf)) { qdf_nbuf_unmap_single(dp_soc->osdev, *rx_netbuf, QDF_DMA_BIDIRECTIONAL); - qdf_nbuf_free(*rx_netbuf); + /* Not freeing buffer intentionally. + * Observed that same buffer is getting + * re-allocated resulting in longer load time + * WMI init timeout. + * This buffer is anyway not useful so skip it. + **/ } *rx_netbuf = qdf_nbuf_alloc(pdev->osif_pdev,