Commit c25f7789 authored by Prasad Sodagudi's avatar Prasad Sodagudi Committed by Jassi Brar

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: default avatarManivannan Sadhasivam <mani@kernel.org>
Signed-off-by: default avatarPrasad Sodagudi <quic_psodagud@quicinc.com>
Signed-off-by: default avatarSibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 369e4ef8
...@@ -255,6 +255,24 @@ static int qcom_ipcc_setup_mbox(struct qcom_ipcc *ipcc, ...@@ -255,6 +255,24 @@ static int qcom_ipcc_setup_mbox(struct qcom_ipcc *ipcc,
return devm_mbox_controller_register(dev, mbox); return devm_mbox_controller_register(dev, mbox);
} }
static int qcom_ipcc_pm_resume(struct device *dev)
{
struct qcom_ipcc *ipcc = dev_get_drvdata(dev);
u32 hwirq;
int virq;
hwirq = readl(ipcc->base + IPCC_REG_RECV_ID);
if (hwirq == IPCC_NO_PENDING_IRQ)
return 0;
virq = irq_find_mapping(ipcc->irq_domain, hwirq);
dev_dbg(dev, "virq: %d triggered client-id: %ld; signal-id: %ld\n", virq,
FIELD_GET(IPCC_CLIENT_ID_MASK, hwirq), FIELD_GET(IPCC_SIGNAL_ID_MASK, hwirq));
return 0;
}
static int qcom_ipcc_probe(struct platform_device *pdev) static int qcom_ipcc_probe(struct platform_device *pdev)
{ {
struct qcom_ipcc *ipcc; struct qcom_ipcc *ipcc;
...@@ -325,6 +343,10 @@ static const struct of_device_id qcom_ipcc_of_match[] = { ...@@ -325,6 +343,10 @@ static const struct of_device_id qcom_ipcc_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, qcom_ipcc_of_match); MODULE_DEVICE_TABLE(of, qcom_ipcc_of_match);
static const struct dev_pm_ops qcom_ipcc_dev_pm_ops = {
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, qcom_ipcc_pm_resume)
};
static struct platform_driver qcom_ipcc_driver = { static struct platform_driver qcom_ipcc_driver = {
.probe = qcom_ipcc_probe, .probe = qcom_ipcc_probe,
.remove = qcom_ipcc_remove, .remove = qcom_ipcc_remove,
...@@ -332,6 +354,7 @@ static struct platform_driver qcom_ipcc_driver = { ...@@ -332,6 +354,7 @@ static struct platform_driver qcom_ipcc_driver = {
.name = "qcom-ipcc", .name = "qcom-ipcc",
.of_match_table = qcom_ipcc_of_match, .of_match_table = qcom_ipcc_of_match,
.suppress_bind_attrs = true, .suppress_bind_attrs = true,
.pm = pm_sleep_ptr(&qcom_ipcc_dev_pm_ops),
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment