diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2008-07-15 11:44:21 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-29 16:36:29 -0400 |
commit | 3e4242b99ce46fed82aa7f40ad5a1817a2b3bd45 (patch) | |
tree | 556a4080d0a73ad90c4016cac8f20d5c61617fa3 /drivers | |
parent | e86600c7b4e9b9b22ba51620613d6159bf5cf504 (diff) |
Ath5k: suspend/resume fixes
- free and re-request irq since it might have changed during suspend
- disable and enable msi
- don't set D0 state of the device, it's already done by the PCI layer
- do restore_state before enable_device, it's safer
- check ath5k_init return value
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Cc: Luis R. Rodriguez <mcgrof@gmail.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 3aa22dc71651..7273e9f5c6d5 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -592,6 +592,9 @@ ath5k_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
592 | ath5k_led_off(sc); | 592 | ath5k_led_off(sc); |
593 | 593 | ||
594 | ath5k_stop_hw(sc); | 594 | ath5k_stop_hw(sc); |
595 | |||
596 | free_irq(pdev->irq, sc); | ||
597 | pci_disable_msi(pdev); | ||
595 | pci_save_state(pdev); | 598 | pci_save_state(pdev); |
596 | pci_disable_device(pdev); | 599 | pci_disable_device(pdev); |
597 | pci_set_power_state(pdev, PCI_D3hot); | 600 | pci_set_power_state(pdev, PCI_D3hot); |
@@ -607,15 +610,12 @@ ath5k_pci_resume(struct pci_dev *pdev) | |||
607 | struct ath5k_hw *ah = sc->ah; | 610 | struct ath5k_hw *ah = sc->ah; |
608 | int i, err; | 611 | int i, err; |
609 | 612 | ||
610 | err = pci_set_power_state(pdev, PCI_D0); | 613 | pci_restore_state(pdev); |
611 | if (err) | ||
612 | return err; | ||
613 | 614 | ||
614 | err = pci_enable_device(pdev); | 615 | err = pci_enable_device(pdev); |
615 | if (err) | 616 | if (err) |
616 | return err; | 617 | return err; |
617 | 618 | ||
618 | pci_restore_state(pdev); | ||
619 | /* | 619 | /* |
620 | * Suspend/Resume resets the PCI configuration space, so we have to | 620 | * Suspend/Resume resets the PCI configuration space, so we have to |
621 | * re-disable the RETRY_TIMEOUT register (0x41) to keep | 621 | * re-disable the RETRY_TIMEOUT register (0x41) to keep |
@@ -623,7 +623,17 @@ ath5k_pci_resume(struct pci_dev *pdev) | |||
623 | */ | 623 | */ |
624 | pci_write_config_byte(pdev, 0x41, 0); | 624 | pci_write_config_byte(pdev, 0x41, 0); |
625 | 625 | ||
626 | ath5k_init(sc); | 626 | pci_enable_msi(pdev); |
627 | |||
628 | err = request_irq(pdev->irq, ath5k_intr, IRQF_SHARED, "ath", sc); | ||
629 | if (err) { | ||
630 | ATH5K_ERR(sc, "request_irq failed\n"); | ||
631 | goto err_msi; | ||
632 | } | ||
633 | |||
634 | err = ath5k_init(sc); | ||
635 | if (err) | ||
636 | goto err_irq; | ||
627 | ath5k_led_enable(sc); | 637 | ath5k_led_enable(sc); |
628 | 638 | ||
629 | /* | 639 | /* |
@@ -637,6 +647,12 @@ ath5k_pci_resume(struct pci_dev *pdev) | |||
637 | ath5k_hw_reset_key(ah, i); | 647 | ath5k_hw_reset_key(ah, i); |
638 | 648 | ||
639 | return 0; | 649 | return 0; |
650 | err_irq: | ||
651 | free_irq(pdev->irq, sc); | ||
652 | err_msi: | ||
653 | pci_disable_msi(pdev); | ||
654 | pci_disable_device(pdev); | ||
655 | return err; | ||
640 | } | 656 | } |
641 | #endif /* CONFIG_PM */ | 657 | #endif /* CONFIG_PM */ |
642 | 658 | ||