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

Commit e653f0f2 authored by Jinesh K. Jayakumar's avatar Jinesh K. Jayakumar
Browse files

msm: ipa: create debugfs root during pre-init



Create debugfs root for IPA during driver pre-init since the ethernet
offload subsystem init need to create sub-directories under it.

CRs-Fixed: 2304918
Change-Id: Id2f2e43ae23d0cacb8c4d2bafd219cffbaf50774
Signed-off-by: default avatarJinesh K. Jayakumar <jineshk@codeaurora.org>
parent 1df57774
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4901,7 +4901,7 @@ static int ipa3_post_init(const struct ipa3_plat_drv_res *resource_p,

	ipa3_register_panic_hdlr();

	ipa3_debugfs_init();
	ipa3_debugfs_post_init();

	mutex_lock(&ipa3_ctx->lock);
	ipa3_ctx->ipa_initialization_complete = true;
@@ -5649,6 +5649,8 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
		goto fail_device_create;
	}

	ipa3_debugfs_pre_init();

	/* Create a wakeup source. */
	wakeup_source_init(&ipa3_ctx->w_lock, "IPA_WS");
	spin_lock_init(&ipa3_ctx->wakelock_ref_cnt.spinlock);
+16 −7
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2272,16 +2272,24 @@ static const struct ipa3_debugfs_file debugfs_files[] = {
	}
};

void ipa3_debugfs_init(void)
void ipa3_debugfs_pre_init(void)
{
	dent = debugfs_create_dir("ipa", 0);
	if (IS_ERR_OR_NULL(dent)) {
		IPAERR("fail to create folder in debug_fs.\n");
		dent = NULL;
	}
}

void ipa3_debugfs_post_init(void)
{
	const size_t debugfs_files_num =
		sizeof(debugfs_files) / sizeof(struct ipa3_debugfs_file);
	size_t i;
	struct dentry *file;

	dent = debugfs_create_dir("ipa", 0);
	if (IS_ERR(dent)) {
		IPAERR("fail to create folder in debug_fs.\n");
	if (IS_ERR_OR_NULL(dent)) {
		IPAERR("debugs root not created\n");
		return;
	}

@@ -2358,7 +2366,7 @@ void ipa3_debugfs_init(void)

void ipa3_debugfs_remove(void)
{
	if (IS_ERR(dent)) {
	if (dent == NULL) {
		IPAERR("Debugfs:folder was not created.\n");
		return;
	}
@@ -2376,6 +2384,7 @@ struct dentry *ipa_debugfs_get_root(void)
EXPORT_SYMBOL(ipa_debugfs_get_root);

#else /* !CONFIG_DEBUG_FS */
void ipa3_debugfs_init(void) {}
void ipa3_debugfs_pre_init(void) {}
void ipa3_debugfs_post_init(void) {}
void ipa3_debugfs_remove(void) {}
#endif
+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2434,7 +2434,8 @@ int ipa3_generate_hw_rule(enum ipa_ip_type ip,
int ipa3_init_hw(void);
struct ipa3_rt_tbl *__ipa3_find_rt_tbl(enum ipa_ip_type ip, const char *name);
int ipa3_set_single_ndp_per_mbim(bool enable);
void ipa3_debugfs_init(void);
void ipa3_debugfs_pre_init(void);
void ipa3_debugfs_post_init(void);
void ipa3_debugfs_remove(void);

void ipa3_dump_buff_internal(void *base, dma_addr_t phy_base, u32 size);