diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2009-12-10 17:37:22 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-21 11:31:57 -0500 |
commit | f8701fe3aec24fcfb0dfa19aab47904611f96daf (patch) | |
tree | c6b415d666c7db75f3606467f3d8fbced1d73e43 /drivers/net/wireless/iwlwifi/iwl-eeprom.c | |
parent | 64a76b504b04b5da16d1e7658a95dd126594e02f (diff) |
iwlwifi: power up all devices for EEPROM read
Recent commits "iwlwifi: remove power-wasting calls to apm_ops.init()" and
"iwlagn: power up device before initializing EEPROM" had the goal of
reducing device power consumption from the time the module is loaded until
the interface is brought up and the device's power saving mechanisms kick
in. The idea is that once the module is loaded there is no need for the
device to consume power until the interface is brought up.
With the current solution the device is only powered up during EEPROM read,
and then so also only if the EEPROM type is OTP. We have found that on
certain platforms even non-OTP devices require power to be up during EEPROM
read. On these platforms the driver never loads and the system log contains
the following:
iwlagn 0000:03:00.0: MAC is in deep sleep!. CSR_GP_CNTRL = 0x080403D8
We thus now power up all devices during EEPROM read.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-eeprom.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-eeprom.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index 3946e5c03f81..72f0d77955cf 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c | |||
@@ -518,10 +518,7 @@ int iwl_eeprom_init(struct iwl_priv *priv) | |||
518 | } | 518 | } |
519 | e = (u16 *)priv->eeprom; | 519 | e = (u16 *)priv->eeprom; |
520 | 520 | ||
521 | if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) { | 521 | priv->cfg->ops->lib->apm_ops.init(priv); |
522 | /* OTP reads require powered-up chip */ | ||
523 | priv->cfg->ops->lib->apm_ops.init(priv); | ||
524 | } | ||
525 | 522 | ||
526 | ret = priv->cfg->ops->lib->eeprom_ops.verify_signature(priv); | 523 | ret = priv->cfg->ops->lib->eeprom_ops.verify_signature(priv); |
527 | if (ret < 0) { | 524 | if (ret < 0) { |
@@ -570,13 +567,6 @@ int iwl_eeprom_init(struct iwl_priv *priv) | |||
570 | e[cache_addr / 2] = eeprom_data; | 567 | e[cache_addr / 2] = eeprom_data; |
571 | cache_addr += sizeof(u16); | 568 | cache_addr += sizeof(u16); |
572 | } | 569 | } |
573 | |||
574 | /* | ||
575 | * Now that OTP reads are complete, reset chip to save | ||
576 | * power until we load uCode during "up". | ||
577 | */ | ||
578 | priv->cfg->ops->lib->apm_ops.stop(priv); | ||
579 | |||
580 | } else { | 570 | } else { |
581 | /* eeprom is an array of 16bit values */ | 571 | /* eeprom is an array of 16bit values */ |
582 | for (addr = 0; addr < sz; addr += sizeof(u16)) { | 572 | for (addr = 0; addr < sz; addr += sizeof(u16)) { |
@@ -603,6 +593,8 @@ done: | |||
603 | err: | 593 | err: |
604 | if (ret) | 594 | if (ret) |
605 | iwl_eeprom_free(priv); | 595 | iwl_eeprom_free(priv); |
596 | /* Reset chip to save power until we load uCode during "up". */ | ||
597 | priv->cfg->ops->lib->apm_ops.stop(priv); | ||
606 | alloc_err: | 598 | alloc_err: |
607 | return ret; | 599 | return ret; |
608 | } | 600 | } |