예제 #1
0
static irqreturn_t riva_wdog_bite_irq_hdlr(int irq, void *dev_id)
{
	riva_crash = true;

	if (ss_restart_inprogress) {
		pr_err("%s: Ignoring riva bite irq, restart in progress\n",
						MODULE_NAME);
		return IRQ_HANDLED;
	}

	if (!enable_riva_ssr)
	{
	    if((inactive == system_flag) || (normalreboot == system_flag) || (adloadmode == system_flag) ||(poweroff == system_flag))
		    system_flag = rivafatal;
#ifdef CONFIG_CCI_KLOG			
	    *powerpt = (POWERONOFFRECORD + system_flag);
		*unknowflag = 0;
		*backupcrashflag = 0;
		
		set_warmboot();
#ifdef CCI_KLOG_ALLOW_FORCE_PANIC			
		__raw_writel(CONFIG_WARMBOOT_CRASH, restart_reason);
#else
		__raw_writel(CONFIG_WARMBOOT_NORMAL, restart_reason);
		*backupcrashflag = CONFIG_WARMBOOT_CRASH;
#endif
#endif		
		mb();
		panic(MODULE_NAME ": Watchdog bite received from Riva");
	}
	ss_restart_inprogress = true;
	subsystem_restart_dev(riva_8960_dev);

	return IRQ_HANDLED;
}
예제 #2
0
static void smsm_state_cb_hdlr(void *data, uint32_t old_state,
					uint32_t new_state)
{
	char *smem_reset_reason;
	char buffer[MAX_BUF_SIZE];
	unsigned smem_reset_size;
	unsigned size;


#ifdef CCI_KLOG_CRASH_SIZE
#if CCI_KLOG_CRASH_SIZE
	set_fault_state(0x5, -1, "riva");
#endif // #if CCI_KLOG_CRASH_SIZE
#endif // #ifdef CCI_KLOG_CRASH_SIZE


	riva_crash = true;

	pr_err("%s: smsm state changed\n", MODULE_NAME);

	wcnss_riva_dump_pmic_regs();

	if (!(new_state & SMSM_RESET))
		return;

	if (ss_restart_inprogress) {
		pr_err("%s: Ignoring smsm reset req, restart in progress\n",
						MODULE_NAME);
		return;
	}

	if (!enable_riva_ssr)
	{
	    if((inactive == system_flag) || (normalreboot == system_flag) || (adloadmode == system_flag) ||(poweroff == system_flag))
		    system_flag = rivafatal;
#ifdef CONFIG_CCI_KLOG			
	    *powerpt = (POWERONOFFRECORD + system_flag);
		*unknowflag = 0;
		*backupcrashflag = 0;
#endif	
		set_warmboot();
#ifdef CONFIG_CCI_KLOG
#ifdef CCI_KLOG_ALLOW_FORCE_PANIC			
		__raw_writel(CONFIG_WARMBOOT_CRASH, restart_reason);
#else
		__raw_writel(CONFIG_WARMBOOT_NORMAL, restart_reason);
		*backupcrashflag = CONFIG_WARMBOOT_CRASH;
#endif
#endif	
		mb();
		panic(MODULE_NAME ": SMSM reset request received from Riva");
	}

	smem_reset_reason = smem_get_entry(SMEM_SSR_REASON_WCNSS0,
			&smem_reset_size);

	if (!smem_reset_reason || !smem_reset_size) {
		pr_err("%s: wcnss subsystem failure reason: %s\n",
				__func__, "(unknown, smem_get_entry failed)");
	} else if (!smem_reset_reason[0]) {
		pr_err("%s: wcnss subsystem failure reason: %s\n",
				__func__, "(unknown, init string found)");
	} else {
		size = smem_reset_size < MAX_BUF_SIZE ? smem_reset_size :
			(MAX_BUF_SIZE - 1);
		memcpy(buffer, smem_reset_reason, size);
		buffer[size] = '\0';
		pr_err("%s: wcnss subsystem failure reason: %s\n",
				__func__, buffer);
		memset(smem_reset_reason, 0, smem_reset_size);
		wmb();
	}

	ss_restart_inprogress = true;
	subsystem_restart_dev(riva_8960_dev);
}