Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9c6d556e authored by Sarthak Garg's avatar Sarthak Garg Committed by Ram Prakash Gupta
Browse files

mmc: core: Fix clk scaling deadlock with irqsave



Consider the following dump stack :

do_raw_spin_lock+0xf0
_raw_spin_lock_irqsave+0x80
mmc_request_done+0x48
sdhci_irq+0x954
__handle_irq_event_percpu+0x9c
handle_irq_event+0x60
handle_fasteoi_irq+0x140
__handle_domain_irq+0xc0
gic_handle_irq+0xcc
el1_irq+0x108
ktime_get+0xc0
mmc_cqe_clk_scaling_stop_busy+0x58
mmc_blk_cqe_complete_rq+0x138
mmc_blk_mq_complete+0x24
blk_done_softirq+0xe0

Here mmc_cqe_clk_scaling_stop_busy is being called from the soft irq
context and it acquires the clock_scaling lock.
Before it could unlock, a H/W irq gets triggered on the same core which
switches the context and starts execution but since lock is already held
in the softirq context, irq context ends up waiting for the same lock,
leading to a deadlock.

Use spin_lock_irqsave to avoid above explained deadlock.

Change-Id: I7684f4e349648414038cd6601cca58ac11b9409b
Signed-off-by: default avatarSarthak Garg <sartgarg@codeaurora.org>
Signed-off-by: default avatarRam Prakash Gupta <rampraka@codeaurora.org>
parent 5b478488
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment