diff mbox series

[2/3] ram: rk3399: Fix faulty frequency change reports

Message ID 20220621100729.979275-2-lee.jones@linaro.org
State New
Headers show
Series [1/3] ram: rk3399: Fix .set_rate_index() error handling | expand

Commit Message

Lee Jones June 21, 2022, 10:07 a.m. UTC
Frequency changes to 400MHz are presently reported as:

  lpddr4_set_rate_0: change freq to 400000000 mhz 0, 1

This is obviously wrong by 6 orders of magnitude.

Ensure frequency changes are reported accurately.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/ram/rockchip/sdram_rk3399.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kever Yang July 1, 2022, 12:04 p.m. UTC | #1
On 2022/6/21 18:07, Lee Jones wrote:
> Frequency changes to 400MHz are presently reported as:
>
>    lpddr4_set_rate_0: change freq to 400000000 mhz 0, 1
>
> This is obviously wrong by 6 orders of magnitude.
>
> Ensure frequency changes are reported accurately.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   drivers/ram/rockchip/sdram_rk3399.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
> index 0af0fa9e7b..34d6c93f95 100644
> --- a/drivers/ram/rockchip/sdram_rk3399.c
> +++ b/drivers/ram/rockchip/sdram_rk3399.c
> @@ -2552,8 +2552,8 @@ static int lpddr4_set_rate(struct dram_info *dram,
>   			       dfs_cfgs_lpddr4[ctl_fn].base.ddr_freq);
>   
>   		if (IS_ENABLED(CONFIG_RAM_ROCKCHIP_DEBUG))
> -			printf("%s: change freq to %d mhz %d, %d\n", __func__,
> -			       dfs_cfgs_lpddr4[ctl_fn].base.ddr_freq,
> +			printf("%s: change freq to %dMHz %d, %d\n", __func__,
> +			       dfs_cfgs_lpddr4[ctl_fn].base.ddr_freq / MHz,
>   			       ctl_fn, phy_fn);
>   	}
>
Xavier Drudis Ferran July 4, 2022, 10 a.m. UTC | #2
El Tue, Jun 21, 2022 at 10:07:28AM +0000, Lee Jones deia:
> Frequency changes to 400MHz are presently reported as:
> 
>   lpddr4_set_rate_0: change freq to 400000000 mhz 0, 1
> 
> This is obviously wrong by 6 orders of magnitude.
> 
> Ensure frequency changes are reported accurately.
>

Not obvious to me what "mhz" means (mHz? MHz? Hz?)
and so not obvious to me by how many orders of magnitude 
it was wrong but in any case now the message is correct and clear.

Tested-by: Xavier Drudis Ferran <xdrudis@tinet.cat>
 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/ram/rockchip/sdram_rk3399.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
> index 0af0fa9e7b..34d6c93f95 100644
> --- a/drivers/ram/rockchip/sdram_rk3399.c
> +++ b/drivers/ram/rockchip/sdram_rk3399.c
> @@ -2552,8 +2552,8 @@ static int lpddr4_set_rate(struct dram_info *dram,
>  			       dfs_cfgs_lpddr4[ctl_fn].base.ddr_freq);
>  
>  		if (IS_ENABLED(CONFIG_RAM_ROCKCHIP_DEBUG))
> -			printf("%s: change freq to %d mhz %d, %d\n", __func__,
> -			       dfs_cfgs_lpddr4[ctl_fn].base.ddr_freq,
> +			printf("%s: change freq to %dMHz %d, %d\n", __func__,
> +			       dfs_cfgs_lpddr4[ctl_fn].base.ddr_freq / MHz,
>  			       ctl_fn, phy_fn);
>  	}
>  
> -- 
> 2.37.0.rc0.104.g0611611a94-goog
>
diff mbox series

Patch

diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
index 0af0fa9e7b..34d6c93f95 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -2552,8 +2552,8 @@  static int lpddr4_set_rate(struct dram_info *dram,
 			       dfs_cfgs_lpddr4[ctl_fn].base.ddr_freq);
 
 		if (IS_ENABLED(CONFIG_RAM_ROCKCHIP_DEBUG))
-			printf("%s: change freq to %d mhz %d, %d\n", __func__,
-			       dfs_cfgs_lpddr4[ctl_fn].base.ddr_freq,
+			printf("%s: change freq to %dMHz %d, %d\n", __func__,
+			       dfs_cfgs_lpddr4[ctl_fn].base.ddr_freq / MHz,
 			       ctl_fn, phy_fn);
 	}