cnss2: Add PCIe's link resume failed event

Add BUS_EVENT_PCIE_LINK_RESUME_FAIL type to bus event type.

Change-Id: If13f53ed9f2c6968eed5e11343cc493e740d82bd
CRs-Fixed: 3646812
This commit is contained in:
Meng Yuan
2023-10-18 15:03:37 +08:00
committed by Ravindra Konda
parent cd3b976590
commit 6bb3f633f3
3 changed files with 14 additions and 2 deletions

View File

@@ -1989,8 +1989,10 @@ void cnss_recovery_handler(struct cnss_plat_data *plat_priv)
msleep(POWER_RESET_MIN_DELAY_MS);
ret = cnss_bus_dev_powerup(plat_priv);
if (ret)
if (ret) {
__pm_relax(plat_priv->recovery_ws);
clear_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state);
}
return;
}
@@ -2050,6 +2052,8 @@ static const char *cnss_recovery_reason_to_str(enum cnss_recovery_reason reason)
static int cnss_do_recovery(struct cnss_plat_data *plat_priv,
enum cnss_recovery_reason reason)
{
int ret;
plat_priv->recovery_count++;
if (plat_priv->device_id == QCA6174_DEVICE_ID)
@@ -2122,7 +2126,9 @@ self_recovery:
return 0;
}
cnss_bus_dev_powerup(plat_priv);
ret = cnss_bus_dev_powerup(plat_priv);
if (ret)
clear_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state);
return 0;
}

View File

@@ -782,6 +782,9 @@ static struct cnss_print_optimize print_optimize;
static int cnss_pci_update_fw_name(struct cnss_pci_data *pci_priv);
static void cnss_pci_suspend_pwroff(struct pci_dev *pci_dev);
static bool cnss_should_suspend_pwroff(struct pci_dev *pci_dev);
static void cnss_pci_update_link_event(struct cnss_pci_data *pci_priv,
enum cnss_bus_event_type type,
void *data);
#if IS_ENABLED(CONFIG_MHI_BUS_MISC)
@@ -1463,6 +1466,8 @@ int cnss_resume_pci_link(struct cnss_pci_data *pci_priv)
ret = cnss_set_pci_link(pci_priv, PCI_LINK_UP);
if (ret) {
ret = -EAGAIN;
cnss_pci_update_link_event(pci_priv,
BUS_EVENT_PCI_LINK_RESUME_FAIL, NULL);
goto out;
}

View File

@@ -209,6 +209,7 @@ enum cnss_host_dump_type {
enum cnss_bus_event_type {
BUS_EVENT_PCI_LINK_DOWN = 0,
BUS_EVENT_PCI_LINK_RESUME_FAIL = 1,
BUS_EVENT_INVALID = 0xFFFF,
};