Re: [PATCH] block: Keep RPM_ACTIVE in blk_pre_runtime_resume() when already active
From: Bart Van Assche
Date: Tue Nov 03 2026 - 15:55:10 EST
On 10/29/26 12:08 AM, Stanley Jhu wrote:
@@ -153,7 +154,9 @@ void blk_pre_runtime_resume(struct request_queue *q)
return;
spin_lock_irq(&q->queue_lock);
- q->rpm_status = RPM_RESUMING;
+ /* Keep RPM_ACTIVE if a prior failed resume reactivated the queue. */
+ if (q->rpm_status != RPM_ACTIVE)
+ q->rpm_status = RPM_RESUMING;
spin_unlock_irq(&q->queue_lock);
}
EXPORT_SYMBOL(blk_pre_runtime_resume);
Stanley, the analysis looks right to me. Could you make the invariant explicit? Only move SUSPENDED -> RESUMING in blk_pre_runtime_resume(), and only call blk_clear_pm_only() in blk_post_runtime_resume() if old_status == RPM_RESUMING. Please also describe in the commit message how this was tested. With those changes:
Reviewed-by: Bart Van Assche bvanassche@xxxxxxx
Separately: since commit eef1d74bf88f, ufshcd_recover_pm_error() no longer sees power.runtime_error after a resume failure. Its handling of that case is probably dead code now.
Thanks,
Bart.