Frequency switching stability issues on Q820

Hi @Loic,

Is there QCOM CPR support is implemented for Q820?

I have checked kernel source 4.14.96 and found that QCOM CPR is supported for Q410 (drivers/power/avs/qcom-cpr.c). But it is not implemented for Q820.

So is there any possibility that we can improve boot freeze issue if we add QCOM CPR support in Q820?


I appear to have gotten the Android kernel to boot reliably with a pull up to 4.14.165 from the Android common kernel. The issue I was having appeared to be tied to ufshcd-qcom.

I’ve done about 20 successful boots and have been unable so far to reproduce either the freeze on clock or the freeze on ufs initialization. I was getting a freeze up rate of about 75% (i.e., 3 failed boots to one successful), and of those, about 1/3 of them were on the frequency.

… although I did manage to break USB in the process.

I recently discovered that UFS is the only client voting for LN_BB, which is used as reference clock for all PHYs. The result was that if UFS was probe deferred with any other PHY operational we would suffer a restart due to clock issues in e.g. PCI or USB.

I’ve gotten the below patch merged for v5.6 to fix this particular problem:


No, we unfortunately do not have a driver for the version of CPR found in 820, yet. We also need a regulator driver for the in-core power controller found on this SoC.

What qcom-cpr.c does give us is a conclusion on how CPR should be integrated in the system, so now it’s just a matter of writing the code :wink:


Hi @bamse ; that’s great. I’ll try to pull in that patch.

As a matter of fact, I’ve also been trying to get a more recent kernel to run on the board (genuine db820c limited “brown mask” edition), but I’ve been unable to get drm-msm working.

I have started another thread on the issue here; DRM MSM on recent kernels (5.4+) – wonder if you could recommend a good starting point?

EDIT: Looks like while the patch can be applied to 4.14, it doesn’t actually compile. Lots changed since then.

I have a question for you @Loic :
The bootloader says this;
B - 415166 - 8996 Pro v1.x detected, Max frequency = 1.8 GHz

But the DTS goes all the way up to 2.15 GHz.
Is this overclocking the chip? Or is the bootloader just using an old string?

Well msm8996 is supposed to have the big core clocked at up to 2.16Ghz (Turbo), and AFAIK only the MSM8996 Lite version is limited to 1.8Ghz.

But here not sure if this frequency really refers to the CPU cores (I don’t have bootloader source code), maybe it’s just the memory frequency (LPDDR4 SDRAM at 1866 MHz clock rate).

on my side, I also get 1.8Ghz:

B -    568001 - 8996 v3.x detected, Max frequency = 1.8 GHz

Whereas my SoC (APQ8096 3.1.3 on the PCB) is clearly identified supporting Kryo Gold 2.15
GHz in the Qualcomm® SnapdragonTM 820E Processor device specification [1] (4.3).


Yes, it is DDR frequency.

Can we port CPR driver based on Android CPR driver? I found that in Android kernel drivers/regulator/cpr3-hmss-regulator.c driver is used for CPR.

Use kernel 5.4.

All stability problems are fixed there.

Yes, that is possible, but in addition to the CPR doing adaptive voltage scaling we also need a regulator driver for the regulators found in the CPU subsystem, and the necessary clock code. But combined these should do the trick.