From 5291976ef6237af47e1644ce1f526315887265f1 Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Mon, 19 Dec 2011 11:31:05 +0530 Subject: u8500-shrm: Ensure not to access GOP register while in MSR ST-Ericsson Linux next: NA ST-Ericsson ID: 402285 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I94eb660c8a06070954c1b8920042ff465a85db84 Signed-off-by: Arun Murthy Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/43027 Reviewed-by: Ashok G X Tested-by: Ashok G X Reviewed-by: Srinidhi KASAGAR --- drivers/modem/shrm/shrm_protocol.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/modem/shrm/shrm_protocol.c b/drivers/modem/shrm/shrm_protocol.c index cbb3a820317..cfa65cda18f 100644 --- a/drivers/modem/shrm/shrm_protocol.c +++ b/drivers/modem/shrm/shrm_protocol.c @@ -448,16 +448,22 @@ void shm_ac_read_notif_1_tasklet(unsigned long tasklet_data) void shm_ca_sleep_req_work(struct kthread_work *work) { + u8 bt_state; + unsigned long flags; + dev_dbg(shm_dev->dev, "%s:IRQ_PRCMU_CA_SLEEP\n", __func__); - shrm_common_rx_state = SHRM_IDLE; - shrm_audio_rx_state = SHRM_IDLE; + spin_lock_irqsave(&boot_lock, flags); + bt_state = boot_state; + spin_unlock_irqrestore(&boot_lock, flags); - if (check_modem_in_reset()) { + if (bt_state != BOOT_DONE) { dev_err(shm_dev->dev, "%s:Modem state reset or unknown\n", __func__); return; } + shrm_common_rx_state = SHRM_IDLE; + shrm_audio_rx_state = SHRM_IDLE; writel((1<intr_base + GOP_SET_REGISTER_BASE); @@ -504,6 +510,10 @@ static int shrm_modem_reset_sequence(void) unsigned long flags; hrtimer_cancel(&timer); + tasklet_disable_nosync(&shm_ac_read_0_tasklet); + tasklet_disable_nosync(&shm_ac_read_1_tasklet); + tasklet_disable_nosync(&shm_ca_0_tasklet); + tasklet_disable_nosync(&shm_ca_1_tasklet); /* * keep the count to 0 so that we can bring down the line @@ -536,6 +546,10 @@ static int shrm_modem_reset_sequence(void) boot_state = BOOT_INIT; spin_unlock_irqrestore(&boot_lock, flags); + tasklet_enable(&shm_ac_read_0_tasklet); + tasklet_enable(&shm_ac_read_1_tasklet); + tasklet_enable(&shm_ca_0_tasklet); + tasklet_enable(&shm_ca_1_tasklet); /* re-enable irqs */ enable_irq(shm_dev->ac_read_notif_0_irq); enable_irq(shm_dev->ac_read_notif_1_irq); -- cgit v1.2.3