Commit eb5b28d0 authored by Juuso Oikarinen's avatar Juuso Oikarinen Committed by John W. Linville

wl1271: Fix IRQ enable handling on FW init failure

Disable IRQ's after FW initialization failure - originally this was not
done in all cases, and it resulted in a kernel warning if firmware
initialization was tried again without reboot.
Signed-off-by: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8a08048a
...@@ -400,9 +400,6 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl) ...@@ -400,9 +400,6 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl)
* ready to receive event from the command mailbox * ready to receive event from the command mailbox
*/ */
/* enable gpio interrupts */
wl1271_boot_enable_interrupts(wl);
/* unmask required mbox events */ /* unmask required mbox events */
wl->event_mask = BSS_LOSE_EVENT_ID | wl->event_mask = BSS_LOSE_EVENT_ID |
SCAN_COMPLETE_EVENT_ID; SCAN_COMPLETE_EVENT_ID;
...@@ -540,6 +537,9 @@ int wl1271_boot(struct wl1271 *wl) ...@@ -540,6 +537,9 @@ int wl1271_boot(struct wl1271 *wl)
if (ret < 0) if (ret < 0)
goto out; goto out;
/* Enable firmware interrupts now */
wl1271_boot_enable_interrupts(wl);
/* set the wl1271 default filters */ /* set the wl1271 default filters */
wl->rx_config = WL1271_DEFAULT_RX_CONFIG; wl->rx_config = WL1271_DEFAULT_RX_CONFIG;
wl->rx_filter = WL1271_DEFAULT_RX_FILTER; wl->rx_filter = WL1271_DEFAULT_RX_FILTER;
......
...@@ -315,8 +315,8 @@ int wl1271_hw_init(struct wl1271 *wl) ...@@ -315,8 +315,8 @@ int wl1271_hw_init(struct wl1271 *wl)
/* RX config */ /* RX config */
ret = wl1271_init_rx_config(wl, ret = wl1271_init_rx_config(wl,
RX_CFG_PROMISCUOUS | RX_CFG_TSF, RX_CFG_PROMISCUOUS | RX_CFG_TSF,
RX_FILTER_OPTION_DEF); RX_FILTER_OPTION_DEF);
/* RX_CONFIG_OPTION_ANY_DST_ANY_BSS, /* RX_CONFIG_OPTION_ANY_DST_ANY_BSS,
RX_FILTER_OPTION_FILTER_ALL); */ RX_FILTER_OPTION_FILTER_ALL); */
if (ret < 0) if (ret < 0)
......
...@@ -625,7 +625,7 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) ...@@ -625,7 +625,7 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
ret = wl1271_setup(wl); ret = wl1271_setup(wl);
if (ret < 0) if (ret < 0)
goto out; goto out_power_off;
break; break;
case CHIP_ID_1271_PG20: case CHIP_ID_1271_PG20:
wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)",
...@@ -633,27 +633,32 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) ...@@ -633,27 +633,32 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
ret = wl1271_setup(wl); ret = wl1271_setup(wl);
if (ret < 0) if (ret < 0)
goto out; goto out_power_off;
break; break;
default: default:
wl1271_error("unsupported chip id: 0x%x", wl->chip.id); wl1271_error("unsupported chip id: 0x%x", wl->chip.id);
ret = -ENODEV; ret = -ENODEV;
goto out; goto out_power_off;
} }
if (wl->fw == NULL) { if (wl->fw == NULL) {
ret = wl1271_fetch_firmware(wl); ret = wl1271_fetch_firmware(wl);
if (ret < 0) if (ret < 0)
goto out; goto out_power_off;
} }
/* No NVS from netlink, try to get it from the filesystem */ /* No NVS from netlink, try to get it from the filesystem */
if (wl->nvs == NULL) { if (wl->nvs == NULL) {
ret = wl1271_fetch_nvs(wl); ret = wl1271_fetch_nvs(wl);
if (ret < 0) if (ret < 0)
goto out; goto out_power_off;
} }
goto out;
out_power_off:
wl1271_power_off(wl);
out: out:
return ret; return ret;
} }
...@@ -749,13 +754,21 @@ int wl1271_plt_start(struct wl1271 *wl) ...@@ -749,13 +754,21 @@ int wl1271_plt_start(struct wl1271 *wl)
ret = wl1271_boot(wl); ret = wl1271_boot(wl);
if (ret < 0) if (ret < 0)
goto out; goto out_power_off;
wl1271_notice("firmware booted in PLT mode (%s)", wl->chip.fw_ver); wl1271_notice("firmware booted in PLT mode (%s)", wl->chip.fw_ver);
ret = wl1271_plt_init(wl); ret = wl1271_plt_init(wl);
if (ret < 0) if (ret < 0)
goto out; goto out_irq_disable;
goto out;
out_irq_disable:
wl1271_disable_interrupts(wl);
out_power_off:
wl1271_power_off(wl);
out: out:
mutex_unlock(&wl->mutex); mutex_unlock(&wl->mutex);
...@@ -843,20 +856,25 @@ static int wl1271_op_start(struct ieee80211_hw *hw) ...@@ -843,20 +856,25 @@ static int wl1271_op_start(struct ieee80211_hw *hw)
ret = wl1271_boot(wl); ret = wl1271_boot(wl);
if (ret < 0) if (ret < 0)
goto out; goto out_power_off;
ret = wl1271_hw_init(wl); ret = wl1271_hw_init(wl);
if (ret < 0) if (ret < 0)
goto out; goto out_irq_disable;
wl->state = WL1271_STATE_ON; wl->state = WL1271_STATE_ON;
wl1271_info("firmware booted (%s)", wl->chip.fw_ver); wl1271_info("firmware booted (%s)", wl->chip.fw_ver);
out: goto out;
if (ret < 0)
wl1271_power_off(wl); out_irq_disable:
wl1271_disable_interrupts(wl);
out_power_off:
wl1271_power_off(wl);
out:
mutex_unlock(&wl->mutex); mutex_unlock(&wl->mutex);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment