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

Commit c68644d3 authored by Ralf Baechle's avatar Ralf Baechle
Browse files

[MIPS] Make SMTC_IDLE_HOOK_DEBUG a proper option in Kconfig.debug.

parent e016c38d
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -37,6 +37,15 @@ config DEBUG_STACK_USAGE


	  This option will slow down process creation somewhat.
	  This option will slow down process creation somewhat.


config CONFIG_SMTC_IDLE_HOOK_DEBUG
	bool "Enable additional debug checks before going into CPU idle loop"
	depends on DEBUG_KERNEL && MIPS_MT_SMTC
	help
	  This option enables Enable additional debug checks before going into
	  CPU idle loop.  For details on these checks, see
	  arch/mips/kernel/smtc.c.  This debugging option result in significant
	  overhead so should be disabled in production kernels.

config KGDB
config KGDB
	bool "Remote GDB kernel debugging"
	bool "Remote GDB kernel debugging"
	depends on DEBUG_KERNEL && SYS_SUPPORTS_KGDB
	depends on DEBUG_KERNEL && SYS_SUPPORTS_KGDB
+2 −2
Original line number Original line Diff line number Diff line
@@ -51,11 +51,11 @@ ATTRIB_NORET void cpu_idle(void)
	/* endless idle loop with no priority at all */
	/* endless idle loop with no priority at all */
	while (1) {
	while (1) {
		while (!need_resched()) {
		while (!need_resched()) {
#ifdef CONFIG_MIPS_MT_SMTC
#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG
			extern void smtc_idle_loop_hook(void);
			extern void smtc_idle_loop_hook(void);


			smtc_idle_loop_hook();
			smtc_idle_loop_hook();
#endif /* CONFIG_MIPS_MT_SMTC */
#endif
			if (cpu_wait)
			if (cpu_wait)
				(*cpu_wait)();
				(*cpu_wait)();
		}
		}
+8 −11
Original line number Original line Diff line number Diff line
@@ -141,10 +141,7 @@ __setup("ipibufs=", ipibufs);
__setup("nostlb", stlb_disable);
__setup("nostlb", stlb_disable);
__setup("asidmask=", asidmask_set);
__setup("asidmask=", asidmask_set);


/* Enable additional debug checks before going into CPU idle loop */
#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG
#define SMTC_IDLE_HOOK_DEBUG

#ifdef SMTC_IDLE_HOOK_DEBUG


static int hang_trig = 0;
static int hang_trig = 0;


@@ -176,7 +173,7 @@ int tcnoprog[NR_CPUS];
static atomic_t idle_hook_initialized = {0};
static atomic_t idle_hook_initialized = {0};
static int clock_hang_reported[NR_CPUS];
static int clock_hang_reported[NR_CPUS];


#endif /* SMTC_IDLE_HOOK_DEBUG */
#endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */


/* Initialize shared TLB - the should probably migrate to smtc_setup_cpus() */
/* Initialize shared TLB - the should probably migrate to smtc_setup_cpus() */


@@ -394,10 +391,10 @@ void mipsmt_prepare_cpus(void)
		printk("ASID mask value override to 0x%x\n", asidmask);
		printk("ASID mask value override to 0x%x\n", asidmask);


	/* Temporary */
	/* Temporary */
#ifdef SMTC_IDLE_HOOK_DEBUG
#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG
	if (hang_trig)
	if (hang_trig)
		printk("Logic Analyser Trigger on suspected TC hang\n");
		printk("Logic Analyser Trigger on suspected TC hang\n");
#endif /* SMTC_IDLE_HOOK_DEBUG */
#endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */


	/* Put MVPE's into 'configuration state' */
	/* Put MVPE's into 'configuration state' */
	write_c0_mvpcontrol( read_c0_mvpcontrol() | MVPCONTROL_VPC );
	write_c0_mvpcontrol( read_c0_mvpcontrol() | MVPCONTROL_VPC );
@@ -817,9 +814,9 @@ void ipi_decode(struct smtc_ipi *pipi)
	case SMTC_CLOCK_TICK:
	case SMTC_CLOCK_TICK:
		/* Invoke Clock "Interrupt" */
		/* Invoke Clock "Interrupt" */
		ipi_timer_latch[dest_copy] = 0;
		ipi_timer_latch[dest_copy] = 0;
#ifdef SMTC_IDLE_HOOK_DEBUG
#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG
		clock_hang_reported[dest_copy] = 0;
		clock_hang_reported[dest_copy] = 0;
#endif /* SMTC_IDLE_HOOK_DEBUG */
#endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */
		local_timer_interrupt(0, NULL);
		local_timer_interrupt(0, NULL);
		break;
		break;
	case LINUX_SMP_IPI:
	case LINUX_SMP_IPI:
@@ -1020,7 +1017,7 @@ EXPORT_SYMBOL(smtc_ipi_replay);


void smtc_idle_loop_hook(void)
void smtc_idle_loop_hook(void)
{
{
#ifdef SMTC_IDLE_HOOK_DEBUG
#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG
	int im;
	int im;
	int flags;
	int flags;
	int mtflags;
	int mtflags;
@@ -1113,7 +1110,7 @@ void smtc_idle_loop_hook(void)
	local_irq_restore(flags);
	local_irq_restore(flags);
	if (pdb_msg != &id_ho_db_msg[0])
	if (pdb_msg != &id_ho_db_msg[0])
		printk("CPU%d: %s", smp_processor_id(), id_ho_db_msg);
		printk("CPU%d: %s", smp_processor_id(), id_ho_db_msg);
#endif /* SMTC_IDLE_HOOK_DEBUG */
#endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */


	/*
	/*
	 * Replay any accumulated deferred IPIs. If "Instant Replay"
	 * Replay any accumulated deferred IPIs. If "Instant Replay"