source: branches/chaos_calmer/package/kernel/mac80211/patches/351-0038-brcmfmac-sdio-shorten-retry-loop-in-brcmf_sdio_kso_c.patch @ 49407

Last change on this file since 49407 was 49407, checked in by rmilecki, 12 months ago

mac80211: brcmfmac: backport changes from 2016-09-27

This fixes memory leaks, some possible crashes and bug that could cause
WARNING on every add_key/del_key call. It also replaces WARNING with
a simple message. They may still occur e.g. on station going out of
range and A-MPDU stall in the firmware.

Signed-off-by: Rafał Miłecki <rafal@…>

File size: 2.0 KB
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

    From 5251b6be8bb5c5675bdf12347c7b83937a5c91e5 Mon Sep 17 00:00:00 2001
    From: Arend Van Spriel <arend.vanspriel@broadcom.com>
    Date: Mon, 5 Sep 2016 11:42:13 +0100
    Subject: [PATCH] brcmfmac: sdio: shorten retry loop in
     brcmf_sdio_kso_control()
    
    In brcmf_sdio_kso_control() there is a retry loop as hardware may take
    time to settle. However, when the call to brcmf_sdiod_regrb() returns
    an error it is due to SDIO access failure and it makes no sense to wait
    for hardware to settle. This patch aborts the loop after a number of
    subsequent access errors.
    
    Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
    Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
    Reviewed-by: Franky Lin <franky.lin@broadcom.com>
    Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    ---
     drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 11 +++++++++--
     1 file changed, 9 insertions(+), 2 deletions(-)
    
    a b struct rte_console { 
    313313 
    314314#define KSO_WAIT_US 50 
    315315#define MAX_KSO_ATTEMPTS (PMU_MAX_TRANSITION_DLY/KSO_WAIT_US) 
     316#define BRCMF_SDIO_MAX_ACCESS_ERRORS    5 
    316317 
    317318/* 
    318319 * Conversion of 802.1D priority to precedence level 
    brcmf_sdio_kso_control(struct brcmf_sdio 
    675676{ 
    676677        u8 wr_val = 0, rd_val, cmp_val, bmask; 
    677678        int err = 0; 
     679        int err_cnt = 0; 
    678680        int try_cnt = 0; 
    679681 
    680682        brcmf_dbg(TRACE, "Enter: on=%d\n", on); 
    brcmf_sdio_kso_control(struct brcmf_sdio 
    710712                 */ 
    711713                rd_val = brcmf_sdiod_regrb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, 
    712714                                           &err); 
    713                 if (((rd_val & bmask) == cmp_val) && !err) 
     715                if (!err) { 
     716                        if ((rd_val & bmask) == cmp_val) 
     717                                break; 
     718                        err_cnt = 0; 
     719                } 
     720                /* bail out upon subsequent access errors */ 
     721                if (err && (err_cnt++ > BRCMF_SDIO_MAX_ACCESS_ERRORS)) 
    714722                        break; 
    715  
    716723                udelay(KSO_WAIT_US); 
    717724                brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, 
    718725                                  wr_val, &err); 
Note: See TracBrowser for help on using the repository browser.