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

Skip to content
Commit d79e38f7 authored by Asutosh Das's avatar Asutosh Das Committed by Sayali Lokhande
Browse files

scsi: ufs: avoid deadlock by releasing rw_sem during hibernate



Consider the below scenario:
Three contexts:
1. Exception event handler [eeh]
2. Clock scaling
3. Error handler [eh]

	- Exception was raised
	- eeh runs
		- acquires dev.cmd.lock [1]
		- waits for rw_sem [3]
	- scaling is triggered from userspace
		- acquires rw_sem [2]
		- issues hibern8
		- error in hibern8
		- triggers error-handler (eh)
		- flushes eh [4]
	- eh is scheduled
		- waits on dev.cmd.lock [5]
So, [3] waits for [2] which flushes eh and waits on [5]
which has been acquired by [1]

So, release the rw_sem before issuing hibern8 and flush pending
error handler work if any, during clock scaling triggered from
user-space.

Change-Id: I968dd3d87bdfbf0aa1373a879a75f3c17349564e
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent e83ca98f
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