From bc1892a512e7cbfebdb8281d1422b6d98341d237 Mon Sep 17 00:00:00 2001 From: chaptsand Date: Sun, 31 Jul 2022 22:33:38 +0800 Subject: [PATCH] scsi: ufs: Guard `ufs_qcom_parse_lpm` for UMI - This is what Xiaomi did on cmi-r-oss [1][2]. - Disable LPM modes results in abnormal power consumption on UMI. - Guard for THYME too as it has the same node in device tree. Ref: [1]: https://github.com/MiCode/Xiaomi_Kernel_OpenSource/blob/cmi-r-oss/drivers/scsi/ufs/ufs-qcom.c#L2033-L2038 [2]: https://github.com/MiCode/kernel_devicetree/blob/cmi-r-oss/qcom/umi-sm8250.dtsi#L11 * Thanks @TheVoyager0777 for found out this particular change Change-Id: I78d1fd5936cdd871a2ca2626d4a6e0d335a96c83 --- drivers/scsi/ufs/ufs-qcom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 290408cda787..ff4f067edc1d 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -2057,9 +2057,13 @@ __setup("androidboot.bootdevice=", get_android_boot_dev); */ static void ufs_qcom_parse_lpm(struct ufs_qcom_host *host) { +#if IS_ENABLED(CONFIG_BOARD_UMI) || IS_ENABLED(CONFIG_BOARD_THYME) + host->disable_lpm = false; +#else struct device_node *node = host->hba->dev->of_node; host->disable_lpm = of_property_read_bool(node, "qcom,disable-lpm"); +#endif if (host->disable_lpm) pr_info("%s: will disable all LPM modes\n", __func__); }