Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTO

Add UFSHCD_QUIRK_HIBERN_FASTAUTO quirk for host controllers which supports
auto-hibernate the capability but only FASTAUTO mode.

Link: https://lore.kernel.org/r/20220603110524.1997825-4-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Yoshihiro Shimoda and committed by
Martin K. Petersen
2f11bbc2 6554400d

+13 -2
+7 -2
drivers/ufs/core/ufshcd.c
··· 4260 4260 if (hba->max_pwr_info.is_valid) 4261 4261 return 0; 4262 4262 4263 - pwr_info->pwr_tx = FAST_MODE; 4264 - pwr_info->pwr_rx = FAST_MODE; 4263 + if (hba->quirks & UFSHCD_QUIRK_HIBERN_FASTAUTO) { 4264 + pwr_info->pwr_tx = FASTAUTO_MODE; 4265 + pwr_info->pwr_rx = FASTAUTO_MODE; 4266 + } else { 4267 + pwr_info->pwr_tx = FAST_MODE; 4268 + pwr_info->pwr_rx = FAST_MODE; 4269 + } 4265 4270 pwr_info->hs_rate = PA_HS_MODE_B; 4266 4271 4267 4272 /* Get the connected lane count */
+6
include/ufs/ufshcd.h
··· 583 583 * 64-bit addressing supported capability but it doesn't work. 584 584 */ 585 585 UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS = 1 << 17, 586 + 587 + /* 588 + * This quirk needs to be enabled if the host controller has 589 + * auto-hibernate capability but it's FASTAUTO only. 590 + */ 591 + UFSHCD_QUIRK_HIBERN_FASTAUTO = 1 << 18, 586 592 }; 587 593 588 594 enum ufshcd_caps {