Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5038545d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: ssr: Return from acknowledgment wait if modem is crashed"

parents 6ae0998a 85689f1c
Loading
Loading
Loading
Loading
+25 −19
Original line number Diff line number Diff line
@@ -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;