Fixing Ryzen Freezes Due to C6 Power States

ryzen-box-1-of-1-100712472-large

Finally, I figured out how to make my system stable. For about a year I had been experiencing random freezes on my new system — but not ever while using it. I would come back in the morning and try to wake up the machine and it would be frozen. Turns out the root cause is the C6 power saving states in the Ryzen core are not fully compatible with the Linux kernel. Grrrr!

I’ll detail my fix here. I got on to this solution from a thread on monjaro.org and implemented it following this reddit thread.

Clone the ZenStates repo:

You can find it here: https://github.com/r4m0n/ZenStates-Linux

git clone git@github.com:r4m0n/ZenStates-Linux.git

Create a Script:

I called my disable-c6.sh:


#!/bin/bash
if [ "${1}" == "post" ]; then

# Disable c6 coming out of sleep
/home/mike/compile/ZenStates-Linux/zenstates.py --c6-disable
fi

Make it executable:

chmod a+x disable-c6.sh

Turn it into a service:

sudo nano /etc/systemd/system/disable-c6.service

and paste:

[Unit]
Description=Disable C6 on boot
After=default.target

[Service]
Type=oneshot
ExecStart=/home/dk/Ryzen/ZenStates-Linux/zenstates.py --c6-disable

[Install]
WantedBy=default.target

Start it to disable C6 if it is currently enabled…

# systemctl start disable-c6.service

And get it to run on boot

# systemctl enable disable-c6.service