diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c index fcfbce642217..3bcc98261b43 100644 --- a/drivers/soc/qcom/smp2p.c +++ b/drivers/soc/qcom/smp2p.c @@ -19,6 +19,8 @@ #include #include +#include + /* * The Shared Memory Point to Point (SMP2P) protocol facilitates communication * of a single 32-bit value between two processors. Each value has a single @@ -158,6 +160,14 @@ struct qcom_smp2p { struct list_head outbound; }; +static void *ilc; +#define SMP2P_LOG_PAGE_CNT 2 +#define SMP2P_INFO(x, ...) \ +do { \ + if (ilc) \ + ipc_log_string(ilc, "[%s]: "x, __func__, ##__VA_ARGS__); \ +} while (0) + static void qcom_smp2p_kick(struct qcom_smp2p *smp2p) { /* Make sure any updated data is written before the kick */ @@ -183,6 +193,7 @@ static bool qcom_smp2p_check_ssr(struct qcom_smp2p *smp2p) if (restart == smp2p->ssr_ack) return false; + SMP2P_INFO("%d: SSR DETECTED\n", smp2p->remote_pid); return true; } @@ -216,6 +227,8 @@ static void qcom_smp2p_negotiate(struct qcom_smp2p *smp2p) smp2p->ssr_ack_enabled = true; smp2p->open = true; + SMP2P_INFO("%d: state=open ssr_ack=%d\n", smp2p->remote_pid, + smp2p->ssr_ack_enabled); } } @@ -257,6 +270,9 @@ static void qcom_smp2p_notify_in(struct qcom_smp2p *smp2p) if (!status) continue; + SMP2P_INFO("%d: %s: status:%0x val:%0x\n", + smp2p->remote_pid, entry->name, status, val); + for_each_set_bit(i, &status, 32) { if ((val & BIT(i) && test_bit(i, entry->irq_rising)) || (!(val & BIT(i)) && test_bit(i, entry->irq_falling))) { @@ -528,6 +544,9 @@ static int qcom_smp2p_probe(struct platform_device *pdev) const char *key; int ret; + if (!ilc) + ilc = ipc_log_context_create(SMP2P_LOG_PAGE_CNT, "smp2p", 0); + smp2p = devm_kzalloc(&pdev->dev, sizeof(*smp2p), GFP_KERNEL); if (!smp2p) return -ENOMEM;