本文整理汇总了C++中smsm_get_state函数的典型用法代码示例。如果您正苦于以下问题:C++ smsm_get_state函数的具体用法?C++ smsm_get_state怎么用?C++ smsm_get_state使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smsm_get_state函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: modem_fatal_fn
static void modem_fatal_fn(struct work_struct *work)
{
u32 modem_state;
u32 panic_smsm_states = SMSM_RESET | SMSM_SYSTEM_DOWNLOAD;
u32 reset_smsm_states = SMSM_SYSTEM_REBOOT_USR | SMSM_SYSTEM_PWRDWN_USR;
struct modem_data *drv;
drv = container_of(work, struct modem_data, fatal_work);
pr_err("Watchdog bite received from modem!\n");
modem_state = smsm_get_state(SMSM_MODEM_STATE);
pr_err("Modem SMSM state = 0x%x!\n", modem_state);
if (modem_state == 0 || modem_state & panic_smsm_states) {
subsystem_restart_dev(drv->subsys);
enable_irq(drv->irq);
} else if (modem_state & reset_smsm_states) {
pr_err("User-invoked system reset/powerdown.");
kernel_restart(NULL);
} else {
unsigned long timeout = msecs_to_jiffies(6000);
pr_err("Modem AHB locked up. Trying to free up modem!\n");
writel_relaxed(0x3, drv->cbase + MSS_MODEM_RESET);
/*
* If we are still alive (allowing for the 5 second
* delayed-panic-reboot), the modem is either still wedged or
* SMSM didn't come through. Force panic in that case.
*/
schedule_delayed_work(&drv->unlock_work, timeout);
}
}
示例2: modem_shutdown
static int modem_shutdown(const struct subsys_desc *subsys)
{
struct modem_data *drv;
drv = container_of(subsys, struct modem_data, subsys_desc);
/*
* If the modem didn't already crash, setting SMSM_RESET here will help
* flush caches etc. The ignore_smsm_ack flag is set to ignore the
* SMSM_RESET notification that is generated due to the modem settings
* its own SMSM_RESET bit in response to the apps setting the apps
* SMSM_RESET bit.
*/
if (!(smsm_get_state(SMSM_MODEM_STATE) & SMSM_RESET)) {
drv->ignore_smsm_ack = 1;
smsm_reset_modem(SMSM_RESET);
}
/* Disable the modem watchdog to allow clean modem bootup */
writel_relaxed(0x0, drv->wdog + 0x8);
/*
* The write above needs to go through before the modem is powered up
* again.
*/
mb();
/* Wait here to allow the modem to clean up caches, etc. */
msleep(20);
pil_shutdown(&drv->pil_desc);
disable_irq_nosync(drv->irq);
return 0;
}
示例3: modem_sw_fatal_fn
static void modem_sw_fatal_fn(struct work_struct *work)
{
uint32_t panic_smsm_states = SMSM_RESET | SMSM_SYSTEM_DOWNLOAD;
uint32_t reset_smsm_states = SMSM_SYSTEM_REBOOT_USR |
SMSM_SYSTEM_PWRDWN_USR;
uint32_t modem_state;
pr_err("Watchdog bite received from modem SW!\n");
modem_state = smsm_get_state(SMSM_MODEM_STATE);
if (modem_state & panic_smsm_states) {
pr_err("Modem SMSM state changed to SMSM_RESET.\n"
"Probable err_fatal on the modem. "
"Calling subsystem restart...\n");
subsystem_restart("modem");
} else if (modem_state & reset_smsm_states) {
pr_err("%s: User-invoked system reset/powerdown. "
"Resetting the SoC now.\n",
__func__);
kernel_restart(NULL);
} else {
/* TODO: Bus unlock code/sequence goes _here_ */
subsystem_restart("modem");
}
}
示例4: msm_irq_exit_sleep3
/*
* Restore interrupt subsystem from sleep -- phase 3.
* Print debug information.
*/
void msm_irq_exit_sleep3(uint32_t irq_mask, uint32_t wakeup_reason,
uint32_t pending_irqs)
{
if (msm_irq_debug_mask & IRQ_DEBUG_SLEEP)
DPRINT_REGS(VIC_IRQ_STATUS, "%s %x %x %x state %x now",
__func__, irq_mask, pending_irqs, wakeup_reason,
smsm_get_state(SMSM_MODEM_STATE));
}
示例5: is_modem_smsm_inited
static uint32_t is_modem_smsm_inited(void)
{
uint32_t modem_state;
uint32_t ready_state = (SMSM_INIT | SMSM_SMDINIT);
modem_state = smsm_get_state(SMSM_MODEM_STATE);
return (modem_state & ready_state) == ready_state;
}
示例6: msm_gic_irq_exit_sleep3
/*
* Restore interrupt subsystem from sleep -- phase 3
* Print debug information
*/
void msm_gic_irq_exit_sleep3(uint32_t irq_mask, uint32_t wakeup_reason,
uint32_t pending_irqs)
{
if (msm_gic_irq_debug_mask & IRQ_DEBUG_SLEEP)
pr_info("%s, irq_mask %x pending_irqs %x, wakeup_reason %x,"
"state %x now\n", __func__, irq_mask,
pending_irqs, wakeup_reason,
smsm_get_state(SMSM_MODEM_STATE));
}
示例7: msm_irq_exit_sleep3
/*
* Restore interrupt subsystem from sleep -- phase 3.
* Print debug information.
*/
void msm_irq_exit_sleep3(uint32_t irq_mask, uint32_t wakeup_reason,
uint32_t pending_irqs)
{
if (msm_irq_debug_mask & IRQ_DEBUG_SLEEP)
printk(KERN_INFO "%s %x %x %x now %x %x state %x\n",
__func__, irq_mask, pending_irqs, wakeup_reason,
readl(VIC_IRQ_STATUS0), readl(VIC_IRQ_STATUS1),
smsm_get_state(SMSM_MODEM_STATE));
}
示例8: msm_pm_modem_busy
static int msm_pm_modem_busy(void)
{
if (!(smsm_get_state(SMSM_POWER_MASTER_DEM) & DEM_MASTER_SMSM_READY)) {
MSM_PM_DPRINTK(MSM_PM_DEBUG_POWER_COLLAPSE,
KERN_INFO, "%s(): master not ready\n", __func__);
return -EBUSY;
}
return 0;
}
示例9: modem_crash_shutdown
static void modem_crash_shutdown(const struct subsys_desc *subsys)
{
struct modem_data *drv;
/* If modem hasn't already crashed, send SMSM_RESET. */
drv = container_of(subsys, struct modem_data, subsys_desc);
if (!(smsm_get_state(SMSM_MODEM_STATE) & SMSM_RESET)) {
modem_unregister_notifier(&drv->notifier);
smsm_reset_modem(SMSM_RESET);
}
/* Wait to allow the modem to clean up caches etc. */
mdelay(5);
}
示例10: modem_crash_shutdown
static void modem_crash_shutdown(const struct subsys_desc *subsys)
{
struct modem_data *drv;
drv = container_of(subsys, struct modem_data, subsys_desc);
if (!(smsm_get_state(SMSM_MODEM_STATE) & SMSM_RESET)) {
modem_unregister_notifier(&drv->notifier);
smsm_reset_modem(SMSM_RESET);
}
mdelay(5);
}
示例11: msm_irq_exit_sleep3
void msm_irq_exit_sleep3(void)
{
if (!smsm_int_info) {
printk(KERN_ERR "msm_irq_exit_sleep <SM NO INT_INFO>\n");
return;
}
if (msm_irq_debug_mask & IRQ_DEBUG_SLEEP)
printk(KERN_INFO "msm_irq_exit_sleep3 %x %x %x now %x %x "
"state %x\n", smsm_int_info->interrupt_mask,
smsm_int_info->pending_interrupts,
smsm_int_info->wakeup_reason, readl(VIC_IRQ_STATUS0),
readl(VIC_IRQ_STATUS1),
smsm_get_state(SMSM_STATE_MODEM));
}
示例12: modem_shutdown
static int modem_shutdown(const struct subsys_data *subsys)
{
void __iomem *q6_fw_wdog_addr;
void __iomem *q6_sw_wdog_addr;
int smsm_notif_unregistered = 0;
if (!(smsm_get_state(SMSM_MODEM_STATE) & SMSM_RESET)) {
smsm_state_cb_deregister(SMSM_MODEM_STATE, SMSM_RESET,
smsm_state_cb, 0);
smsm_notif_unregistered = 1;
smsm_reset_modem(SMSM_RESET);
}
/*
* Cancel any pending wdog_check work items, since we're shutting
* down anyway.
*/
cancel_delayed_work(&modem_wdog_check_work);
/*
* Disable the modem watchdog since it keeps running even after the
* modem is shutdown.
*/
q6_fw_wdog_addr = ioremap_nocache(Q6_FW_WDOG_ENABLE, 4);
if (!q6_fw_wdog_addr)
return -ENOMEM;
q6_sw_wdog_addr = ioremap_nocache(Q6_SW_WDOG_ENABLE, 4);
if (!q6_sw_wdog_addr) {
iounmap(q6_fw_wdog_addr);
return -ENOMEM;
}
writel_relaxed(0x0, q6_fw_wdog_addr);
writel_relaxed(0x0, q6_sw_wdog_addr);
mb();
iounmap(q6_sw_wdog_addr);
iounmap(q6_fw_wdog_addr);
pil_force_shutdown("modem");
pil_force_shutdown("modem_fw");
disable_irq_nosync(Q6FW_WDOG_EXPIRED_IRQ);
disable_irq_nosync(Q6SW_WDOG_EXPIRED_IRQ);
if (smsm_notif_unregistered)
smsm_state_cb_register(SMSM_MODEM_STATE, SMSM_RESET,
smsm_state_cb, 0);
return 0;
}
示例13: msm_irq_exit_sleep3
void msm_irq_exit_sleep3(void)
{
if (!smsm_int_info) {
printk(KERN_ERR "msm_irq_exit_sleep <SM NO INT_INFO>\n");
return;
}
if (msm_irq_debug_mask & IRQ_DEBUG_SLEEP) {
printk(KERN_INFO "%s %x %x %x state %x now", __func__,
smsm_int_info->interrupt_mask,
smsm_int_info->pending_interrupts,
smsm_int_info->wakeup_reason,
smsm_get_state(SMSM_STATE_MODEM));
print_vic_irq_stat();
}
}
示例14: modem_fatal_fn
static void modem_fatal_fn(struct work_struct *work)
{
uint32_t modem_state;
uint32_t panic_smsm_states = SMSM_RESET | SMSM_SYSTEM_DOWNLOAD;
uint32_t reset_smsm_states = SMSM_SYSTEM_REBOOT_USR |
SMSM_SYSTEM_PWRDWN_USR;
pr_err("%s: Watchdog bite received from modem!\n", MODULE_NAME);
modem_state = smsm_get_state(SMSM_MODEM_STATE);
pr_err("%s: Modem SMSM state = 0x%x!", MODULE_NAME, modem_state);
if (modem_state == 0 || modem_state & panic_smsm_states) {
subsystem_restart("modem");
enable_irq(MARM_WDOG_EXPIRED);
} else if (modem_state & reset_smsm_states) {
pr_err("%s: User-invoked system reset/powerdown.",
MODULE_NAME);
soc_restart(RESTART_MODE_MODEM_WATCHDOG_BITE, "MODEM DOG!");
} else {
int ret;
void *hwio_modem_reset_addr =
ioremap_nocache(MODEM_HWIO_MSS_RESET_ADDR, 8);
pr_err("%s: Modem AHB locked up.\n", MODULE_NAME);
pr_err("%s: Trying to free up modem!\n", MODULE_NAME);
/* We don't want it happens */
BUG_ON(!hwio_modem_reset_addr);
writel(0x3, hwio_modem_reset_addr);
/* If we are still alive after 6 seconds (allowing for
* the 5-second-delayed-panic-reboot), modem is either
* still wedged or SMSM didn't come through. Force panic
* in that case.
*/
ret = schedule_delayed_work(&modem_unlock_timeout_work,
msecs_to_jiffies(6000));
iounmap(hwio_modem_reset_addr);
}
}
示例15: msm_pm_wait_state
static int
msm_pm_wait_state(uint32_t wait_all_set, uint32_t wait_all_clear,
uint32_t wait_any_set, uint32_t wait_any_clear)
{
int i;
uint32_t state;
for (i = 0; i < 100000; i++) {
state = smsm_get_state(PM_SMSM_READ_STATE);
if (((wait_all_set || wait_all_clear) &&
!(~state & wait_all_set) && !(state & wait_all_clear)) ||
(state & wait_any_set) || (~state & wait_any_clear))
return 0;
udelay(1);
}
pr_err("msm_pm_wait_state(%x, %x, %x, %x) failed %x\n", wait_all_set,
wait_all_clear, wait_any_set, wait_any_clear, state);
return -ETIMEDOUT;
}