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

Commit 4dc0a0aa authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: smp2p: Prevent suspend for threaded irq"

parents 10177516 9dcdb6f5
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <linux/soc/qcom/smem.h>
#include <linux/soc/qcom/smem_state.h>
#include <linux/spinlock.h>
#include <linux/pm_wakeup.h>

#include <linux/ipc_logging.h>

@@ -160,6 +161,7 @@ struct qcom_smp2p {
	struct regmap *ipc_regmap;
	int ipc_offset;
	int ipc_bit;
	struct wakeup_source ws;

	struct mbox_client mbox_client;
	struct mbox_chan *mbox_chan;
@@ -296,6 +298,14 @@ static void qcom_smp2p_notify_in(struct qcom_smp2p *smp2p)
	}
}

static irqreturn_t qcom_smp2p_isr(int irq, void *data)
{
	struct qcom_smp2p *smp2p = data;

	__pm_stay_awake(&smp2p->ws);
	return IRQ_WAKE_THREAD;
}

/**
 * qcom_smp2p_intr() - interrupt handler for incoming notifications
 * @irq:	unused
@@ -320,7 +330,7 @@ static irqreturn_t qcom_smp2p_intr(int irq, void *data)
		if (IS_ERR(in)) {
			dev_err(smp2p->dev,
				"Unable to acquire remote smp2p item\n");
			return IRQ_HANDLED;
			goto out;
		}

		smp2p->in = in;
@@ -339,6 +349,8 @@ static irqreturn_t qcom_smp2p_intr(int irq, void *data)
			qcom_smp2p_do_ssr_ack(smp2p);
	}

out:
	__pm_relax(&smp2p->ws);
	return IRQ_HANDLED;
}

@@ -639,12 +651,13 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
			list_add(&entry->node, &smp2p->outbound);
		}
	}
	wakeup_source_init(&smp2p->ws, "smp2p");

	/* Kick the outgoing edge after allocating entries */
	qcom_smp2p_kick(smp2p);

	ret = devm_request_threaded_irq(&pdev->dev, smp2p->irq,
					NULL, qcom_smp2p_intr,
					qcom_smp2p_isr, qcom_smp2p_intr,
					IRQF_NO_SUSPEND | IRQF_ONESHOT,
					"smp2p", (void *)smp2p);
	if (ret) {