On Thu, 2018-07-26 at 10:45 +-0800, jianchao.wang wrote: +AD4- On 07/26/2018 06:26 AM, Bart Van Assche wrote: +AD4- +AD4- +- +AD4- +AD4- +-void blk+AF8-pm+AF8-runtime+AF8-lock(struct request+AF8-queue +ACo-q) +AD4- +AD4- +-+AHs- +AD4- +AD4- +- spin+AF8-lock(+ACY-q-+AD4-rpm+AF8-lock)+ADs- +AD4- +AD4- +- wait+AF8-event+AF8-interruptible+AF8-locked(q-+AD4-rpm+AF8-wq, +AD4- +AD4- +- q-+AD4-rpm+AF8-owner +AD0APQ- NULL +AHwAfA- q-+AD4-rpm+AF8-owner +AD0APQ- current)+ADs- +AD4- +AD4- +- if (q-+AD4-rpm+AF8-owner +AD0APQ- NULL) +AD4- +AD4- +- q-+AD4-rpm+AF8-owner +AD0- current+ADs- +AD4- +AD4- +- q-+AD4-rpm+AF8-nesting+AF8-level+-+-+ADs- +AD4- +AD4- +- spin+AF8-unlock(+ACY-q-+AD4-rpm+AF8-lock)+ADs- +AD4- +AD4- +-+AH0- +AD4- +AD4- The lock which wait+AF8-event+AF8-interruptible+AF8-locked want to hold is the wq.lock. The above code is indeed wrong. This is what I think it should be changed into: +-void blk+AF8-pm+AF8-runtime+AF8-lock(struct request+AF8-queue +ACo-q) +-+AHs- +- might+AF8-sleep()+ADs- +- +- spin+AF8-lock(+ACY-q-+AD4-rpm+AF8-lock)+ADs- +- wait+AF8-event+AF8-exclusive+AF8-cmd(q-+AD4-rpm+AF8-wq, +- q-+AD4-rpm+AF8-owner +AD0APQ- NULL +AHwAfA- q-+AD4-rpm+AF8-owner +AD0APQ- current, +- spin+AF8-unlock(+ACY-q-+AD4-rpm+AF8-lock), spin+AF8-lock(+ACY-q-+AD4-rpm+AF8-lock))+ADs- +- if (q-+AD4-rpm+AF8-owner +AD0APQ- NULL) +- q-+AD4-rpm+AF8-owner +AD0- current+ADs- +- q-+AD4-rpm+AF8-nesting+AF8-level+-+-+ADs- +- spin+AF8-unlock(+ACY-q-+AD4-rpm+AF8-lock)+ADs- +-+AH0- Bart.