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

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

Merge "msm: ipa4: Cleanup IPA registers dump"

parents f029b748 7ba87d50
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1564,6 +1564,12 @@ int ipahal_init(enum ipa_hw_type ipa_hw_type, void __iomem *base,
		goto bail_free_fltrt;
	}

	/* create an IPC buffer for the registers dump */
	ipahal_ctx->regdumpbuf = ipc_log_context_create(IPAHAL_IPC_LOG_PAGES,
		"ipa_regs", 0);
	if (ipahal_ctx->regdumpbuf == NULL)
		IPAHAL_ERR("failed to create IPA regdump log, continue...\n");

	ipahal_debugfs_init();

	return 0;
@@ -1571,6 +1577,8 @@ int ipahal_init(enum ipa_hw_type ipa_hw_type, void __iomem *base,
bail_free_fltrt:
	ipahal_fltrt_destroy();
bail_free_ctx:
	if (ipahal_ctx->regdumpbuf)
		ipc_log_context_destroy(ipahal_ctx->regdumpbuf);
	kfree(ipahal_ctx);
	ipahal_ctx = NULL;
bail_err_exit:
+15 −16
Original line number Diff line number Diff line
@@ -46,36 +46,34 @@
			IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \
	} while (0)

#define IPAHAL_DBG_REG(fmt, args...) \
#define IPAHAL_ERR_RL(fmt, args...) \
		do { \
		pr_err(fmt, ## args); \
			pr_err_ratelimited_ipa(IPAHAL_DRV_NAME " %s:%d " fmt, \
			__func__, __LINE__, ## args); \
			IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \
			" %s:%d " fmt, ## args); \
				IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \
			IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \
			" %s:%d " fmt, ## args); \
				IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \
		} while (0)

#define IPAHAL_DBG_REG_IPC_ONLY(fmt, args...) \
#define IPAHAL_DBG_REG(fmt, args...) \
	do { \
		IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \
			" %s:%d " fmt, ## args); \
		IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \
		pr_err(fmt, ## args); \
		IPA_IPC_LOGGING(ipahal_ctx->regdumpbuf, \
			" %s:%d " fmt, ## args); \
	} while (0)

#define IPAHAL_ERR_RL(fmt, args...) \
#define IPAHAL_DBG_REG_IPC_ONLY(fmt, args...) \
	do { \
			pr_err_ratelimited_ipa(IPAHAL_DRV_NAME " %s:%d " fmt, \
			__func__, __LINE__, ## args); \
			IPA_IPC_LOGGING(ipa_get_ipc_logbuf(), \
				IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \
			IPA_IPC_LOGGING(ipa_get_ipc_logbuf_low(), \
				IPAHAL_DRV_NAME " %s:%d " fmt, ## args); \
		IPA_IPC_LOGGING(ipahal_ctx->regdumpbuf, \
			" %s:%d " fmt, ## args); \
	} while (0)

#define IPAHAL_MEM_ALLOC(__size, __is_atomic_ctx) \
	(kzalloc((__size), ((__is_atomic_ctx) ? GFP_ATOMIC : GFP_KERNEL)))

#define IPAHAL_IPC_LOG_PAGES 50

/*
 * struct ipahal_context - HAL global context data
 * @hw_type: IPA H/W type/version.
@@ -92,6 +90,7 @@ struct ipahal_context {
	struct dentry *dent;
	struct device *ipa_pdev;
	struct ipa_mem_buffer empty_fltrt_tbl;
	void *regdumpbuf;
};

extern struct ipahal_context *ipahal_ctx;
+12 −6
Original line number Diff line number Diff line
@@ -2280,7 +2280,7 @@ static struct ipahal_reg_obj ipahal_reg_objs[IPA_HW_MAX][IPA_REG_MAX] = {
		0x00000830, 0x70, 8, 17, 1},
};

int ipahal_print_all_regs(bool print_to_dmesg)
void ipahal_print_all_regs(bool print_to_dmesg)
{
	int i, j;

@@ -2290,7 +2290,7 @@ int ipahal_print_all_regs(bool print_to_dmesg)
	if ((ipahal_ctx->hw_type < IPA_HW_v4_0) ||
		(ipahal_ctx->hw_type >= IPA_HW_MAX)) {
		IPAHAL_ERR("invalid IPA HW type (%d)\n", ipahal_ctx->hw_type);
		return -EINVAL;
		return;
	}

	for (i = 0; i < IPA_REG_MAX ; i++) {
@@ -2310,11 +2310,17 @@ int ipahal_print_all_regs(bool print_to_dmesg)
					ipahal_read_reg_n(i, j));
		}

		for (; j < ipahal_reg_objs[ipahal_ctx->hw_type][i].n_end; j++)
			IPAHAL_DBG_REG("%s_%u=0x%x\n", ipahal_reg_name_str(i),
		for (; j < ipahal_reg_objs[ipahal_ctx->hw_type][i].n_end; j++) {
			if (print_to_dmesg)
				IPAHAL_DBG_REG("%s_%u=0x%x\n",
					ipahal_reg_name_str(i),
					j, ipahal_read_reg_n(i, j));
			else
				IPAHAL_DBG_REG_IPC_ONLY("%s_%u=0x%x\n",
					ipahal_reg_name_str(i),
					j, ipahal_read_reg_n(i, j));
		}
	return 0;
	}
}

/*
+1 −1
Original line number Diff line number Diff line
@@ -535,7 +535,7 @@ struct ipahal_ep_cfg_ctrl_scnd {
};


int ipahal_print_all_regs(bool print_to_dmesg);
void ipahal_print_all_regs(bool print_to_dmesg);

/*
 * ipahal_reg_name_str() - returns string that represent the register