Ddr bus freq switching

Hi,

I noticed some strange behavior on the imx6ull on a custom base board, but also reproducible on the Iris board.

It happened when I disabled the connman service and the lcdif in the device tree.

After these modifications the ddr randomly switches bus freq between 24 and 400MHz:

[ 26.406636]
[ 26.406636] Bus freq set to 24000000 start…
[ 26.407034] Bus freq set to 24000000 done!
[ 32.489188] soc_in: disabling
[ 32.493799] 3.3V: disabling
[ 35.185462]
[ 35.185462] Bus freq set to 400000000 start…
[ 35.185996] Bus freq set to 400000000 done!
[ 44.326619]
[ 44.326619] Bus freq set to 24000000 start…
[ 44.327045] Bus freq set to 24000000 done!
[ 46.912989]
[ 46.912989] Bus freq set to 400000000 start…
[ 46.913494] Bus freq set to 400000000 done!
[ 46.931340] Micrel KSZ8041 20b4000.ethernet-1:02: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=20b4000.ethernet-1:02, irq=POLL)
[ 49.046899] fec 20b4000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 49.054813] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 836.326607]
[ 836.326607] Bus freq set to 24000000 start…
[ 836.326987] Bus freq set to 24000000 done!
[ 845.401870]
[ 845.401870] Bus freq set to 400000000 start…
[ 845.402449] Bus freq set to 400000000 done!
[ 845.405176] Micrel KSZ8041 20b4000.ethernet-1:02: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=20b4000.ethernet-1:02, irq=POLL)
[ 845.428070] fec 20b4000.ethernet eth0: Link is Up - 10Mbps/Full - flow control rx/tx
[ 845.450813] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

If I then enable the eth0 device the problem is over. I verified this a couple of times and in the above log you can see that at 836 I disable again eth0 and the switching is back… making the system really slow.

Now to make things really strange is that if I enable again the lcdif in the device tree the problem is also gone, so I can leave the eth0 disabled without the ddr freq switching behavior.

I really have no clue why this is happening, any help to solve this problem would be really appreciated.

hardware: imx6ull
software: Linux colibri-imx6ull 5.4.129, Reference-Minimal-Image-colibri-imx6ull

Best Regards,
Vincent

hello,

is this based on our image or are there any customization on your side.
Can you send your device tree modifications.

Best Regards,

Matthias

Hi,

Yes it is based on the reference minimal image, but with changes.

These include:

kernel:
usage of gpio’ s
disabling lcdif
disabling emmc
add oled spi display
add led driver (max6966) support
add rotary encode support

uboot:
fix for the nand speed

rootfs:
disable connman
disable timesyncd
disable backlight
disable journald

I have attached the device tree files.

Thanks,
Vincent
imx6ull-colibri.dtsi (19.1 KB)
imx6ull-colibri-director-v2.dts (3.1 KB)
imx6ull-colibri-eval-v3.dts (356 Bytes)

Hi,

Yesterday I synced to the latest kernel source. I noticed that the lcdif is not enabled by default in the device tree. I also noticed that the cpu governor works better then in the previous version I ran.

Still when you disable the Ethernet driver the system switches ddr bus freq between 24 and 400MHz.

If you then insert for example a USB stick or reload the Ethernet driver the switching somehow stops.

I think this would also happen without my specific changes.

Currently I changed the default governor setting to performance and this prevents the switching from happening.

Best Regards,
Vincent

Hi @vincent ,

From your latest answer I assume that the issue is fixed.

What’s most probably happening is that the CPU recognizes that the load on the memory bus is so low that it will switch into a “Low Power Mode”. In this mode de bus frequency is changed, then as soon as something is happening on this bus the frequency gets back up.

So as you switch to permanent performance mode, the auto-switching is not necessary anymore.

Best Regards
Kevin

1 Like

Hi Kevin,

Yes this works for me.

Still a bit of a mystery to me what triggers the governor, as it seems that when certain drivers (ethernet /usb ) are loaded there is no governance at all.

Thanks ,
Vincent