Ticket #11704: 888-retry-mac-reset.patch

File 888-retry-mac-reset.patch, 1.0 KB (added by socram8888@…, 6 years ago)

The patch

  • drivers/net/wireless/ath/ath5k/reset.c

    a b  
    732732                ret = ath5k_hw_nic_reset(ah, 0); 
    733733 
    734734        if (ret) { 
    735                 ATH5K_ERR(ah, "failed to warm reset the MAC Chip\n"); 
    736                 return -EIO; 
     735                ATH5K_ERR(ah, "failed to warm reset the MAC Chip on first attempt (return: %d). Retrying...\n", ret); 
     736 
     737                if (ath5k_get_bus_type(ah) == ATH_AHB) 
     738                        ret = ath5k_hw_wisoc_reset(ah, 0); 
     739                else 
     740                        ret = ath5k_hw_nic_reset(ah, 0); 
     741 
     742                if (ret) { 
     743                        ATH5K_ERR(ah, "second attempt failed too (return: %d). Give up\n", ret); 
     744                        return -EIO; 
     745                } 
    737746        } 
     747        ATH5K_ERR(ah, "MAC Chip reset OK!\n"); 
    738748 
    739749        /* On initialization skip PLL programming since we don't have 
    740750         * a channel / mode set yet */ 
    741         if (!channel) 
     751        if (!channel) { 
     752        ATH5K_ERR(ah, "ath5k_hw_nic_wakeup ERROR (NO CHANNEL)"); 
    742753                return 0; 
     754        } 
    743755 
    744756        if (ah->ah_version != AR5K_AR5210) { 
    745757                /* 
     
    827839                ath5k_hw_reg_write(ah, turbo, AR5K_PHY_TURBO); 
    828840        } 
    829841 
     842        ATH5K_ERR(ah, "ath5k_hw_nic_wakeup finished"); 
     843 
    830844        return 0; 
    831845} 
    832846