diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-10-13 05:47:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:09 -0400 |
commit | eb5b28d021a1b96050f7af46e9140eb0051cc6d8 (patch) | |
tree | 41cc26ab8f47c7bf465be648e736702b7007eb1d /drivers/net/wireless/wl12xx/wl1271_main.c | |
parent | 8a08048a3722a6b52c2b34e070c4e6a32ad19e0d (diff) |
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: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_main.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index eba38dff871b..7f1093cd816c 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -625,7 +625,7 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) | |||
625 | 625 | ||
626 | ret = wl1271_setup(wl); | 626 | ret = wl1271_setup(wl); |
627 | if (ret < 0) | 627 | if (ret < 0) |
628 | goto out; | 628 | goto out_power_off; |
629 | break; | 629 | break; |
630 | case CHIP_ID_1271_PG20: | 630 | case CHIP_ID_1271_PG20: |
631 | wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", | 631 | wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", |
@@ -633,27 +633,32 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) | |||
633 | 633 | ||
634 | ret = wl1271_setup(wl); | 634 | ret = wl1271_setup(wl); |
635 | if (ret < 0) | 635 | if (ret < 0) |
636 | goto out; | 636 | goto out_power_off; |
637 | break; | 637 | break; |
638 | default: | 638 | default: |
639 | wl1271_error("unsupported chip id: 0x%x", wl->chip.id); | 639 | wl1271_error("unsupported chip id: 0x%x", wl->chip.id); |
640 | ret = -ENODEV; | 640 | ret = -ENODEV; |
641 | goto out; | 641 | goto out_power_off; |
642 | } | 642 | } |
643 | 643 | ||
644 | if (wl->fw == NULL) { | 644 | if (wl->fw == NULL) { |
645 | ret = wl1271_fetch_firmware(wl); | 645 | ret = wl1271_fetch_firmware(wl); |
646 | if (ret < 0) | 646 | if (ret < 0) |
647 | goto out; | 647 | goto out_power_off; |
648 | } | 648 | } |
649 | 649 | ||
650 | /* No NVS from netlink, try to get it from the filesystem */ | 650 | /* No NVS from netlink, try to get it from the filesystem */ |
651 | if (wl->nvs == NULL) { | 651 | if (wl->nvs == NULL) { |
652 | ret = wl1271_fetch_nvs(wl); | 652 | ret = wl1271_fetch_nvs(wl); |
653 | if (ret < 0) | 653 | if (ret < 0) |
654 | goto out; | 654 | goto out_power_off; |
655 | } | 655 | } |
656 | 656 | ||
657 | goto out; | ||
658 | |||
659 | out_power_off: | ||
660 | wl1271_power_off(wl); | ||
661 | |||
657 | out: | 662 | out: |
658 | return ret; | 663 | return ret; |
659 | } | 664 | } |
@@ -749,13 +754,21 @@ int wl1271_plt_start(struct wl1271 *wl) | |||
749 | 754 | ||
750 | ret = wl1271_boot(wl); | 755 | ret = wl1271_boot(wl); |
751 | if (ret < 0) | 756 | if (ret < 0) |
752 | goto out; | 757 | goto out_power_off; |
753 | 758 | ||
754 | wl1271_notice("firmware booted in PLT mode (%s)", wl->chip.fw_ver); | 759 | wl1271_notice("firmware booted in PLT mode (%s)", wl->chip.fw_ver); |
755 | 760 | ||
756 | ret = wl1271_plt_init(wl); | 761 | ret = wl1271_plt_init(wl); |
757 | if (ret < 0) | 762 | if (ret < 0) |
758 | goto out; | 763 | goto out_irq_disable; |
764 | |||
765 | goto out; | ||
766 | |||
767 | out_irq_disable: | ||
768 | wl1271_disable_interrupts(wl); | ||
769 | |||
770 | out_power_off: | ||
771 | wl1271_power_off(wl); | ||
759 | 772 | ||
760 | out: | 773 | out: |
761 | mutex_unlock(&wl->mutex); | 774 | mutex_unlock(&wl->mutex); |
@@ -843,20 +856,25 @@ static int wl1271_op_start(struct ieee80211_hw *hw) | |||
843 | 856 | ||
844 | ret = wl1271_boot(wl); | 857 | ret = wl1271_boot(wl); |
845 | if (ret < 0) | 858 | if (ret < 0) |
846 | goto out; | 859 | goto out_power_off; |
847 | 860 | ||
848 | ret = wl1271_hw_init(wl); | 861 | ret = wl1271_hw_init(wl); |
849 | if (ret < 0) | 862 | if (ret < 0) |
850 | goto out; | 863 | goto out_irq_disable; |
851 | 864 | ||
852 | wl->state = WL1271_STATE_ON; | 865 | wl->state = WL1271_STATE_ON; |
853 | 866 | ||
854 | wl1271_info("firmware booted (%s)", wl->chip.fw_ver); | 867 | wl1271_info("firmware booted (%s)", wl->chip.fw_ver); |
855 | 868 | ||
856 | out: | 869 | goto out; |
857 | if (ret < 0) | 870 | |
858 | wl1271_power_off(wl); | 871 | out_irq_disable: |
872 | wl1271_disable_interrupts(wl); | ||
859 | 873 | ||
874 | out_power_off: | ||
875 | wl1271_power_off(wl); | ||
876 | |||
877 | out: | ||
860 | mutex_unlock(&wl->mutex); | 878 | mutex_unlock(&wl->mutex); |
861 | 879 | ||
862 | return ret; | 880 | return ret; |