Commit 35098463 authored by Kalle Valo's avatar Kalle Valo

ath10k: add module parameter to disable cold reset

As cold reset is not reliable with CUS223 boards, make it possible
to disable cold reset entirely and only use warm reset. This makes it also
easier to debug warm reset problems.
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 0399eca8
...@@ -39,8 +39,14 @@ enum ath10k_pci_irq_mode { ...@@ -39,8 +39,14 @@ enum ath10k_pci_irq_mode {
ATH10K_PCI_IRQ_MSI = 2, ATH10K_PCI_IRQ_MSI = 2,
}; };
enum ath10k_pci_reset_mode {
ATH10K_PCI_RESET_AUTO = 0,
ATH10K_PCI_RESET_WARM_ONLY = 1,
};
static unsigned int ath10k_target_ps; static unsigned int ath10k_target_ps;
static unsigned int ath10k_pci_irq_mode = ATH10K_PCI_IRQ_AUTO; static unsigned int ath10k_pci_irq_mode = ATH10K_PCI_IRQ_AUTO;
static unsigned int ath10k_pci_reset_mode = ATH10K_PCI_RESET_AUTO;
module_param(ath10k_target_ps, uint, 0644); module_param(ath10k_target_ps, uint, 0644);
MODULE_PARM_DESC(ath10k_target_ps, "Enable ath10k Target (SoC) PS option"); MODULE_PARM_DESC(ath10k_target_ps, "Enable ath10k Target (SoC) PS option");
...@@ -48,6 +54,9 @@ MODULE_PARM_DESC(ath10k_target_ps, "Enable ath10k Target (SoC) PS option"); ...@@ -48,6 +54,9 @@ MODULE_PARM_DESC(ath10k_target_ps, "Enable ath10k Target (SoC) PS option");
module_param_named(irq_mode, ath10k_pci_irq_mode, uint, 0644); module_param_named(irq_mode, ath10k_pci_irq_mode, uint, 0644);
MODULE_PARM_DESC(irq_mode, "0: auto, 1: legacy, 2: msi (default: 0)"); MODULE_PARM_DESC(irq_mode, "0: auto, 1: legacy, 2: msi (default: 0)");
module_param_named(reset_mode, ath10k_pci_reset_mode, uint, 0644);
MODULE_PARM_DESC(reset_mode, "0: auto, 1: warm only (default: 0)");
/* how long wait to wait for target to initialise, in ms */ /* how long wait to wait for target to initialise, in ms */
#define ATH10K_PCI_TARGET_WAIT 3000 #define ATH10K_PCI_TARGET_WAIT 3000
...@@ -1969,9 +1978,14 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar) ...@@ -1969,9 +1978,14 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
*/ */
ret = __ath10k_pci_hif_power_up(ar, false); ret = __ath10k_pci_hif_power_up(ar, false);
if (ret) { if (ret) {
ath10k_warn("failed to power up target using warm reset (%d), trying cold reset\n", ath10k_warn("failed to power up target using warm reset: %d\n",
ret); ret);
if (ath10k_pci_reset_mode == ATH10K_PCI_RESET_WARM_ONLY)
return ret;
ath10k_warn("trying cold reset\n");
ret = __ath10k_pci_hif_power_up(ar, true); ret = __ath10k_pci_hif_power_up(ar, true);
if (ret) { if (ret) {
ath10k_err("failed to power up target using cold reset too (%d)\n", ath10k_err("failed to power up target using cold reset too (%d)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment