From 134ade9bf2e672ec82357ea1ce685f30f27ff217 Mon Sep 17 00:00:00 2001 From: Sameer Pujar Date: Fri, 15 May 2020 16:29:00 +0530 Subject: [PATCH] nvadsp: request clk_round_rate() for 600 MHz On 5.4 kernel clk_round_rate(), for ACLK with ULONG_MAX request, is returning minimum possible value for ACLK and this is causing a failure with ADSP OS load. The issue is found in BPMP where there is a problem with data mis-alignment. Till this gets addressed a TEMP change is provided here to unblock ADSP audio related work. This can be reverted once original BPMP fix is merged. Bug 200593718 Change-Id: I1965986770424f2a8560e011ca892b700cdc0258 Signed-off-by: Sameer Pujar Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2345133 Reviewed-by: automaticguardword Reviewed-by: Dipesh Gandhi Reviewed-by: Uday Gupta Reviewed-by: Mohan Kumar D Reviewed-by: Sharad Gupta Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/platform/tegra/nvadsp/os.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/platform/tegra/nvadsp/os.c b/drivers/platform/tegra/nvadsp/os.c index 2157028b..a7b56ae3 100644 --- a/drivers/platform/tegra/nvadsp/os.c +++ b/drivers/platform/tegra/nvadsp/os.c @@ -1039,7 +1039,11 @@ static int nvadsp_set_adsp_clks(struct nvadsp_drv_data *drv_data) adsp_freq = drv_data->adsp_freq_hz; /* in Hz*/ /* round rate shall be used with adsp parent clk i.e. aclk */ +#if KERNEL_VERSION(5, 4, 0) > LINUX_VERSION_CODE max_adsp_freq = clk_round_rate(drv_data->aclk_clk, ULONG_MAX); +#else + max_adsp_freq = clk_round_rate(drv_data->aclk_clk, 600000000); +#endif /* Set max adsp boot freq */ if (!adsp_freq)