From: Reinette Chatre <reinette.chatre@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
ipw3945-devel@lists.sourceforge.net,
Reinette Chatre <reinette.chatre@intel.com>
Subject: [PATCH 10/16] iwlagn: power up device before initializing EEPROM
Date: Fri, 13 Nov 2009 11:56:32 -0800 [thread overview]
Message-ID: <1258142198-3223-11-git-send-email-reinette.chatre@intel.com> (raw)
In-Reply-To: <1258142198-3223-1-git-send-email-reinette.chatre@intel.com>
From: Reinette Chatre <reinette.chatre@intel.com>
A recent change optimized the power usage by the device by only powering it
up during EEPROM load if it is required (for OTP devices). This change causes
an error on the 1000 series devices during module load.
The error looks as follows:
[ 1624.024524] iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, 1.3.27kds
[ 1624.024527] iwlagn: Copyright(c) 2003-2009 Intel Corporation
[ 1624.024711] iwlagn 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 1624.024749] iwlagn 0000:01:00.0: setting latency timer to 64
[ 1624.024909] iwlagn 0000:01:00.0: Detected Intel Wireless WiFi Link 1000 Series BGN REV=0x6C
[ 1624.081263] iwlagn 0000:01:00.0: MAC is in deep sleep!. CSR_GP_CNTRL = 0x080003D8
[ 1624.092967] iwlagn 0000:01:00.0: OTP is empty
[ 1624.092988] iwlagn 0000:01:00.0: Unable to init EEPROM
[ 1624.093033] iwlagn 0000:01:00.0: PCI INT A disabled
[ 1624.093065] iwlagn: probe of 0000:01:00.0 failed with error -2
Adding a dump_stack() to where that error is printed shows the following:
[ 1624.024524] iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, 1.3.27kds
[ 1624.024527] iwlagn: Copyright(c) 2003-2009 Intel Corporation
[ 1624.024711] iwlagn 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 1624.024749] iwlagn 0000:01:00.0: setting latency timer to 64
[ 1624.024909] iwlagn 0000:01:00.0: Detected Intel Wireless WiFi Link 1000 Series BGN REV=0x6C
[ 1624.081263] iwlagn 0000:01:00.0: MAC is in deep sleep!. CSR_GP_CNTRL = 0x080003D8
[ 1624.081263] Pid: 3073, comm: work_for_cpu Tainted: G W 2.6.31.5 #4
[ 1624.081263] Call Trace:
[ 1624.081263] [<ffffffffa02395db>] T.726+0x22b/0x420 [iwlcore]
[ 1624.081263] [<ffffffffa023985a>] iwlcore_eeprom_acquire_semaphore+0x8a/0x190 [iwlcore]
[ 1624.081263] [<ffffffff81110c94>] ? __kmalloc+0x194/0x1c0
[ 1624.081263] [<ffffffffa02391f5>] ? iwlcore_eeprom_verify_signature+0x25/0xf0 [iwlcore]
[ 1624.081263] [<ffffffffa0239c67>] iwl_eeprom_init+0x107/0xf40 [iwlcore]
[ 1624.081263] [<ffffffffa026ab9c>] ? iwl_prepare_card_hw+0x11c/0x470 [iwlagn]
[ 1624.081263] [<ffffffff8127e2a4>] ? pci_bus_write_config_byte+0x64/0x80
[ 1624.081263] [<ffffffffa026b1f8>] iwl_pci_probe+0x308/0xac0 [iwlagn]
[ 1624.081263] [<ffffffff810710a0>] ? do_work_for_cpu+0x0/0x30
[ 1624.081263] [<ffffffff81284912>] local_pci_probe+0x12/0x20
[ 1624.081263] [<ffffffff810710b3>] do_work_for_cpu+0x13/0x30
[ 1624.081263] [<ffffffff81075826>] kthread+0xa6/0xb0
[ 1624.081263] [<ffffffff81012fea>] child_rip+0xa/0x20
[ 1624.081263] [<ffffffff81075780>] ? kthread+0x0/0xb0
[ 1624.081263] [<ffffffff81012fe0>] ? child_rip+0x0/0x20
[ 1624.092967] iwlagn 0000:01:00.0: OTP is empty
[ 1624.092988] iwlagn 0000:01:00.0: Unable to init EEPROM
[ 1624.093033] iwlagn 0000:01:00.0: PCI INT A disabled
[ 1624.093065] iwlagn: probe of 0000:01:00.0 failed with error -2
We know that the routines in this trace, iwlcore_eeprom_acquire_semaphore
and iwlcore_eeprom_verify_signature, only access CSR registers and thus do
not need the device to be awake if it is EEPROM. But for OTP it is required
for the device to be awake to read these registers. Ensure device is awake
before accessing these registers.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Ben Cahill <ben.m.cahill@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-eeprom.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index ac88ff0..3946e5c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -518,6 +518,11 @@ int iwl_eeprom_init(struct iwl_priv *priv)
}
e = (u16 *)priv->eeprom;
+ if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) {
+ /* OTP reads require powered-up chip */
+ priv->cfg->ops->lib->apm_ops.init(priv);
+ }
+
ret = priv->cfg->ops->lib->eeprom_ops.verify_signature(priv);
if (ret < 0) {
IWL_ERR(priv, "EEPROM not found, EEPROM_GP=0x%08x\n", gp);
@@ -532,10 +537,8 @@ int iwl_eeprom_init(struct iwl_priv *priv)
ret = -ENOENT;
goto err;
}
- if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) {
- /* OTP reads require powered-up chip */
- priv->cfg->ops->lib->apm_ops.init(priv);
+ if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) {
ret = iwl_init_otp_access(priv);
if (ret) {
--
1.5.6.3
next prev parent reply other threads:[~2009-11-13 19:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 19:56 [PATCH 00/16] iwlwifi updates 11/13/2009 Reinette Chatre
2009-11-13 19:56 ` [PATCH 01/16] iwlwifi: validate enhanced tx power entry Reinette Chatre
2009-11-13 19:56 ` [PATCH 02/16] iwlwifi: disable coex until implementation ready for 6x50 Reinette Chatre
2009-11-13 19:56 ` [PATCH 03/16] iwlwifi: remove unused parameter from iwl_channel_info Reinette Chatre
2009-11-13 19:56 ` [PATCH 04/16] iwlwifi: drop non-production PCI-IDs for 6x50 series Reinette Chatre
2009-11-14 15:26 ` Gábor Stefanik
2009-11-16 14:24 ` Guy, Wey-Yi
2009-11-13 19:56 ` [PATCH 05/16] iwlwifi: remove external reference for non-exist data structure Reinette Chatre
2009-11-13 19:56 ` [PATCH 06/16] iwlwifi: update reply_statistics_cmd with 'clear' parameter Reinette Chatre
2009-11-13 19:56 ` [PATCH 07/16] iwl3945: Reset saved POWER_TABLE_CMD in "up" Reinette Chatre
2009-11-13 19:56 ` [PATCH 08/16] iwlwifi: eliminate the possible 1/2 dBm tx power loss in 6x00 & 6x50 series Reinette Chatre
2009-11-13 19:56 ` [PATCH 09/16] iwlwifi: align tx/rx statistics debugfs format Reinette Chatre
2009-11-13 19:56 ` Reinette Chatre [this message]
2009-11-13 19:56 ` [PATCH 11/16] iwlwifi: fix bugs in beacon configuration Reinette Chatre
2009-11-13 19:56 ` [PATCH 12/16] iwlwifi: make iwlwifi send beacons Reinette Chatre
2009-11-13 19:56 ` [PATCH 13/16] iwlwifi: report PS filtered status Reinette Chatre
2009-11-13 19:56 ` [PATCH 14/16] iwlwifi: add sleep_tx_count ucode station API Reinette Chatre
2009-11-13 19:56 ` [PATCH 15/16] iwlwifi: handle unicast PS buffering Reinette Chatre
2009-11-13 22:14 ` Maxim Levitsky
2009-11-13 22:20 ` Johannes Berg
2009-11-18 23:34 ` Maxim Levitsky
2009-11-18 23:46 ` Johannes Berg
2009-11-13 19:56 ` [PATCH 16/16] iwlwifi: Add comments about CSR registers Reinette Chatre
2009-11-13 20:12 ` [PATCH 00/16] iwlwifi updates 11/13/2009 Luis R. Rodriguez
2009-11-13 20:41 ` reinette chatre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1258142198-3223-11-git-send-email-reinette.chatre@intel.com \
--to=reinette.chatre@intel.com \
--cc=ipw3945-devel@lists.sourceforge.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox