From be594252bc10a3831395516a36c748e1aeacf118 Mon Sep 17 00:00:00 2001 From: Reinette Chatre Date: Tue, 10 Feb 2009 12:02:49 -0800 Subject: [PATCH] --- yaml --- r: 131314 b: refs/heads/master c: 89c581b3fb2986e303f1299e6458e3e9b115fa3f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/iwlwifi/iwl-agn.c | 15 +++++++++++++-- trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c | 15 +++++++++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 53dbd614c6f1..f9a5b21cd952 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: efb43f4b2ccf8066abc3920a0e6858e4350a65c7 +refs/heads/master: 89c581b3fb2986e303f1299e6458e3e9b115fa3f diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-agn.c b/trunk/drivers/net/wireless/iwlwifi/iwl-agn.c index c01ea48da5fe..36bafeb353ce 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-agn.c @@ -4042,7 +4042,19 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) priv->is_open = 1; } - pci_save_state(pdev); + /* pci driver assumes state will be saved in this function. + * pci state is saved and device disabled when interface is + * stopped, so at this time pci device will always be disabled - + * whether interface was started or not. saving pci state now will + * cause saved state be that of a disabled device, which will cause + * problems during resume in that we will end up with a disabled device. + * + * indicate that the current saved state (from when interface was + * stopped) is valid. if interface was never up at time of suspend + * then the saved state will still be valid as it was saved during + * .probe. */ + pdev->state_saved = true; + pci_set_power_state(pdev, PCI_D3hot); return 0; @@ -4053,7 +4065,6 @@ static int iwl_pci_resume(struct pci_dev *pdev) struct iwl_priv *priv = pci_get_drvdata(pdev); pci_set_power_state(pdev, PCI_D0); - pci_restore_state(pdev); if (priv->is_open) iwl_mac_start(priv->hw); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c b/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c index 5b44d322b99f..93be74a1f139 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -8143,7 +8143,19 @@ static int iwl3945_pci_suspend(struct pci_dev *pdev, pm_message_t state) priv->is_open = 1; } - pci_save_state(pdev); + /* pci driver assumes state will be saved in this function. + * pci state is saved and device disabled when interface is + * stopped, so at this time pci device will always be disabled - + * whether interface was started or not. saving pci state now will + * cause saved state be that of a disabled device, which will cause + * problems during resume in that we will end up with a disabled device. + * + * indicate that the current saved state (from when interface was + * stopped) is valid. if interface was never up at time of suspend + * then the saved state will still be valid as it was saved during + * .probe. */ + pdev->state_saved = true; + pci_set_power_state(pdev, PCI_D3hot); return 0; @@ -8154,7 +8166,6 @@ static int iwl3945_pci_resume(struct pci_dev *pdev) struct iwl3945_priv *priv = pci_get_drvdata(pdev); pci_set_power_state(pdev, PCI_D0); - pci_restore_state(pdev); if (priv->is_open) iwl3945_mac_start(priv->hw);