Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1bfc1468 authored by Yue Ma's avatar Yue Ma
Browse files

cnss2: Assert if MHI is in bad states for debug purpose



Currently even if MHI states are out of order, driver can still
handle but may casue other issues later and logs getting flooded.
In order to expose the real issue, assert if MHI is in bad states
in debug build only.

Change-Id: Icb57ea8100cb11fccc54978fbcc62167bdba2818
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent aa7030af
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -891,6 +891,8 @@ static int cnss_pci_check_mhi_state_bit(struct cnss_pci_data *pci_priv,
	cnss_pr_err("Cannot set MHI state %s(%d) in current MHI state (0x%lx)\n",
		    cnss_mhi_state_to_str(mhi_state), mhi_state,
		    pci_priv->mhi_state);
	if (mhi_state != CNSS_MHI_TRIGGER_RDDM)
		CNSS_ASSERT(0);

	return -EINVAL;
}
@@ -1665,6 +1667,11 @@ static int cnss_qca6290_shutdown(struct cnss_pci_data *pci_priv)
		cnss_pci_collect_dump(pci_priv);
	}

	if (!cnss_is_device_powered_on(plat_priv)) {
		cnss_pr_dbg("Device is already powered off, ignore\n");
		goto skip_power_off;
	}

	cnss_pci_power_off_mhi(pci_priv);
	ret = cnss_suspend_pci_link(pci_priv);
	if (ret)
@@ -1674,6 +1681,7 @@ static int cnss_qca6290_shutdown(struct cnss_pci_data *pci_priv)

	cnss_power_off_device(plat_priv);

skip_power_off:
	pci_priv->remap_window = 0;

	clear_bit(CNSS_FW_READY, &plat_priv->driver_state);