mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 16:16:15 -04:00
cnss2: Enable self-recovery only when host driver detects linkdown
Enable self recovery only when the host driver detects link down. Change-Id: I415dd838ef9288922ceeb0ab46b7b6ea95d00ebb Signed-off-by: Mohammed Siddiq <msiddiq@codeaurora.org>
This commit is contained in:
parent
aabb9a2b65
commit
02e42bd387
2 changed files with 17 additions and 4 deletions
|
|
@ -1117,6 +1117,11 @@ static int cnss_do_recovery(struct cnss_plat_data *plat_priv,
|
|||
self_recovery:
|
||||
cnss_pr_dbg("Going for self recovery\n");
|
||||
cnss_bus_dev_shutdown(plat_priv);
|
||||
|
||||
if (test_bit(LINK_DOWN_SELF_RECOVERY, &plat_priv->ctrl_params.quirks))
|
||||
clear_bit(LINK_DOWN_SELF_RECOVERY,
|
||||
&plat_priv->ctrl_params.quirks);
|
||||
|
||||
cnss_bus_dev_powerup(plat_priv);
|
||||
|
||||
return 0;
|
||||
|
|
@ -2623,10 +2628,6 @@ static void cnss_init_control_params(struct cnss_plat_data *plat_priv)
|
|||
of_property_read_bool(plat_priv->plat_dev->dev.of_node,
|
||||
"qcom,wlan-cbc-enabled");
|
||||
|
||||
if (of_property_read_bool(plat_priv->plat_dev->dev.of_node,
|
||||
"cnss-enable-self-recovery"))
|
||||
plat_priv->ctrl_params.quirks |= BIT(LINK_DOWN_SELF_RECOVERY);
|
||||
|
||||
plat_priv->ctrl_params.mhi_timeout = CNSS_MHI_TIMEOUT_DEFAULT;
|
||||
plat_priv->ctrl_params.mhi_m2_timeout = CNSS_MHI_M2_TIMEOUT_DEFAULT;
|
||||
plat_priv->ctrl_params.qmi_timeout = CNSS_QMI_TIMEOUT_DEFAULT;
|
||||
|
|
|
|||
|
|
@ -968,6 +968,7 @@ int cnss_pci_link_down(struct device *dev)
|
|||
{
|
||||
struct pci_dev *pci_dev = to_pci_dev(dev);
|
||||
struct cnss_pci_data *pci_priv = cnss_get_pci_priv(pci_dev);
|
||||
struct cnss_plat_data *plat_priv = NULL;
|
||||
int ret;
|
||||
|
||||
if (!pci_priv) {
|
||||
|
|
@ -975,6 +976,17 @@ int cnss_pci_link_down(struct device *dev)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
plat_priv = pci_priv->plat_priv;
|
||||
if (!plat_priv) {
|
||||
cnss_pr_err("plat_priv is NULL\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (pci_priv->drv_connected_last &&
|
||||
of_property_read_bool(plat_priv->plat_dev->dev.of_node,
|
||||
"cnss-enable-self-recovery"))
|
||||
plat_priv->ctrl_params.quirks |= BIT(LINK_DOWN_SELF_RECOVERY);
|
||||
|
||||
cnss_pr_err("PCI link down is detected by drivers\n");
|
||||
|
||||
ret = msm_pcie_pm_control(MSM_PCIE_HANDLE_LINKDOWN,
|
||||
|
|
|
|||
Loading…
Reference in a new issue