lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240603073648.3475123-1-quic_deesin@quicinc.com>
Date: Mon, 3 Jun 2024 13:06:48 +0530
From: Deepak Kumar Singh <quic_deesin@...cinc.com>
To: <quic_bjorande@...cinc.com>, <andersson@...nel.org>,
        <quic_clew@...cinc.com>, <mathieu.poirier@...aro.org>
CC: <linux-kernel@...r.kernel.org>, <quic_sarannya@...cinc.com>,
        <linux-arm-msm@...r.kernel.org>, <linux-remoteproc@...r.kernel.org>,
        "Deepak
 Kumar Singh" <quic_deesin@...cinc.com>
Subject: [PATCH V1] rpmsg: glink: Make glink smem interrupt wakeup capable

There are certain usecases which require glink interrupt to be
wakeup capable. For example if handset is in sleep state and
usb charger is plugged in, dsp wakes up and sends glink interrupt
to host for glink pmic channel communication. Glink is suppose to
wakeup host processor completely for further glink data handling.
IRQF_NO_SUSPEND does not gurantee complete wakeup, system may again
enter sleep after interrupt handling and glink data may not be
handled by pmic client driver.

To ensure data handling by client configure glink smem device as
wakeup source and attach glink interrupt as wakeup irq. Remove
IRQF_NO_SUSPEND flag as it is no longer required.

Signed-off-by: Deepak Kumar Singh <quic_deesin@...cinc.com>
---
 drivers/rpmsg/qcom_glink_smem.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c
index 7a982c60a8dd..f1b553efab13 100644
--- a/drivers/rpmsg/qcom_glink_smem.c
+++ b/drivers/rpmsg/qcom_glink_smem.c
@@ -22,6 +22,7 @@
 #include <linux/regmap.h>
 #include <linux/workqueue.h>
 #include <linux/list.h>
+#include <linux/pm_wakeirq.h>
 
 #include <linux/rpmsg/qcom_glink.h>
 
@@ -306,8 +307,7 @@ struct qcom_glink_smem *qcom_glink_smem_register(struct device *parent,
 
 	smem->irq = of_irq_get(smem->dev.of_node, 0);
 	ret = devm_request_irq(&smem->dev, smem->irq, qcom_glink_smem_intr,
-			       IRQF_NO_SUSPEND | IRQF_NO_AUTOEN,
-			       "glink-smem", smem);
+			       IRQF_NO_AUTOEN, "glink-smem", smem);
 	if (ret) {
 		dev_err(&smem->dev, "failed to request IRQ\n");
 		goto err_put_dev;
@@ -346,6 +346,8 @@ struct qcom_glink_smem *qcom_glink_smem_register(struct device *parent,
 
 	smem->glink = glink;
 
+	device_init_wakeup(dev, true);
+	dev_pm_set_wake_irq(dev, smem->irq);
 	enable_irq(smem->irq);
 
 	return smem;
@@ -365,6 +367,8 @@ void qcom_glink_smem_unregister(struct qcom_glink_smem *smem)
 	struct qcom_glink *glink = smem->glink;
 
 	disable_irq(smem->irq);
+	dev_pm_clear_wake_irq(&smem->dev);
+	device_init_wakeup(&smem->dev, false);
 
 	qcom_glink_native_remove(glink);
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ