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

Commit 75e8fd3e authored by Chaoli Zhou's avatar Chaoli Zhou Committed by Gerrit - the friendly Code Review server
Browse files

cnss2: Fix 60s timeout while search regdb.bin failure



Since for the Genoa or the SP that doesn't need
regdb.bin for Hasting, it should happen search
regdb.bin failure issue that cause 60s timeout.
So add one compile macro CNSS_REQ_FW_DIRECT to
replace request_firmware_direct with request_
firmware for regdb.bin and only search the folder
that set by fw_path, which can avoid 60s timeout
while search file failure in the user space.
static const char * const fw_path[] = {
	fw_path_para,
	"/lib/firmware/updates/" UTS_RELEASE,
	"/lib/firmware/updates",
	"/lib/firmware/" UTS_RELEASE,
	"/lib/firmware"
};
Above piece of code is the definition of fw_path
from drivers/base/firmware_loader/main.c.

Change-Id: I79c2fce33a8befecb0242a70b7eee1eef9a76e9b
Signed-off-by: default avatarChaoli Zhou <zchaoli@codeaurora.org>
Signed-off-by: default avatarKuichu Ni <kuichun@codeaurora.org>
parent d00e6c6b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -96,3 +96,11 @@ config CNSS_WCN7850
	  CNSS WCN7850 chipset.
	  These changes are needed to support the new hardware architecture
	  for CNSS WCN7850 chipset.

config CNSS_REQ_FW_DIRECT
	bool "Enable request_firmware_direct for firmware or configuration file"
	depends on CNSS2
	help
	  This enables calling request_firmware_direct for firmware or
	  configuration file to avoid 60s timeout while search file under user
	  space failure.
+12 −0
Original line number Diff line number Diff line
@@ -2485,6 +2485,18 @@ int cnss_minidump_remove_region(struct cnss_plat_data *plat_priv,
}
#endif /* CONFIG_QCOM_MINIDUMP */

int cnss_request_firmware_direct(struct cnss_plat_data *plat_priv,
				 const struct firmware **fw_entry,
				 const char *filename)
{
	if (IS_ENABLED(CONFIG_CNSS_REQ_FW_DIRECT))
		return request_firmware_direct(fw_entry, filename,
					       &plat_priv->plat_dev->dev);
	else
		return request_firmware(fw_entry, filename,
					&plat_priv->plat_dev->dev);
}

#if IS_ENABLED(CONFIG_INTERCONNECT)
/**
 * cnss_register_bus_scale() - Setup interconnect voting data
+3 −0
Original line number Diff line number Diff line
@@ -562,4 +562,7 @@ int cnss_get_tcs_info(struct cnss_plat_data *plat_priv);
unsigned int cnss_get_timeout(struct cnss_plat_data *plat_priv,
			      enum cnss_timeout_type);
int cnss_dev_specific_power_on(struct cnss_plat_data *plat_priv);
int cnss_request_firmware_direct(struct cnss_plat_data *plat_priv,
				 const struct firmware **fw_entry,
				 const char *filename);
#endif /* _CNSS_MAIN_H */
+9 −3
Original line number Diff line number Diff line
@@ -603,7 +603,13 @@ int cnss_wlfw_bdf_dnld_send_sync(struct cnss_plat_data *plat_priv,
		goto err_req_fw;
	}

	ret = request_firmware(&fw_entry, filename, &plat_priv->plat_dev->dev);
	if (bdf_type == CNSS_BDF_REGDB)
		ret = cnss_request_firmware_direct(plat_priv, &fw_entry,
						   filename);
	else
		ret = request_firmware(&fw_entry, filename,
				       &plat_priv->plat_dev->dev);

	if (ret) {
		cnss_pr_err("Failed to load BDF: %s\n", filename);
		goto err_req_fw;
@@ -1012,8 +1018,8 @@ int cnss_wlfw_qdss_dnld_send_sync(struct cnss_plat_data *plat_priv)
	}

	cnss_get_qdss_cfg_filename(plat_priv, qdss_cfg_filename, sizeof(qdss_cfg_filename));
	ret = request_firmware(&fw_entry, qdss_cfg_filename,
			       &plat_priv->plat_dev->dev);
	ret = cnss_request_firmware_direct(plat_priv, &fw_entry,
					   qdss_cfg_filename);
	if (ret) {
		cnss_pr_err("Failed to load QDSS: %s\n",
			    qdss_cfg_filename);