diff options
author | Johan Ydstrom <johan.xj.ydstrom@stericsson.com> | 2011-09-06 10:30:25 +0200 |
---|---|---|
committer | Mathieu J. Poirier <mathieu.poirier@linaro.org> | 2011-11-10 11:12:18 -0700 |
commit | e1e348613a63c73eaa3f6f7d329fda9ba9590977 (patch) | |
tree | e146b782f5007f748754e35af86475a27715bb5a | |
parent | 0c121507bbda9a5daa7b47aa1e2f3518b997a248 (diff) |
misc: shrm: Move IRQ disable to IRQ handler
As soon as receving CP reset interrupt, all IRQ should be
disabled and CP boot state should be changed.
ST-Ericsson ID: 359707
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I1326bd18ef7a2f7694d82b280eecdd053d1857b1
Signed-off-by: Johan Ydstrom <johan.xj.ydstrom@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30684
Reviewed-by: Daniel WILLERUD <daniel.willerud@stericsson.com>
Reviewed-by: Arun MURTHY <arun.murthy@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31932
Tested-by: Arun MURTHY <arun.murthy@stericsson.com>
-rw-r--r-- | drivers/modem/shrm/shrm_protocol.c | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/drivers/modem/shrm/shrm_protocol.c b/drivers/modem/shrm/shrm_protocol.c index 990591faee1..883c46b4f8f 100644 --- a/drivers/modem/shrm/shrm_protocol.c +++ b/drivers/modem/shrm/shrm_protocol.c @@ -480,33 +480,6 @@ static int shrm_modem_reset_sequence(void) int err; unsigned long flags; - /* - * disable irqs - * very much needed for user-space initiated - * modem-reset - */ - disable_irq_nosync(shm_dev->ac_read_notif_0_irq); - disable_irq_nosync(shm_dev->ac_read_notif_1_irq); - disable_irq_nosync(shm_dev->ca_msg_pending_notif_0_irq); - disable_irq_nosync(shm_dev->ca_msg_pending_notif_1_irq); - disable_irq_nosync(IRQ_PRCMU_CA_WAKE); - disable_irq_nosync(IRQ_PRCMU_CA_SLEEP); - - - /* update the boot_state */ - spin_lock_irqsave(&boot_lock, flags); - boot_state = BOOT_UNKNOWN; - - /* - * put a barrier over here to make sure boot_state is updated - * else, it is seen that some of already executing modem - * irqs or tasklets fail the protocol checks and will ultimately - * try to acces the modem causing system to hang. - * This is particularly seen with user-space initiated modem reset - */ - wmb(); - spin_unlock_irqrestore(&boot_lock, flags); - hrtimer_cancel(&timer); /* @@ -582,6 +555,7 @@ DECLARE_TASKLET(shrm_sw_reset_callback, shrm_modem_reset_callback, static irqreturn_t shrm_prcmu_irq_handler(int irq, void *data) { struct shrm_dev *shrm = data; + unsigned long flags; switch (irq) { case IRQ_PRCMU_CA_WAKE: @@ -597,6 +571,27 @@ static irqreturn_t shrm_prcmu_irq_handler(int irq, void *data) queue_work(shrm->shm_ca_wake_wq, &shrm->shm_ca_sleep_req); break; case IRQ_PRCMU_MODEM_SW_RESET_REQ: + /* update the boot_state */ + spin_lock_irqsave(&boot_lock, flags); + boot_state = BOOT_UNKNOWN; + + /* + * put a barrier over here to make sure boot_state is updated + * else, it is seen that some of already executing modem + * irqs or tasklets fail the protocol checks and will ultimately + * try to acces the modem causing system to hang. + * This is particularly seen with user-space initiated modem reset + */ + wmb(); + spin_unlock_irqrestore(&boot_lock, flags); + + disable_irq_nosync(shrm->ac_read_notif_0_irq); + disable_irq_nosync(shrm->ac_read_notif_1_irq); + disable_irq_nosync(shrm->ca_msg_pending_notif_0_irq); + disable_irq_nosync(shrm->ca_msg_pending_notif_1_irq); + disable_irq_nosync(IRQ_PRCMU_CA_WAKE); + disable_irq_nosync(IRQ_PRCMU_CA_SLEEP); + tasklet_schedule(&shrm_sw_reset_callback); break; default: |