From 6bff031bac62f7a4ee830cb2d2c593ceb29e6541 Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Thu, 24 Nov 2011 11:39:41 +0530 Subject: u8500-shrm: check for modem status while writing to GOP While writing to the modem GOP registers, check if modem is in reset else writing to GOP registers while modem being in reset will lead to system dreeze. ST-Ericsson Linux next: NA ST-Ericsson ID: 375164 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ic4534c1b9c9eee09eb09fad298adddc6bfcb7c3f Signed-off-by: Arun Murthy Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/39433 Reviewed-by: QABUILD Reviewed-by: Srinidhi KASAGAR --- drivers/modem/shrm/shrm_protocol.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/modem/shrm/shrm_protocol.c b/drivers/modem/shrm/shrm_protocol.c index 19644ca8742..82fed247969 100644 --- a/drivers/modem/shrm/shrm_protocol.c +++ b/drivers/modem/shrm/shrm_protocol.c @@ -450,6 +450,12 @@ void shm_ca_sleep_req_work(struct kthread_work *work) shrm_common_rx_state = SHRM_IDLE; shrm_audio_rx_state = SHRM_IDLE; + if (check_modem_in_reset()) { + dev_err(shm_dev->dev, "%s:Modem state reset or unknown\n", + __func__); + return; + } + writel((1<intr_base + GOP_SET_REGISTER_BASE); @@ -478,6 +484,13 @@ void shm_ca_wake_req_work(struct kthread_work *work) dev_info(shrm->dev, "Initiating a modem reset\n"); prcmu_modem_reset(); } + + if (check_modem_in_reset()) { + dev_err(shrm->dev, "%s:Modem state reset or unknown\n", + __func__); + return; + } + writel((1<intr_base + GOP_SET_REGISTER_BASE); } @@ -625,6 +638,12 @@ static void send_ac_msg_pend_notify_0_work(struct kthread_work *work) prcmu_modem_reset(); } + if (check_modem_in_reset()) { + dev_err(shrm->dev, "%s:Modem state reset or unknown.\n", + __func__); + return; + } + /* Trigger AcMsgPendingNotification to CMU */ writel((1<intr_base + GOP_SET_REGISTER_BASE); @@ -655,6 +674,12 @@ static void send_ac_msg_pend_notify_1_work(struct kthread_work *work) prcmu_modem_reset(); } + if (check_modem_in_reset()) { + dev_err(shrm->dev, "%s:Modem state reset or unknown.\n", + __func__); + return; + } + /* Trigger AcMsgPendingNotification to CMU */ writel((1<intr_base + GOP_SET_REGISTER_BASE); -- cgit v1.2.3