diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2013-11-08 08:01:35 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2013-11-12 20:06:46 +0200 |
commit | 6a42a47e23acdcbc97aac925b5a14d1b187606cf (patch) | |
tree | fd5ed6867137d0d9fa97843803f742001876de1c /drivers/net/wireless/ath/ath10k | |
parent | 1d2b48d6174efb216012ec7cae7ddc653871543f (diff) |
ath10k: reset device upon stopping/power down
This should make sure the device won't issue any
interrupts nor access any memory after the driver
is stopped/freed thus avoid memory corruption in
some cases.
Reported-By: Ben Greear <greearb@candelatech.com>
Reported-By: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/pci.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index eaa99561dab..46c94ce58f9 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -1353,6 +1353,13 @@ static void ath10k_pci_hif_stop(struct ath10k *ar) ath10k_pci_cleanup_ce(ar); ath10k_pci_buffer_cleanup(ar); + /* Make the sure the device won't access any structures on the host by + * resetting it. The device was fed with PCI CE ringbuffer + * configuration during init. If ringbuffers are freed and the device + * were to access them this could lead to memory corruption on the + * host. */ + ath10k_pci_device_reset(ar); + ar_pci->started = 0; } @@ -1915,6 +1922,7 @@ err_irq: ath10k_ce_disable_interrupts(ar); ath10k_pci_stop_intr(ar); ath10k_pci_kill_tasklet(ar); + ath10k_pci_device_reset(ar); err_ce: ath10k_pci_ce_deinit(ar); err_ps: @@ -1929,6 +1937,7 @@ static void ath10k_pci_hif_power_down(struct ath10k *ar) struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); ath10k_pci_stop_intr(ar); + ath10k_pci_device_reset(ar); ath10k_pci_ce_deinit(ar); if (!test_bit(ATH10K_PCI_FEATURE_SOC_POWER_SAVE, ar_pci->features)) |