cnss2: Add CONFIG_DISABLE_CNSS_SRAM_DUMP
It costs 4M when loading cnss2, if device id is QCA6490 and enabled CONFIG_CNSS2_DEBUG. Which is big memory consumption for low rate issue debugging. So add CONFIG_DISABLE_CNSS_SRAM_DUMP to disable sram_dump. Change-Id: Iacf338a3cc8f1583e16034a9873029a450fd254a CRs-Fixed: 3441274
This commit is contained in:
4
Kbuild
4
Kbuild
@@ -56,6 +56,10 @@ ifeq ($(CONFIG_FREE_M3_BLOB_MEM),y)
|
||||
KBUILD_CPPFLAGS += -DCONFIG_FREE_M3_BLOB_MEM
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DISABLE_CNSS_SRAM_DUMP),y)
|
||||
KBUILD_CPPFLAGS += -DCONFIG_DISABLE_CNSS_SRAM_DUMP
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_CNSS2) += cnss2/
|
||||
obj-$(CONFIG_ICNSS2) += icnss2/
|
||||
obj-$(CONFIG_CNSS_GENL) += cnss_genl/
|
||||
|
@@ -117,3 +117,12 @@ config CNSS2_CONDITIONAL_POWEROFF
|
||||
for the first time to avoid potential subsequent failures during
|
||||
device re-probe(after wlan function driver loaded) under very bad
|
||||
thermal conditions.
|
||||
|
||||
config DISABLE_CNSS_SRAM_DUMP
|
||||
bool "Disable sram_dump"
|
||||
depends on CNSS2
|
||||
depends on CNSS2_DEBUG
|
||||
help
|
||||
If enabled, CNSS plafrom driver will not dump sram when MHI power on
|
||||
timeout for CNSS QCA6490 chipset only. Since this feature about
|
||||
sram dump costs 4M memory.
|
||||
|
32
cnss2/main.c
32
cnss2/main.c
@@ -4235,6 +4235,19 @@ int cnss_wlan_hw_disable_check(struct cnss_plat_data *plat_priv)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DISABLE_CNSS_SRAM_DUMP
|
||||
static void cnss_sram_dump_init(struct cnss_plat_data *plat_priv)
|
||||
{
|
||||
}
|
||||
#else
|
||||
static void cnss_sram_dump_init(struct cnss_plat_data *plat_priv)
|
||||
{
|
||||
if (plat_priv->device_id == QCA6490_DEVICE_ID &&
|
||||
cnss_get_host_build_type() == QMI_HOST_BUILD_TYPE_PRIMARY_V01)
|
||||
plat_priv->sram_dump = kcalloc(SRAM_DUMP_SIZE, 1, GFP_KERNEL);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int cnss_misc_init(struct cnss_plat_data *plat_priv)
|
||||
{
|
||||
int ret;
|
||||
@@ -4278,9 +4291,7 @@ static int cnss_misc_init(struct cnss_plat_data *plat_priv)
|
||||
cnss_pr_err("QMI IPC connection call back register failed, err = %d\n",
|
||||
ret);
|
||||
|
||||
if (plat_priv->device_id == QCA6490_DEVICE_ID &&
|
||||
cnss_get_host_build_type() == QMI_HOST_BUILD_TYPE_PRIMARY_V01)
|
||||
plat_priv->sram_dump = kcalloc(SRAM_DUMP_SIZE, 1, GFP_KERNEL);
|
||||
cnss_sram_dump_init(plat_priv);
|
||||
|
||||
if (of_property_read_bool(plat_priv->plat_dev->dev.of_node,
|
||||
"qcom,rc-ep-short-channel"))
|
||||
@@ -4289,6 +4300,19 @@ static int cnss_misc_init(struct cnss_plat_data *plat_priv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DISABLE_CNSS_SRAM_DUMP
|
||||
static void cnss_sram_dump_deinit(struct cnss_plat_data *plat_priv)
|
||||
{
|
||||
}
|
||||
#else
|
||||
static void cnss_sram_dump_deinit(struct cnss_plat_data *plat_priv)
|
||||
{
|
||||
if (plat_priv->device_id == QCA6490_DEVICE_ID &&
|
||||
cnss_get_host_build_type() == QMI_HOST_BUILD_TYPE_PRIMARY_V01)
|
||||
kfree(plat_priv->sram_dump);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void cnss_misc_deinit(struct cnss_plat_data *plat_priv)
|
||||
{
|
||||
cnss_plat_ipc_unregister(CNSS_PLAT_IPC_DAEMON_QMI_CLIENT_V01,
|
||||
@@ -4303,7 +4327,7 @@ static void cnss_misc_deinit(struct cnss_plat_data *plat_priv)
|
||||
del_timer(&plat_priv->fw_boot_timer);
|
||||
wakeup_source_unregister(plat_priv->recovery_ws);
|
||||
cnss_deinit_sol_gpio(plat_priv);
|
||||
kfree(plat_priv->sram_dump);
|
||||
cnss_sram_dump_deinit(plat_priv);
|
||||
kfree(plat_priv->on_chip_pmic_board_ids);
|
||||
}
|
||||
|
||||
|
@@ -555,7 +555,9 @@ struct cnss_plat_data {
|
||||
u8 use_fw_path_with_prefix;
|
||||
char firmware_name[MAX_FIRMWARE_NAME_LEN];
|
||||
char fw_fallback_name[MAX_FIRMWARE_NAME_LEN];
|
||||
#ifndef CONFIG_DISABLE_CNSS_SRAM_DUMP
|
||||
u8 *sram_dump;
|
||||
#endif
|
||||
struct completion rddm_complete;
|
||||
struct completion recovery_complete;
|
||||
struct cnss_control_params ctrl_params;
|
||||
|
@@ -1693,6 +1693,11 @@ static void cnss_pci_dump_bl_sram_mem(struct cnss_pci_data *pci_priv)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DISABLE_CNSS_SRAM_DUMP
|
||||
static void cnss_pci_dump_sram(struct cnss_pci_data *pci_priv)
|
||||
{
|
||||
}
|
||||
#else
|
||||
static void cnss_pci_dump_sram(struct cnss_pci_data *pci_priv)
|
||||
{
|
||||
struct cnss_plat_data *plat_priv;
|
||||
@@ -1727,6 +1732,7 @@ static void cnss_pci_dump_sram(struct cnss_pci_data *pci_priv)
|
||||
cond_resched();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int cnss_pci_handle_mhi_poweron_timeout(struct cnss_pci_data *pci_priv)
|
||||
{
|
||||
|
Reference in New Issue
Block a user