I'm using Linux 5.15 with an i.MX8MM and trying to remove unused/unneeded options from our kernel configuration. But when I removed some options (like CONFIG_GPIO_XGENE or CONFIG_GPIO_MAX77620) the kernel message »imx_busfreq: probe of busfreq failed with error -22« showed up in the log, even through we do not have the hardware of these options. What made me very questioning was the message came up after I added the option CONFIG_NFS_V4_2_READ_PLUS=y – without it: no message; with it: I get the message.
So I looked into it and found this block that returned the -22 EINVAL https://github.com/nxp-imx/linux-imx/blob/e0f9e2afd4cff3f02d71891244b4aa5899dfc786/drivers/soc/imx/b....
I logged some values "%d=%d", i, err:
working:
0=100
1=0
2=59460608
3=1027605252
failing:
0=100
1=0
2=-2088023040
Comparing the code referenced above with the code from devfreq/imx8m-ddrc.c there's a difference in the data type: https://github.com/nxp-imx/linux-imx/blob/e0f9e2afd4cff3f02d71891244b4aa5899dfc786/drivers/devfreq/i... uses a long for comparision < 0 while the code in busfreq-imx8mq.c casts to int.
Is the following patch correct?
diff --git drivers/soc/imx/busfreq-imx8mq.c drivers/soc/imx/busfreq-imx8mq.c
index 5e36962285ef..f0b5fe81725e 100644
--- drivers/soc/imx/busfreq-imx8mq.c
+++ drivers/soc/imx/busfreq-imx8mq.c
@@ -35,6 +35,7 @@
#include <linux/sys_soc.h>
#define FSL_SIP_DDR_DVFS 0xc2000004
+#define DDR_DFS_GET_FSP_INFO 0x11
#define HIGH_FREQ_3200MTS 0x0
#define AUDIO_FREQ_400MTS 0x1
@@ -575,9 +576,9 @@ static int busfreq_probe(struct platform_device *pdev)
* is used for low bus & audio bus mode.
*/
for (i = 0; i < 4; i++) {
- arm_smccc_smc(FSL_SIP_DDR_DVFS, 0x11, i, 0, 0, 0, 0, 0, &res);
- err = res.a0;
- if (err < 0)
+ arm_smccc_smc(FSL_SIP_DDR_DVFS, DDR_DFS_GET_FSP_INFO, i,
+ 0, 0, 0, 0, 0, &res);
+ if ((long)res.a0 < 0)
return -EINVAL;
fsp_table[i] = res.a0;
Hello,
After applying this patch, was the problem solved?
Best Regards,
Zhiming