Hi Bart

On 07/26/2018 06:26 AM, Bart Van Assche wrote:
> +
> +void blk_pm_runtime_lock(struct request_queue *q)
> +{
> +     spin_lock(&q->rpm_lock);
> +     wait_event_interruptible_locked(q->rpm_wq,
> +                       q->rpm_owner == NULL || q->rpm_owner == current);
> +     if (q->rpm_owner == NULL)
> +             q->rpm_owner = current;
> +     q->rpm_nesting_level++;
> +     spin_unlock(&q->rpm_lock);
> +}

The lock which wait_event_interruptible_locked want to hold is the wq.lock.
Please refer to comment of wait_event_interruptible_locked

 * It must be called with wq.lock being held.  This spinlock is
 * unlocked while sleeping but @condition testing is done while lock
 * is held and when this macro exits the lock is held.

Thanks
Jianchao

Reply via email to