summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Murthy <arun.murthy@stericsson.com>2011-12-19 11:31:05 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-06-05 10:40:25 +0200
commit5291976ef6237af47e1644ce1f526315887265f1 (patch)
tree214546e6849c5231c1ad20e90554b49daade14fb
parent29c578081d643f636c42cdc7ebfafa1fb953ae21 (diff)
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 <arun.murthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/43027 Reviewed-by: Ashok G X <ashok.g@stericsson.com> Tested-by: Ashok G X <ashok.g@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r--drivers/modem/shrm/shrm_protocol.c20
1 files 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<<GOP_CA_WAKE_ACK_BIT),
shm_dev->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);