mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
cnss2: Skip link down recovery if link has been recovered by retry
There is no need to proceed link down recovery if link has been recovered by retries during power on sequence. Change-Id: I876f2e239b519d4230b5c115cdc05ff7650f5cd1 Signed-off-by: Yue Ma <yuem@codeaurora.org>
This commit is contained in:
parent
e6437c634f
commit
cd68afdcc7
5 changed files with 22 additions and 1 deletions
|
|
@ -418,6 +418,21 @@ int cnss_bus_is_device_down(struct cnss_plat_data *plat_priv)
|
|||
}
|
||||
}
|
||||
|
||||
int cnss_bus_check_link_status(struct cnss_plat_data *plat_priv)
|
||||
{
|
||||
if (!plat_priv)
|
||||
return -ENODEV;
|
||||
|
||||
switch (plat_priv->bus_type) {
|
||||
case CNSS_BUS_PCI:
|
||||
return cnss_pci_check_link_status(plat_priv->bus_priv);
|
||||
default:
|
||||
cnss_pr_dbg("Unsupported bus type: %d\n",
|
||||
plat_priv->bus_type);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int cnss_bus_debug_reg_read(struct cnss_plat_data *plat_priv, u32 offset,
|
||||
u32 *val)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ int cnss_bus_call_driver_modem_status(struct cnss_plat_data *plat_priv,
|
|||
int cnss_bus_update_status(struct cnss_plat_data *plat_priv,
|
||||
enum cnss_driver_status status);
|
||||
int cnss_bus_is_device_down(struct cnss_plat_data *plat_priv);
|
||||
int cnss_bus_check_link_status(struct cnss_plat_data *plat_priv);
|
||||
int cnss_bus_debug_reg_read(struct cnss_plat_data *plat_priv, u32 offset,
|
||||
u32 *val);
|
||||
int cnss_bus_debug_reg_write(struct cnss_plat_data *plat_priv, u32 offset,
|
||||
|
|
|
|||
|
|
@ -996,6 +996,10 @@ static int cnss_do_recovery(struct cnss_plat_data *plat_priv,
|
|||
|
||||
switch (reason) {
|
||||
case CNSS_REASON_LINK_DOWN:
|
||||
if (!cnss_bus_check_link_status(plat_priv)) {
|
||||
cnss_pr_dbg("Skip link down recovery as link is already up\n");
|
||||
return 0;
|
||||
}
|
||||
if (test_bit(LINK_DOWN_SELF_RECOVERY,
|
||||
&plat_priv->ctrl_params.quirks))
|
||||
goto self_recovery;
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ static struct cnss_bus_bw_cfg cnss_bus_bw_table[] = {
|
|||
#define PCIE_REG_SIZE ARRAY_SIZE(pcie_reg_access_seq)
|
||||
#define WLAON_REG_SIZE ARRAY_SIZE(wlaon_reg_access_seq)
|
||||
|
||||
static int cnss_pci_check_link_status(struct cnss_pci_data *pci_priv)
|
||||
int cnss_pci_check_link_status(struct cnss_pci_data *pci_priv)
|
||||
{
|
||||
u16 device_id;
|
||||
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ static inline int cnss_pci_get_drv_connected(void *bus_priv)
|
|||
return atomic_read(&pci_priv->drv_connected);
|
||||
}
|
||||
|
||||
int cnss_pci_check_link_status(struct cnss_pci_data *pci_priv);
|
||||
int cnss_suspend_pci_link(struct cnss_pci_data *pci_priv);
|
||||
int cnss_resume_pci_link(struct cnss_pci_data *pci_priv);
|
||||
int cnss_pci_init(struct cnss_plat_data *plat_priv);
|
||||
|
|
|
|||
Loading…
Reference in a new issue