/* 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(void __iomem *addr, unsigned value) { #ifdef CONFIG_PROC_COMM_TIMEOUT_RESET unsigned long timeout = TIMEOUT; #endif for (;;) { if (readl(addr) == value) return 0; if (msm_check_for_modem_crash) if (msm_check_for_modem_crash()) return -EAGAIN; #ifdef CONFIG_PROC_COMM_TIMEOUT_RESET udelay(1); if (timeout-- == 0) { if (msm_hw_reset_hook) { pr_err("proc_comm: TIMEOUT. modem has probably " "crashed.\n"); msm_pm_flush_console(); msm_hw_reset_hook(); } else { pr_err("proc_comm: TIMEOUT. modem has probably " "crashed. retrying.\n"); msm_pm_flush_console(); } timeout = TIMEOUT; } #endif } }
/* 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(void __iomem *addr, unsigned value) { for (;;) { if (readl(addr) == value) return 0; if (msm_check_for_modem_crash) if (msm_check_for_modem_crash()) return -EAGAIN; } }
/* 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 (msm_check_for_modem_crash) if (msm_check_for_modem_crash()) return -EAGAIN; 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) { if (readl(addr) == value) return 0; if (msm_check_for_modem_crash) { if (msm_check_for_modem_crash()) return -EAGAIN; // for making ARM11 run normaly despite of ARM9 crashed if (Arm9Crashed) { printk("[HSI] %s : Arm9Crashed -> Go to normal mode\n", __func__); return 0; } } udelay(5); } }