soc: qcom: ssr: Return from acknowledgment wait if modem is crashed
During graceful shutdown we await acknowledgment before executing reset sequence for subsystem, adding check to evaluate if subsys is crashed in between so that we dont spend time for hopeless ack wait. Change-Id: I34bba1ebc417a3d6daa3b6e0a38c4b519c82c606 Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
This commit is contained in:
parent
6c104f8d40
commit
85689f1c26
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)
|
||||
{
|
||||
int ret;
|
||||
|
@ -768,6 +749,31 @@ int subsystem_set_fwname(const char *name, const char *fw_name)
|
|||
}
|
||||
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)
|
||||
{
|
||||
struct subsys_device *subsys;
|
||||
|
|
Loading…
Add table
Reference in a new issue