From 3f42369d8f80346e7abb494474985c60be7f503b Mon Sep 17 00:00:00 2001 From: Chandana Kishori Chiluveru Date: Sat, 6 Feb 2021 13:11:20 +0530 Subject: [PATCH] slim-msm-ngd: Fix unbalanced core irq disable from ndg_slim_enable The 'commit 5adc2a6e19ffc2 ("slim-msm-ngd: Disable core irq in SSR/PDR Down notification")' added irq_enable and disable from ngd_slim_enable function. irq will be enabled only if msm_slim_qmi_init success where as disabled by default in else block. If QMI init is failed we will disable the IRQ twice during SSR testing. As the interrupt line is not enabled, capability exchange is timing out and leading to freed memory access inside ngd_xfer_msg. Move irq enable in ndg_slim_enable without depending on QMI init. Change-Id: Id32b0d283b1653bb4085231694031b0df126cf4b Signed-off-by: Chandana Kishori Chiluveru --- drivers/slimbus/slim-msm-ngd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/slimbus/slim-msm-ngd.c b/drivers/slimbus/slim-msm-ngd.c index e4ec93fc31c9..4ed5357a42e1 100644 --- a/drivers/slimbus/slim-msm-ngd.c +++ b/drivers/slimbus/slim-msm-ngd.c @@ -1541,10 +1541,10 @@ static int ngd_slim_enable(struct msm_slim_ctrl *dev, bool enable) int ret = 0; if (enable) { + enable_irq(dev->irq); ret = msm_slim_qmi_init(dev, false); /* controller state should be in sync with framework state */ if (!ret) { - enable_irq(dev->irq); complete(&dev->qmi.qmi_comp); if (!pm_runtime_enabled(dev->dev) || !pm_runtime_suspended(dev->dev))