Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
audio: swr-mstr-ctrl: Fix unbalanced IRQ condition in swrm_runtime_su…
Browse files Browse the repository at this point in the history
…spend()

Add irq request check condition before enabling swrm interrupt
This will make sure to only enabled interrupt request when it is in disabled state.

This Fixes:
W         : ------------[ cut here ]------------
W         : Unbalanced enable for IRQ 502
W         : WARNING: CPU: 4 PID: 81 at kernel/irq/manage.c:621 enable_irq+0x98/0xf0
I         : Modules linked in:
I         : CPU: 4 PID: 81 Comm: kworker/4:1 Tainted: G S                4.19.197-IMMENSITY-g09a924c384cb #1
I Hardware name: Qualcomm Technologies, Inc. xiaomi alioth (DT)
I Workqueue: pm pm_runtime_work
I pstate  : 60c00085 (nZCv daIf +PAN +UAO)
I pc      : enable_irq+0x98/0xf0
I lr      : enable_irq+0x98/0xf0
I sp      : ffffff800885bbb0
I         : x29: ffffff800885bbc0 x28: ffffffa6fea0db38
I         : x27: 0000000000000002 x26: 0000000000000000
I         : x25: ffffffd1991ef37d x24: 0000000000000000
I         : x23: ffffffd1991edca1 x22: ffffffd199555410
I         : x21: ffffffd1991ef248 x20: 00000000000001f6
I         : x19: ffffffd18cc7b400 x18: ffffffd1b4e9f048
I         : x17: 0000000000000000 x16: 0000000000000000
I         : x15: 0000000000000086 x14: 0000000000000030
I         : x13: 0000000000049754 x12: 0000000000000000
I         : x11: 0000000000000000 x10: 0000000000000007
I         : x9 : 060ca0f25e42ae00 x8 : 060ca0f25e42ae00
I         : x7 : 0000000000000000 x6 : ffffffa6fed3f8e5
I         : x5 : 00000000001b68dc x4 : 000000000000000e
I         : x3 : 0000000000000032 x2 : 0000000000000007
I         : x1 : 0000000000000007 x0 : 000000000000001d
I Call trace:
I         : enable_irq+0x98/0xf0
I         : swrm_runtime_suspend+0x390/0x47c
I         : pm_generic_runtime_suspend+0x28/0x3c
I         : __rpm_callback+0x12c/0x218
I         : rpm_suspend+0x420/0x7cc
I         : pm_runtime_work+0x98/0xa8
I         : process_one_work+0x228/0x3f4
I         : worker_thread+0x264/0x4b0
I         : kthread+0x13c/0x158
I         : ret_from_fork+0x10/0x18
W         : ---[ end trace 56c9cc0df5ea202b ]---

Change-Id: Ic539bfc8d595faf530361d32e0be4ce9009fec08
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
  • Loading branch information
UtsavBalar1231 committed Jul 14, 2021
1 parent 453e11f commit a982d81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion techpack/audio/soc/swr-mstr-ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3128,6 +3128,7 @@ static int swrm_runtime_suspend(struct device *dev)
struct swr_master *mstr = &swrm->master;
struct swr_device *swr_dev;
int current_state = 0;
struct irq_data *irq_data = NULL;

trace_printk("%s: pm_runtime: suspend state: %d\n",
__func__, swrm->state);
Expand Down Expand Up @@ -3231,7 +3232,9 @@ static int swrm_runtime_suspend(struct device *dev)

if (swrm->clk_stop_mode0_supp) {
if (swrm->wake_irq > 0) {
enable_irq(swrm->wake_irq);
irq_data = irq_get_irq_data(swrm->wake_irq);
if (irq_data && irqd_irq_disabled(irq_data))
enable_irq(swrm->wake_irq);
} else if (swrm->ipc_wakeup) {
msm_aud_evt_blocking_notifier_call_chain(
SWR_WAKE_IRQ_REGISTER, (void *)swrm);
Expand Down

0 comments on commit a982d81

Please sign in to comment.