Loading
scsi: ufs: core: Fix another deadlock during RTC update
stable inclusion from stable-v6.6.81 commit 9aa1f0da237d6b16e36e0a0cc9f746d1d78396ed category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBYZED Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9aa1f0da237d6b16e36e0a0cc9f746d1d78396ed -------------------------------- commit cb7e509c4e0197f63717fee54fb41c4990ba8d3a upstream. If ufshcd_rtc_work calls ufshcd_rpm_put_sync() and the pm's usage_count is 0, we will enter the runtime suspend callback. However, the runtime suspend callback will wait to flush ufshcd_rtc_work, causing a deadlock. Replace ufshcd_rpm_put_sync() with ufshcd_rpm_put() to avoid the deadlock. Fixes: 6bf999e0eb41 ("scsi: ufs: core: Add UFS RTC support") Cc: stable@vger.kernel.org #6.11.x Signed-off-by:Peter Wang <peter.wang@mediatek.com> Link: https://lore.kernel.org/r/20241024015453.21684-1-peter.wang@mediatek.com Reviewed-by:
Bart Van Assche <bvanassche@acm.org> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 9aa1f0da237d6b16e36e0a0cc9f746d1d78396ed) Signed-off-by:
Wentao Guan <guanwentao@uniontech.com>