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

Commit bbe98cb3 authored by Arun Prakash's avatar Arun Prakash
Browse files

soc: qcom: smp2p: Implementing thaw callback



Implementing thaw callback in smp2p driver to avoid
device hang in wakeup source trash since freeze gets
called twise in consecitive cycle and restore never
get called in case of hibernation failure which will
cause consecutive execution of the wakeup source trash
API.

Change-Id: I129739b590eefd18c556603f2bba22d9022ae2c7
Signed-off-by: default avatarArun Prakash <app@codeaurora.org>
parent 3db6f4c3
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -720,7 +720,7 @@ static int qcom_smp2p_remove(struct platform_device *pdev)
	return 0;
}

static int qcom_smp2p_resume(struct device *dev)
static int qcom_smp2p_restore(struct device *dev)
{
	int ret = 0;
	struct qcom_smp2p *smp2p = dev_get_drvdata(dev);
@@ -757,6 +757,7 @@ static int qcom_smp2p_resume(struct device *dev)
	}
	wakeup_source_init(&smp2p->ws, "smp2p");

	enable_irq_wake(smp2p->irq);
	/* Kick the outgoing edge after allocating entries */
	qcom_smp2p_kick(smp2p);

@@ -767,12 +768,13 @@ static int qcom_smp2p_resume(struct device *dev)
	return ret;
}

static int qcom_smp2p_suspend(struct device *dev)
static int qcom_smp2p_freeze(struct device *dev)
{
	struct qcom_smp2p *smp2p = dev_get_drvdata(dev);
	struct smp2p_entry *entry;
	struct smp2p_entry *next_entry;

	disable_irq_wake(smp2p->irq);
	/* Walk through the out bound list and release state and entry */
	list_for_each_entry_safe(entry, next_entry, &smp2p->outbound, node) {
		qcom_smem_state_unregister(entry->state);
@@ -794,8 +796,9 @@ static int qcom_smp2p_suspend(struct device *dev)
}

static const struct dev_pm_ops qcom_smp2p_pm_ops = {
	.freeze = qcom_smp2p_suspend,
	.restore = qcom_smp2p_resume,
	.freeze = qcom_smp2p_freeze,
	.restore = qcom_smp2p_restore,
	.thaw = qcom_smp2p_restore,
};

static const struct of_device_id qcom_smp2p_of_match[] = {