Browse Source

cnss2: skip operations when it's under reboot

Skip FW ready event handling and driver probe
when it's under reboot.

Change-Id: I59418faea0d36e77d4da001110cf65756a842d8d
CRs-Fixed: 3256553
Yu Wang 2 years ago
parent
commit
54e992906b
2 changed files with 9 additions and 0 deletions
  1. 5 0
      cnss2/main.c
  2. 4 0
      cnss2/pci.c

+ 5 - 0
cnss2/main.c

@@ -719,6 +719,11 @@ static int cnss_fw_ready_hdlr(struct cnss_plat_data *plat_priv)
 	if (!plat_priv)
 		return -ENODEV;
 
+	if (test_bit(CNSS_IN_REBOOT, &plat_priv->driver_state)) {
+		cnss_pr_err("Reboot is in progress, ignore FW ready\n");
+		return -EINVAL;
+	}
+
 	cnss_pr_dbg("Processing FW Init Done..\n");
 	del_timer(&plat_priv->fw_boot_timer);
 	set_bit(CNSS_FW_READY, &plat_priv->driver_state);

+ 4 - 0
cnss2/pci.c

@@ -2229,6 +2229,10 @@ int cnss_pci_call_driver_probe(struct cnss_pci_data *pci_priv)
 		return -ENODEV;
 
 	plat_priv = pci_priv->plat_priv;
+	if (test_bit(CNSS_IN_REBOOT, &plat_priv->driver_state)) {
+		cnss_pr_err("Reboot is in progress, skip driver probe\n");
+		return -EINVAL;
+	}
 
 	if (test_bit(CNSS_DRIVER_DEBUG, &plat_priv->driver_state)) {
 		clear_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state);