Return-path: Received: from charlotte.tuxdriver.com ([70.61.120.58]:47418 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751664AbYIBVPa (ORCPT ); Tue, 2 Sep 2008 17:15:30 -0400 Date: Tue, 2 Sep 2008 17:01:01 -0400 From: "John W. Linville" To: Zhu Yi Cc: linux-wireless@vger.kernel.org, Gregory Greenman , Mohamed Abbas , Tomas Winkler Subject: Re: [PATCH 08/11] iwlwifi: call apm stop on exit Message-ID: <20080902210101.GE3050@tuxdriver.com> (sfid-20080902_231537_781547_B3B8EE13) References: <1219915510-3647-1-git-send-email-yi.zhu@intel.com> <1219915510-3647-2-git-send-email-yi.zhu@intel.com> <1219915510-3647-3-git-send-email-yi.zhu@intel.com> <1219915510-3647-4-git-send-email-yi.zhu@intel.com> <1219915510-3647-5-git-send-email-yi.zhu@intel.com> <1219915510-3647-6-git-send-email-yi.zhu@intel.com> <1219915510-3647-7-git-send-email-yi.zhu@intel.com> <1219915510-3647-8-git-send-email-yi.zhu@intel.com> <1219915510-3647-9-git-send-email-yi.zhu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1219915510-3647-9-git-send-email-yi.zhu@intel.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Thu, Aug 28, 2008 at 05:25:07PM +0800, Zhu Yi wrote: > From: Gregory Greenman > > This patch calls apm stop on exit and suspend and sets STATUS_EXIT_PENDING > accordingly. Without this patch hardware consumes power even after driver > is removed or suspended. > > Signed-off-by: Gregory Greenman > Signed-off-by: Mohamed Abbas > Signed-off-by: Tomas Winkler > Signed-off-by: Zhu Yi The two hunks of this patch seem like two different fixes, and the changelog only matches the first hunk. When you resubmit this series (which I presume you will be doing with better changelogs after Marcel's commentary), please split this into two patches. Thanks, John > --- > drivers/net/wireless/iwlwifi/iwl-agn.c | 16 +++++++++++----- > 1 files changed, 11 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c > index 4986137..b1cefb5 100644 > --- a/drivers/net/wireless/iwlwifi/iwl-agn.c > +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c > @@ -2189,7 +2189,10 @@ static void __iwl4965_down(struct iwl_priv *priv) > udelay(5); > > /* FIXME: apm_ops.suspend(priv) */ > - priv->cfg->ops->lib->apm_ops.reset(priv); > + if (exit_pending || test_bit(STATUS_IN_SUSPEND, &priv->status)) > + priv->cfg->ops->lib->apm_ops.stop(priv); > + else > + priv->cfg->ops->lib->apm_ops.reset(priv); > priv->cfg->ops->lib->free_shared_mem(priv); > > exit: > @@ -4371,15 +4374,18 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev) > iwl_dbgfs_unregister(priv); > sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group); > > + /* ieee80211_unregister_hw call wil cause iwl4965_mac_stop to > + * to be called and iwl4965_down since we are removing the device > + * we need to set STATUS_EXIT_PENDING bit. > + */ > + set_bit(STATUS_EXIT_PENDING, &priv->status); > if (priv->mac80211_registered) { > ieee80211_unregister_hw(priv->hw); > priv->mac80211_registered = 0; > + } else { > + iwl4965_down(priv); > } > > - set_bit(STATUS_EXIT_PENDING, &priv->status); > - > - iwl4965_down(priv); > - > /* make sure we flush any pending irq or > * tasklet for the driver > */ > -- > 1.5.3.6 > > -- John W. Linville linville@tuxdriver.com