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

Commit 55048f64 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: smem_debug: Remove dead code"

parents a44fbf1e fe8f88be
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -137,8 +137,6 @@ int smsm_state_cb_register(uint32_t smsm_entry, uint32_t mask,
	void *data);
int smsm_state_cb_deregister(uint32_t smsm_entry, uint32_t mask,
	void (*notify)(void *, uint32_t, uint32_t), void *data);
void smsm_print_sleep_info(uint32_t sleep_delay, uint32_t sleep_limit,
	uint32_t irq_mask, uint32_t wakeup_reason, uint32_t pending_irqs);
void smsm_reset_modem(unsigned mode);
void smsm_reset_modem_cont(void);
void smd_sleep_exit(void);
@@ -192,11 +190,6 @@ static inline int smsm_state_cb_deregister(uint32_t smsm_entry, uint32_t mask,
{
	return -ENODEV;
}
static inline void smsm_print_sleep_info(uint32_t sleep_delay,
	uint32_t sleep_limit, uint32_t irq_mask, uint32_t wakeup_reason,
	uint32_t pending_irqs)
{
}
static inline void smsm_reset_modem(unsigned mode)
{
}
+0 −190
Original line number Diff line number Diff line
@@ -23,132 +23,12 @@
#include <mach/msm_iomap.h>
#include <mach/msm_smem.h>

#include "smd_private.h"
#include "smem_private.h"

#if defined(CONFIG_DEBUG_FS)

#define SZ_SMEM_ALLOCATION_TABLE 8192

static void debug_f3(struct seq_file *s)
{
	char *x;
	int size;
	int j = 0;
	unsigned cols = 0;
	char str[4*sizeof(unsigned)+1] = {0};

	seq_puts(s, "Printing to log\n");

	x = smem_get_entry(SMEM_ERR_F3_TRACE_LOG, &size, 0, SMEM_ANY_HOST_FLAG);
	if (x != 0) {
		pr_info("smem: F3 TRACE LOG\n");
		while (size > 0) {
			if (size >= sizeof(unsigned)) {
				pr_info("%08x", *((unsigned *) x));
				for (j = 0; j < sizeof(unsigned); ++j)
					if (isprint(*(x+j)))
						str[cols*sizeof(unsigned) + j]
							= *(x+j);
					else
						str[cols*sizeof(unsigned) + j]
							= '-';
				x += sizeof(unsigned);
				size -= sizeof(unsigned);
			} else {
				while (size-- > 0)
					pr_info("%02x", (unsigned) *x++);
				break;
			}
			if (cols == 3) {
				cols = 0;
				str[4*sizeof(unsigned)] = 0;
				pr_info(" %s\n", str);
				str[0] = 0;
			} else {
				cols++;
				pr_info(" ");
			}
		}
		pr_info("\n");
	}
}

static void debug_modem_err_f3(struct seq_file *s)
{
	char *x;
	int size;
	int j = 0;
	unsigned cols = 0;
	char str[4*sizeof(unsigned)+1] = {0};

	x = smem_get_entry(SMEM_ERR_F3_TRACE_LOG, &size, 0, SMEM_ANY_HOST_FLAG);
	if (x != 0) {
		pr_info("smem: F3 TRACE LOG\n");
		while (size > 0) {
			if (size >= sizeof(unsigned)) {
				seq_printf(s, "%08x",
					       *((unsigned *) x));
				for (j = 0; j < sizeof(unsigned); ++j)
					if (isprint(*(x+j)))
						str[cols*sizeof(unsigned) + j]
							= *(x+j);
					else
						str[cols*sizeof(unsigned) + j]
							= '-';
				x += sizeof(unsigned);
				size -= sizeof(unsigned);
			} else {
				while (size-- > 0)
					seq_printf(s, "%02x", (unsigned) *x++);
				break;
			}
			if (cols == 3) {
				cols = 0;
				str[4*sizeof(unsigned)] = 0;
				seq_printf(s, " %s\n", str);
				str[0] = 0;
			} else {
				cols++;
				seq_puts(s, " ");
			}
		}
		seq_puts(s, "\n");
	}
}

static void debug_modem_err(struct seq_file *s)
{
	char *x;
	int size;

	x = smem_find(ID_DIAG_ERR_MSG, SZ_DIAG_ERR_MSG, 0, SMEM_ANY_HOST_FLAG);
	if (x != 0) {
		x[SZ_DIAG_ERR_MSG - 1] = 0;
		seq_printf(s, "smem: DIAG '%s'\n", x);
	}

	x = smem_get_entry(SMEM_ERR_CRASH_LOG, &size, 0, SMEM_ANY_HOST_FLAG);
	if (x != 0) {
		x[size - 1] = 0;
		seq_printf(s, "smem: CRASH LOG\n'%s'\n", x);
	}
	seq_puts(s, "\n");
}

static void debug_read_diag_msg(struct seq_file *s)
{
	char *msg;

	msg = smem_find(ID_DIAG_ERR_MSG, SZ_DIAG_ERR_MSG, 0,
							SMEM_ANY_HOST_FLAG);

	if (msg) {
		msg[SZ_DIAG_ERR_MSG - 1] = 0;
		seq_printf(s, "diag: '%s'\n", msg);
	}
}

static void debug_read_mem(struct seq_file *s)
{
	unsigned n;
@@ -247,11 +127,7 @@ static int __init smem_debugfs_init(void)
	if (IS_ERR(dent))
		return PTR_ERR(dent);

	debug_create("diag", 0444, dent, debug_read_diag_msg);
	debug_create("mem", 0444, dent, debug_read_mem);
	debug_create("modem_err", 0444, dent, debug_modem_err);
	debug_create("modem_err_f3", 0444, dent, debug_modem_err_f3);
	debug_create("print_f3", 0444, dent, debug_f3);
	debug_create("version", 0444, dent, debug_read_smem_version);

	/* NNV: this is google only stuff */
@@ -262,69 +138,3 @@ static int __init smem_debugfs_init(void)

late_initcall(smem_debugfs_init);
#endif


#define MAX_NUM_SLEEP_CLIENTS		64
#define MAX_SLEEP_NAME_LEN		8

#define NUM_GPIO_INT_REGISTERS		6
#define GPIO_SMEM_NUM_GROUPS		2
#define GPIO_SMEM_MAX_PC_INTERRUPTS	8

struct tramp_gpio_save {
	unsigned int enable;
	unsigned int detect;
	unsigned int polarity;
};

struct tramp_gpio_smem {
	uint16_t num_fired[GPIO_SMEM_NUM_GROUPS];
	uint16_t fired[GPIO_SMEM_NUM_GROUPS][GPIO_SMEM_MAX_PC_INTERRUPTS];
	uint32_t enabled[NUM_GPIO_INT_REGISTERS];
	uint32_t detection[NUM_GPIO_INT_REGISTERS];
	uint32_t polarity[NUM_GPIO_INT_REGISTERS];
};

/*
 * Print debug information on shared memory sleep variables
 */
void smsm_print_sleep_info(uint32_t sleep_delay, uint32_t sleep_limit,
	uint32_t irq_mask, uint32_t wakeup_reason, uint32_t pending_irqs)
{
	unsigned long flags;
	uint32_t *ptr;
	struct tramp_gpio_smem *gpio;

	spin_lock_irqsave(&smem_lock, flags);

	pr_info("SMEM_SMSM_SLEEP_DELAY: %x\n", sleep_delay);
	pr_info("SMEM_SMSM_LIMIT_SLEEP: %x\n", sleep_limit);

	ptr = smem_find(SMEM_SLEEP_POWER_COLLAPSE_DISABLED,
					sizeof(*ptr), 0, SMEM_ANY_HOST_FLAG);
	if (ptr)
		pr_info("SMEM_SLEEP_POWER_COLLAPSE_DISABLED: %x\n", *ptr);
	else
		pr_info("SMEM_SLEEP_POWER_COLLAPSE_DISABLED: missing\n");

	pr_info("SMEM_SMSM_INT_INFO %x %x %x\n",
		irq_mask, pending_irqs, wakeup_reason);

	gpio = smem_find(SMEM_GPIO_INT, sizeof(*gpio), 0,
							SMEM_ANY_HOST_FLAG);
	if (gpio) {
		int i;
		for (i = 0; i < NUM_GPIO_INT_REGISTERS; i++)
			pr_info("SMEM_GPIO_INT: %d: e %x d %x p %x\n",
				i, gpio->enabled[i], gpio->detection[i],
				gpio->polarity[i]);

		for (i = 0; i < GPIO_SMEM_NUM_GROUPS; i++)
			pr_info("SMEM_GPIO_INT: %d: f %d: %d %d...\n",
				i, gpio->num_fired[i], gpio->fired[i][0],
				gpio->fired[i][1]);
	} else
		pr_info("SMEM_GPIO_INT: missing\n");

	spin_unlock_irqrestore(&smem_lock, flags);
}