Exemplo n.º 1
0
/* Poll for a state change, checking for possible
 * modem crashes along the way (so we don't wait
 * forever while the ARM9 is blowing up.
 *
 * Return an error in the event of a modem crash and
 * restart so the msm_proc_comm() routine can restart
 * the operation from the beginning.
 */
static int proc_comm_wait_for(unsigned addr, unsigned value)
{
	/* merge qcom DEBUG_CODE for RPC crashes */
#ifndef CONFIG_HUAWEI_RPC_CRASH_DEBUG
	while (1) {
		/* Barrier here prevents excessive spinning */
		mb();
		if (readl_relaxed(addr) == value)
			return 0;

		if (smsm_check_for_modem_crash())
			return -EAGAIN;

		udelay(5);
	}
#else
   int ticks = 0;
   int long_wait = 0;

	while (1) {
		/* Barrier here prevents excessive spinning */
		mb();
		if (readl_relaxed(addr) == value) {
			if (long_wait)
				pr_err("%s: total wait time %dus\n", __func__, ticks * 5);
			return 0;
		}
		if (smsm_check_for_modem_crash()) {
			pr_err("%s: modem crashed while writing %x to %x\n",
			    __func__, value, addr);
			if (long_wait)
				pr_err("%s: total wait time %dus\n",
					__func__, ticks * 5);
			return -EAGAIN;
		}
		udelay(5);
		ticks++;
		
		if (ticks == 10000 /* 50 ms */) {
			long_wait = 1;
			pr_err("%s: excessive wait for PCOM\n",
				__func__);
			dump_stack();
		}
	}
#endif
}
Exemplo n.º 2
0
/* Poll for a state change, checking for possible
 * modem crashes along the way (so we don't wait
 * forever while the ARM9 is blowing up.
 *
 * Return an error in the event of a modem crash and
 * restart so the msm_proc_comm() routine can restart
 * the operation from the beginning.
 */
static int proc_comm_wait_for(unsigned addr, unsigned value)
{
    while (1) {
        if (readl(addr) == value)
            return 0;

        if (smsm_check_for_modem_crash())
            return -EAGAIN;

        udelay(5);
    }
}
Exemplo n.º 3
0
/* Poll for a state change, checking for possible
 * modem crashes along the way (so we don't wait
 * forever while the ARM9 is blowing up.
 *
 * Return an error in the event of a modem crash and
 * restart so the msm_proc_comm() routine can restart
 * the operation from the beginning.
 */
static int proc_comm_wait_for(unsigned addr, unsigned value)
{
	while (1) {
		if (readl(addr) == value)
			return 0;
#if defined (CONFIG_QSD_ARM9_CRASH_FUNCTION)
		if (smsm_check_for_modem_crash())
		{
			int ret = smsm_check_for_modem_crash();
			if (ret)
			{
				return ret;
			}
		}
#else /* CONFIG_QSD_ARM9_CRASH_FUNCTION */
		if (smsm_check_for_modem_crash())
			return -EAGAIN;
#endif /* CONFIG_QSD_ARM9_CRASH_FUNCTION */
		udelay(5);
	}
}
/* Poll for a state change, checking for possible
 * modem crashes along the way (so we don't wait
 * forever while the ARM9 is blowing up.
 *
 * Return an error in the event of a modem crash and
 * restart so the msm_proc_comm() routine can restart
 * the operation from the beginning.
 */
static int proc_comm_wait_for(unsigned addr, unsigned value)
{
	while (1) {
		/* Barrier here prevents excessive spinning */
		mb();
		if (readl_relaxed(addr) == value)
			return 0;

		if (smsm_check_for_modem_crash())
			return -EAGAIN;

		udelay(5);
	}
}