From d4c786a1f8566daf85e01177286609f68b6a4b8c Mon Sep 17 00:00:00 2001 From: Prudhvi Yarlagadda Date: Sat, 8 Feb 2020 16:42:09 +0530 Subject: [PATCH] slim-msm-ngd: Check current state of sub system restart notifier Check for the current state of sub system restart notifier when the LOCATOR_UP notification is given to slimbus driver and do the slimbus initialization if the current state is already set to SERVREG_NOTIF_SERVICE_STATE_UP_V01. This change is needed in the cases where LOCATOR_UP notification to slimbus driver got delayed and the state of the sub system restart notifier is already set to SERVREG_NOTIF_SERVICE_STATE_UP_V01 as slimbus will be expecting the SERVREG_NOTIF_SERVICE_STATE_UP_V01 notification which is not going to come as the notifier state is already changed. Change-Id: I4804bbb13e065ac78be7a442993286532402db9d Signed-off-by: Prudhvi Yarlagadda Signed-off-by: Chandana Kishori Chiluveru --- drivers/slimbus/slim-msm-ngd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/slimbus/slim-msm-ngd.c b/drivers/slimbus/slim-msm-ngd.c index 0f42f543d9c1..08206019d917 100644 --- a/drivers/slimbus/slim-msm-ngd.c +++ b/drivers/slimbus/slim-msm-ngd.c @@ -279,7 +279,7 @@ static int dsp_domr_notify_cb(struct notifier_block *n, unsigned long code, break; case SUBSYS_AFTER_POWERUP: case SERVREG_NOTIF_SERVICE_STATE_UP_V01: - SLIM_INFO(dev, "SLIM DSP SSR notify cb:0x%lx\n", code); + SLIM_INFO(dev, "SLIM DSP SSR notify cb:0x%x\n", code); atomic_set(&dev->ssr_in_progress, 0); schedule_work(&dev->dsp.dom_up); break; @@ -302,9 +302,15 @@ static int dsp_domr_notify_cb(struct notifier_block *n, unsigned long code, &cur); SLIM_INFO(dev, "reg-PD client:%s with service:%s\n", reg->client_name, reg->service_name); - SLIM_INFO(dev, "reg-PD dom:%s instance:%d, cur:%d\n", + SLIM_INFO(dev, "reg-PD dom:%s instance:%d, cur:0x%x\n", reg->domain_list->name, reg->domain_list->instance_id, cur); + + if (cur == SERVREG_NOTIF_SERVICE_STATE_UP_V01) { + atomic_set(&dev->ssr_in_progress, 0); + schedule_work(&dev->dsp.dom_up); + } + if (IS_ERR_OR_NULL(dev->dsp.domr)) ngd_reg_ssr(dev); else