Skip to content

Commit 6a0f81c

Browse files
egrumbachjmberg-intel
authored andcommitted
wifi: iwlwifi: fix merge damage related to iwl_pci_resume
The changes I made in wifi: iwlwifi: don't warn if the NIC is gone in resume conflicted with a major rework done in this area. The merge de-facto removed my changes. Re-add them. Signed-off-by: Emmanuel Grumbach <[email protected]> Link: https://patch.msgid.link/[email protected] Fixes: 06c4b20 ("Merge tag 'iwlwifi-next-2025-05-15' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next") Signed-off-by: Johannes Berg <[email protected]>
1 parent 5708966 commit 6a0f81c

File tree

1 file changed

+20
-4
lines changed
  • drivers/net/wireless/intel/iwlwifi/pcie

1 file changed

+20
-4
lines changed

drivers/net/wireless/intel/iwlwifi/pcie/drv.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,11 +1501,27 @@ static int _iwl_pci_resume(struct device *device, bool restore)
15011501
* Scratch value was altered, this means the device was powered off, we
15021502
* need to reset it completely.
15031503
* Note: MAC (bits 0:7) will be cleared upon suspend even with wowlan,
1504-
* so assume that any bits there mean that the device is usable.
1504+
* but not bits [15:8]. So if we have bits set in lower word, assume
1505+
* the device is alive.
1506+
* For older devices, just try silently to grab the NIC.
15051507
*/
1506-
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_BZ &&
1507-
!iwl_read32(trans, CSR_FUNC_SCRATCH))
1508-
device_was_powered_off = true;
1508+
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) {
1509+
if (!(iwl_read32(trans, CSR_FUNC_SCRATCH) &
1510+
CSR_FUNC_SCRATCH_POWER_OFF_MASK))
1511+
device_was_powered_off = true;
1512+
} else {
1513+
/*
1514+
* bh are re-enabled by iwl_trans_pcie_release_nic_access,
1515+
* so re-enable them if _iwl_trans_pcie_grab_nic_access fails.
1516+
*/
1517+
local_bh_disable();
1518+
if (_iwl_trans_pcie_grab_nic_access(trans, true)) {
1519+
iwl_trans_pcie_release_nic_access(trans);
1520+
} else {
1521+
device_was_powered_off = true;
1522+
local_bh_enable();
1523+
}
1524+
}
15091525

15101526
if (restore || device_was_powered_off) {
15111527
trans->state = IWL_TRANS_NO_FW;

0 commit comments

Comments
 (0)