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:
Asutosh Das <asutoshd@codeaurora.org>
Loading
Please register or sign in to comment