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

scsi: ufs: core: Rename ufshcd_auto_hibern8_enable() and make it static

Rename ufshcd_auto_hibern8_enable() into ufshcd_configure_auto_hibern8()
since this function can enable or disable auto-hibernation. Since
ufshcd_auto_hibern8_enable() is only used inside the UFSHCI driver core,
declare it static. Additionally, move the definition of this function to
just before its first caller.

Suggested-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Cc: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20231214192416.3638077-2-bvanassche@acm.org
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
bdf5c0bb 26cdd694

+11 -14
+11 -13
drivers/ufs/core/ufshcd.c
··· 4413 4413 } 4414 4414 EXPORT_SYMBOL_GPL(ufshcd_uic_hibern8_exit); 4415 4415 4416 + static void ufshcd_configure_auto_hibern8(struct ufs_hba *hba) 4417 + { 4418 + if (!ufshcd_is_auto_hibern8_supported(hba)) 4419 + return; 4420 + 4421 + ufshcd_writel(hba, hba->ahit, REG_AUTO_HIBERNATE_IDLE_TIMER); 4422 + } 4423 + 4416 4424 void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit) 4417 4425 { 4418 4426 unsigned long flags; ··· 4440 4432 !pm_runtime_suspended(&hba->ufs_device_wlun->sdev_gendev)) { 4441 4433 ufshcd_rpm_get_sync(hba); 4442 4434 ufshcd_hold(hba); 4443 - ufshcd_auto_hibern8_enable(hba); 4435 + ufshcd_configure_auto_hibern8(hba); 4444 4436 ufshcd_release(hba); 4445 4437 ufshcd_rpm_put_sync(hba); 4446 4438 } 4447 4439 } 4448 4440 EXPORT_SYMBOL_GPL(ufshcd_auto_hibern8_update); 4449 - 4450 - void ufshcd_auto_hibern8_enable(struct ufs_hba *hba) 4451 - { 4452 - if (!ufshcd_is_auto_hibern8_supported(hba)) 4453 - return; 4454 - 4455 - ufshcd_writel(hba, hba->ahit, REG_AUTO_HIBERNATE_IDLE_TIMER); 4456 - } 4457 4441 4458 4442 /** 4459 4443 * ufshcd_init_pwr_info - setting the POR (power on reset) ··· 8953 8953 8954 8954 if (hba->ee_usr_mask) 8955 8955 ufshcd_write_ee_control(hba); 8956 - /* Enable Auto-Hibernate if configured */ 8957 - ufshcd_auto_hibern8_enable(hba); 8956 + ufshcd_configure_auto_hibern8(hba); 8958 8957 8959 8958 out: 8960 8959 spin_lock_irqsave(hba->host->host_lock, flags); ··· 9955 9956 cancel_delayed_work(&hba->rpm_dev_flush_recheck_work); 9956 9957 } 9957 9958 9958 - /* Enable Auto-Hibernate if configured */ 9959 - ufshcd_auto_hibern8_enable(hba); 9959 + ufshcd_configure_auto_hibern8(hba); 9960 9960 9961 9961 goto out; 9962 9962
-1
include/ufs/ufshcd.h
··· 1371 1371 return ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0); 1372 1372 } 1373 1373 1374 - void ufshcd_auto_hibern8_enable(struct ufs_hba *hba); 1375 1374 void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit); 1376 1375 void ufshcd_fixup_dev_quirks(struct ufs_hba *hba, 1377 1376 const struct ufs_dev_quirk *fixups);