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

Commit 03db2e3c authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cnss2: Increase mhi timeout to 60 seconds for firmware download"

parents bac14d76 0434d02e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ static DEFINE_SPINLOCK(time_sync_lock);
#define FORCE_WAKE_DELAY_MIN_US			4000
#define FORCE_WAKE_DELAY_MAX_US			6000
#define FORCE_WAKE_DELAY_TIMEOUT_US		60000
#define CNSS_MHI_MISSION_MODE_TIMEOUT		60000

#define POWER_ON_RETRY_MAX_TIMES		3
#define POWER_ON_RETRY_DELAY_MS			200
@@ -1342,6 +1343,7 @@ int cnss_pci_start_mhi(struct cnss_pci_data *pci_priv)
{
	int ret = 0;
	struct cnss_plat_data *plat_priv;
	unsigned int timeout = 0;

	if (!pci_priv) {
		cnss_pr_err("pci_priv is NULL\n");
@@ -1360,7 +1362,16 @@ int cnss_pci_start_mhi(struct cnss_pci_data *pci_priv)
	if (ret)
		return ret;

	if (cnss_get_host_build_type() == QMI_HOST_BUILD_TYPE_PRIMARY_V01) {
		timeout = pci_priv->mhi_ctrl->timeout_ms;
		pci_priv->mhi_ctrl->timeout_ms = CNSS_MHI_MISSION_MODE_TIMEOUT;
	}

	ret = cnss_pci_set_mhi_state(pci_priv, CNSS_MHI_POWER_ON);

	if (cnss_get_host_build_type() == QMI_HOST_BUILD_TYPE_PRIMARY_V01)
		pci_priv->mhi_ctrl->timeout_ms = timeout;

	/* -ETIMEDOUT means MHI power on has succeeded but timed out
	 * for firmware mission mode event, so handle it properly.
	 */
+0 −12
Original line number Diff line number Diff line
@@ -165,18 +165,6 @@ static int cnss_wlfw_ind_register_send_sync(struct cnss_plat_data *plat_priv)
	return ret;
}

#ifdef CONFIG_CNSS2_DEBUG
static inline u32 cnss_get_host_build_type(void)
{
	return QMI_HOST_BUILD_TYPE_PRIMARY_V01;
}
#else
static inline u32 cnss_get_host_build_type(void)
{
	return QMI_HOST_BUILD_TYPE_SECONDARY_V01;
}
#endif

static int cnss_wlfw_host_cap_send_sync(struct cnss_plat_data *plat_priv)
{
	struct wlfw_host_cap_req_msg_v01 *req;
+12 −0
Original line number Diff line number Diff line
@@ -278,4 +278,16 @@ static inline int cnss_dms_init(struct cnss_plat_data *plat_priv)
static inline void cnss_dms_deinit(struct cnss_plat_data *plat_priv) {}
#endif /* CONFIG_CNSS2_QMI */

#ifdef CONFIG_CNSS2_DEBUG
static inline u32 cnss_get_host_build_type(void)
{
	return QMI_HOST_BUILD_TYPE_PRIMARY_V01;
}
#else
static inline u32 cnss_get_host_build_type(void)
{
	return QMI_HOST_BUILD_TYPE_SECONDARY_V01;
}
#endif

#endif /* _CNSS_QMI_H */