Merge "soc: qcom: ssr: Return from acknowledgment wait if modem is crashed"
This commit is contained in:
commit
5038545dd9
1 changed files with 25 additions and 19 deletions
|
@ -572,25 +572,6 @@ static void disable_all_irqs(struct subsys_device *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int wait_for_shutdown_ack(struct subsys_desc *desc)
|
|
||||||
{
|
|
||||||
int count;
|
|
||||||
|
|
||||||
if (desc && !desc->shutdown_ack_gpio)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
for (count = SHUTDOWN_ACK_MAX_LOOPS; count > 0; count--) {
|
|
||||||
if (gpio_get_value(desc->shutdown_ack_gpio))
|
|
||||||
return count;
|
|
||||||
msleep(SHUTDOWN_ACK_DELAY_MS);
|
|
||||||
}
|
|
||||||
|
|
||||||
pr_err("[%s]: Timed out waiting for shutdown ack\n", desc->name);
|
|
||||||
|
|
||||||
return -ETIMEDOUT;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(wait_for_shutdown_ack);
|
|
||||||
|
|
||||||
static int wait_for_err_ready(struct subsys_device *subsys)
|
static int wait_for_err_ready(struct subsys_device *subsys)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -768,6 +749,31 @@ int subsystem_set_fwname(const char *name, const char *fw_name)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(subsystem_set_fwname);
|
EXPORT_SYMBOL(subsystem_set_fwname);
|
||||||
|
|
||||||
|
int wait_for_shutdown_ack(struct subsys_desc *desc)
|
||||||
|
{
|
||||||
|
int count;
|
||||||
|
struct subsys_device *dev;
|
||||||
|
|
||||||
|
if (!desc || !desc->shutdown_ack_gpio)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
dev = find_subsys(desc->name);
|
||||||
|
if (!dev)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
for (count = SHUTDOWN_ACK_MAX_LOOPS; count > 0; count--) {
|
||||||
|
if (gpio_get_value(desc->shutdown_ack_gpio))
|
||||||
|
return count;
|
||||||
|
else if (subsys_get_crash_status(dev))
|
||||||
|
break;
|
||||||
|
msleep(SHUTDOWN_ACK_DELAY_MS);
|
||||||
|
}
|
||||||
|
|
||||||
|
pr_err("[%s]: Timed out waiting for shutdown ack\n", desc->name);
|
||||||
|
return -ETIMEDOUT;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(wait_for_shutdown_ack);
|
||||||
|
|
||||||
void *__subsystem_get(const char *name, const char *fw_name)
|
void *__subsystem_get(const char *name, const char *fw_name)
|
||||||
{
|
{
|
||||||
struct subsys_device *subsys;
|
struct subsys_device *subsys;
|
||||||
|
|
Loading…
Add table
Reference in a new issue