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
这个提交包含在:
Wu Gao
2023-03-21 05:19:48 -07:00
父节点 ddbe3d0e4e
当前提交 3ef55a9a08
修改 5 个文件,包含 49 行新增4 行删除

4
Kbuild
查看文件

@@ -56,6 +56,10 @@ ifeq ($(CONFIG_FREE_M3_BLOB_MEM),y)
KBUILD_CPPFLAGS += -DCONFIG_FREE_M3_BLOB_MEM KBUILD_CPPFLAGS += -DCONFIG_FREE_M3_BLOB_MEM
endif endif
ifeq ($(CONFIG_DISABLE_CNSS_SRAM_DUMP),y)
KBUILD_CPPFLAGS += -DCONFIG_DISABLE_CNSS_SRAM_DUMP
endif
obj-$(CONFIG_CNSS2) += cnss2/ obj-$(CONFIG_CNSS2) += cnss2/
obj-$(CONFIG_ICNSS2) += icnss2/ obj-$(CONFIG_ICNSS2) += icnss2/
obj-$(CONFIG_CNSS_GENL) += cnss_genl/ obj-$(CONFIG_CNSS_GENL) += cnss_genl/

查看文件

@@ -117,3 +117,12 @@ config CNSS2_CONDITIONAL_POWEROFF
for the first time to avoid potential subsequent failures during for the first time to avoid potential subsequent failures during
device re-probe(after wlan function driver loaded) under very bad device re-probe(after wlan function driver loaded) under very bad
thermal conditions. 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.

查看文件

@@ -4235,6 +4235,19 @@ int cnss_wlan_hw_disable_check(struct cnss_plat_data *plat_priv)
} }
#endif #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) static int cnss_misc_init(struct cnss_plat_data *plat_priv)
{ {
int ret; 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", cnss_pr_err("QMI IPC connection call back register failed, err = %d\n",
ret); ret);
if (plat_priv->device_id == QCA6490_DEVICE_ID && cnss_sram_dump_init(plat_priv);
cnss_get_host_build_type() == QMI_HOST_BUILD_TYPE_PRIMARY_V01)
plat_priv->sram_dump = kcalloc(SRAM_DUMP_SIZE, 1, GFP_KERNEL);
if (of_property_read_bool(plat_priv->plat_dev->dev.of_node, if (of_property_read_bool(plat_priv->plat_dev->dev.of_node,
"qcom,rc-ep-short-channel")) "qcom,rc-ep-short-channel"))
@@ -4289,6 +4300,19 @@ static int cnss_misc_init(struct cnss_plat_data *plat_priv)
return 0; 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) static void cnss_misc_deinit(struct cnss_plat_data *plat_priv)
{ {
cnss_plat_ipc_unregister(CNSS_PLAT_IPC_DAEMON_QMI_CLIENT_V01, 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); del_timer(&plat_priv->fw_boot_timer);
wakeup_source_unregister(plat_priv->recovery_ws); wakeup_source_unregister(plat_priv->recovery_ws);
cnss_deinit_sol_gpio(plat_priv); 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); kfree(plat_priv->on_chip_pmic_board_ids);
} }

查看文件

@@ -555,7 +555,9 @@ struct cnss_plat_data {
u8 use_fw_path_with_prefix; u8 use_fw_path_with_prefix;
char firmware_name[MAX_FIRMWARE_NAME_LEN]; char firmware_name[MAX_FIRMWARE_NAME_LEN];
char fw_fallback_name[MAX_FIRMWARE_NAME_LEN]; char fw_fallback_name[MAX_FIRMWARE_NAME_LEN];
#ifndef CONFIG_DISABLE_CNSS_SRAM_DUMP
u8 *sram_dump; u8 *sram_dump;
#endif
struct completion rddm_complete; struct completion rddm_complete;
struct completion recovery_complete; struct completion recovery_complete;
struct cnss_control_params ctrl_params; 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) static void cnss_pci_dump_sram(struct cnss_pci_data *pci_priv)
{ {
struct cnss_plat_data *plat_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(); cond_resched();
} }
} }
#endif
static int cnss_pci_handle_mhi_poweron_timeout(struct cnss_pci_data *pci_priv) static int cnss_pci_handle_mhi_poweron_timeout(struct cnss_pci_data *pci_priv)
{ {