Skip to content

Commit

Permalink
mwifiex: fix power state out of sync problem
Browse files Browse the repository at this point in the history
It's been observed that driver's power state goes out
of sync with firmware in some corner cases. When this
happens, driver tries to download the data to firmware
assuming it's awake which causes Tx data timeout.

Main thread will process interrupt as soon as interrupt
handler fills 'int_status' variable.

This patch fixes the race issue by updating 'int_status'
at the end of mwifiex_interrupt_status().

Signed-off-by: Shengzhen Li <szli@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Shengzhen Li authored and Kalle Valo committed Jan 29, 2016
1 parent 99074fc commit dc896b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/wireless/marvell/mwifiex/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -2116,11 +2116,6 @@ static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter,
}
}

spin_lock_irqsave(&adapter->int_lock, flags);
adapter->int_status |= pcie_ireg;
spin_unlock_irqrestore(&adapter->int_lock, flags);
mwifiex_dbg(adapter, INTR, "ireg: 0x%08x\n", pcie_ireg);

if (!adapter->pps_uapsd_mode &&
adapter->ps_state == PS_STATE_SLEEP &&
mwifiex_pcie_ok_to_access_hw(adapter)) {
Expand All @@ -2132,6 +2127,11 @@ static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter,
adapter->pm_wakeup_fw_try = false;
del_timer(&adapter->wakeup_timer);
}

spin_lock_irqsave(&adapter->int_lock, flags);
adapter->int_status |= pcie_ireg;
spin_unlock_irqrestore(&adapter->int_lock, flags);
mwifiex_dbg(adapter, INTR, "ireg: 0x%08x\n", pcie_ireg);
}

/*
Expand Down

0 comments on commit dc896b1

Please sign in to comment.