static void rwlock_bug(rwlock_t *lock, const char *msg)
{
	if (!debug_locks_off())
		return;

	printk(KERN_EMERG "BUG: rwlock %s on CPU#%d, %s/%d, %p\n",
		msg, raw_smp_processor_id(), current->comm,
		task_pid_nr(current), lock);
#ifdef CONFIG_DEBUG_SPINLOCK_BITE_ON_BUG
	msm_trigger_wdog_bite();
#elif defined(CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG)
	BUG();
#endif
	dump_stack();
}
static void spin_dump(raw_spinlock_t *lock, const char *msg)
{
	struct task_struct *owner = NULL;

	if (lock->owner && lock->owner != SPINLOCK_OWNER_INIT)
		owner = lock->owner;
	printk(KERN_EMERG "BUG: spinlock %s on CPU#%d, %s/%d\n",
		msg, raw_smp_processor_id(),
		current->comm, task_pid_nr(current));
	printk(KERN_EMERG " lock: %pS, .magic: %08x, .owner: %s/%d, "
			".owner_cpu: %d\n",
		lock, lock->magic,
		owner ? owner->comm : "<none>",
		owner ? task_pid_nr(owner) : -1,
		lock->owner_cpu);
#ifdef CONFIG_DEBUG_SPINLOCK_BITE_ON_BUG
	msm_trigger_wdog_bite();
#elif defined(CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG)
	BUG();
#endif
	dump_stack();
}
Ejemplo n.º 3
0
static void warn_irq_w(struct work_struct *w)
{
	struct mmi_factory_info *info = container_of(w,
						     struct mmi_factory_info,
						     warn_irq_work.work);
	int warn_line = gpio_get_value(info->list[KP_WARN_INDEX].gpio);
	int reset_info = RESET_EXTRA_RESET_KUNPOW_REASON;

	if (!warn_line) {
		pr_info("HW User Reset!\n");
		pr_info("2 sec to Reset.\n");

#ifdef CONFIG_QPNP_POWER_ON
		/* trigger wdog if resin key pressed */
		if (qpnp_pon_key_status & QPNP_PON_KEY_RESIN_BIT) {
			pr_info("User triggered watchdog reset(Pwr + VolDn)\n");
			msm_trigger_wdog_bite();
			return;
		}
#endif
		/* Configure hardware reset before halt
		 * The new KUNGKOW circuit will not disconnect the battery if
		 * usb/dc is connected. But because the kernel is halted, a
		 * watchdog reset will be reported instead of hardware reset.
		 * In this case, we need to clear the KUNPOW reset bit to let
		 * BL detect it as a hardware reset.
		 * A pmic hard reset is necessary to report the powerup reason
		 * to BL correctly.
		 */
		if (usr_rst_sw_dis_flg <= 0) {
			qpnp_pon_store_extra_reset_info(reset_info, 0);
			qpnp_pon_system_pwr_off(PON_POWER_OFF_HARD_RESET);
			kernel_halt();
		} else
			pr_info("SW HALT Disabled!\n");

		return;
	}
}