Skip to content

Commit c25f778

Browse files
Prasad SodagudiJassiBrar
authored andcommitted
mailbox: qcom-ipcc: Log the pending interrupt during resume
Enable logging of the pending interrupt that triggered device wakeup. This logging information helps to debug IRQs that cause periodic device wakeups by printing the detailed information of pending IPCC interrupts. Scenario: Device wakeup caused by Modem crash Logs: qcom-ipcc mailbox: virq: 182 triggered client-id: 2; signal-id: 2 From the IPCC bindings it can further be understood that the client here is IPCC_CLIENT_MPSS and the signal was IPCC_MPROC_SIGNAL_SMP2P. Reviewed-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Prasad Sodagudi <[email protected]> Signed-off-by: Sibi Sankar <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent 369e4ef commit c25f778

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

drivers/mailbox/qcom-ipcc.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,24 @@ static int qcom_ipcc_setup_mbox(struct qcom_ipcc *ipcc,
255255
return devm_mbox_controller_register(dev, mbox);
256256
}
257257

258+
static int qcom_ipcc_pm_resume(struct device *dev)
259+
{
260+
struct qcom_ipcc *ipcc = dev_get_drvdata(dev);
261+
u32 hwirq;
262+
int virq;
263+
264+
hwirq = readl(ipcc->base + IPCC_REG_RECV_ID);
265+
if (hwirq == IPCC_NO_PENDING_IRQ)
266+
return 0;
267+
268+
virq = irq_find_mapping(ipcc->irq_domain, hwirq);
269+
270+
dev_dbg(dev, "virq: %d triggered client-id: %ld; signal-id: %ld\n", virq,
271+
FIELD_GET(IPCC_CLIENT_ID_MASK, hwirq), FIELD_GET(IPCC_SIGNAL_ID_MASK, hwirq));
272+
273+
return 0;
274+
}
275+
258276
static int qcom_ipcc_probe(struct platform_device *pdev)
259277
{
260278
struct qcom_ipcc *ipcc;
@@ -325,13 +343,18 @@ static const struct of_device_id qcom_ipcc_of_match[] = {
325343
};
326344
MODULE_DEVICE_TABLE(of, qcom_ipcc_of_match);
327345

346+
static const struct dev_pm_ops qcom_ipcc_dev_pm_ops = {
347+
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, qcom_ipcc_pm_resume)
348+
};
349+
328350
static struct platform_driver qcom_ipcc_driver = {
329351
.probe = qcom_ipcc_probe,
330352
.remove = qcom_ipcc_remove,
331353
.driver = {
332354
.name = "qcom-ipcc",
333355
.of_match_table = qcom_ipcc_of_match,
334356
.suppress_bind_attrs = true,
357+
.pm = pm_sleep_ptr(&qcom_ipcc_dev_pm_ops),
335358
},
336359
};
337360

0 commit comments

Comments
 (0)