From: Niels Ole Salscheider Date: Mon, 24 Dec 2012 12:07:36 +0000 (+0100) Subject: brcmsmac: Use udelay instead of usleep_range X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7ffa592843c77b1f971a6d74d38d0000e6b18284;p=linux-beck.git brcmsmac: Use udelay instead of usleep_range wlc_lcnphy_rx_iq_cal_gain is called during initialization, i. e. when executing brcms_up. But brcms_up is called from brcms_ops_start while the latter holds a spin lock. Thus, we cannot use usleep_range but have to use udelay. This fixes: BUG: scheduling while atomic: NetworkManager/1652/0x00000200 [...] Call Trace: [] __schedule_bug+0x48/0x54 [] __schedule+0x596/0x6d0 [] schedule+0x29/0x70 [] schedule_hrtimeout_range_clock+0xfc/0x140 [] ? update_rmtp+0x70/0x70 [] schedule_hrtimeout_range+0x13/0x20 [] usleep_range+0x40/0x50 [] wlc_lcnphy_rx_iq_cal.constprop.10+0x59b/0xa90 [brcmsmac] [] wlc_lcnphy_periodic_cal+0x20e/0x220 [brcmsmac] [] ? wlc_lcnphy_set_tx_pwr_ctrl+0x21d/0x3c0 [brcmsmac] [] wlc_phy_init_lcnphy+0xacc/0x1100 [brcmsmac] [] ? wlc_phy_txpower_recalc_target_lcnphy+0x90/0x90 [brcmsmac] [] wlc_phy_init+0xcd/0x170 [brcmsmac] [] brcms_b_bsinit.isra.65+0x12e/0x310 [brcmsmac] [] brcms_c_init+0x8fb/0x1170 [brcmsmac] [] brcms_init+0x5a/0x70 [brcmsmac] [] brcms_c_up+0x1ac/0x4a0 [brcmsmac] [] brcms_up+0x25/0x30 [brcmsmac] [] brcms_ops_start+0xd0/0x100 [brcmsmac] [...] Signed-off-by: Niels Ole Salscheider Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c index 606b534347bc..21a824232478 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c @@ -1343,13 +1343,13 @@ static bool wlc_lcnphy_rx_iq_cal_gain(struct brcms_phy *pi, u16 biq1_gain, wlc_lcnphy_rx_gain_override_enable(pi, true); wlc_lcnphy_start_tx_tone(pi, 2000, (40 >> 1), 0); - usleep_range(500, 500); + udelay(500); write_radio_reg(pi, RADIO_2064_REG112, 0); if (!wlc_lcnphy_rx_iq_est(pi, 1024, 32, &iq_est_l)) return false; wlc_lcnphy_start_tx_tone(pi, 2000, 40, 0); - usleep_range(500, 500); + udelay(500); write_radio_reg(pi, RADIO_2064_REG112, 0); if (!wlc_lcnphy_rx_iq_est(pi, 1024, 32, &iq_est_h)) return false;