Hi Gary, On 8/27/18, Gary Jennejohn <gljennjohn at gmail.com> wrote:> On Mon, 27 Aug 2018 10:13:10 +0200 > Phil Norman <philnorm at gmail.com> wrote: > >> Hi. >> >> I have a similar setup: Ryzen 3 and Fatal1ty X370 mini-ITX. I had some >> trouble with instability, although my problems weren't panics, but rather >> two issues. One was random lockups (with no evidence left in logs), but I >> *think* this was down to an inadequately cooled graphics card. >> > > I had instability problems with my Ryzen 5 - lockups for no > apparent reason. The only recourse waas a hard reset. > > It turned out that there were two causes > 1) old CPU microcode > 2) unhandled errate in the CPU > > I installed the /usr/ports/sysutils/devcpu-data port, which > allowed me to install the latest microcode using cpucontrol(8). > > I also used a shell script called amd_errata.sh provided by one of > the FreeBSD committers. To my shame I can't remember exactly > who. Note that the errata fixups are now part of the kernel in > FreeBSD 12.That's kib, who has committed things in that script to both 12 [1] and stable/11 [2]. Unfortunately, that's for Ryzens family 17h model 00h-0fh, whereas my Ryzen 5 2400G's model is 11h. On the microcode. It shall be updated through UEFI/BIOS updates. I think mine is now PinnaclePI-AM4_1.0.0.4 with microcode patchlevel 0x810100b. Seems like ... the only thing I can do is sit down and wait?> > After taking these steps about two months ago I have had no more > lockups and the machine runs very stabily. > > [big snip] > > -- > Gary Jennejohn >[1] https://svnweb.freebsd.org/base?view=revision&revision=336763 [2] https://svnweb.freebsd.org/base?view=revision&revision=337235
On Mon, Aug 27, 2018 at 3:21 PM Meowthink <meowthink at gmail.com> wrote:> That's kib, who has committed things in that script to both 12 [1] and > stable/11 [2]. > > Unfortunately, that's for Ryzens family 17h model 00h-0fh, whereas my > Ryzen 5 2400G's model is 11h. > > On the microcode. It shall be updated through UEFI/BIOS updates. I > think mine is now PinnaclePI-AM4_1.0.0.4 with microcode patchlevel > 0x810100b. > > Seems like ... the only thing I can do is sit down and wait?The revision https://svnweb.freebsd.org/base/head/sys/x86/x86/cpu_machdep.c?r1=336763&r2=336762&pathrev=336763 works around the mwait issue, i.e. it sets sysctl machdep.idle_mwait=0 sysctl machdep.idle=hlt Now it may or may not relate to your problem, but it appears that Ryzen 2400G also has another issue with HLT, see the DragonFly bug report https://bugs.dragonflybsd.org/issues/3131 which AMD is aware of and is possibly working on, but it may not have appeared in the errata yet. The bug report says that until this is fixed, the workaround is to also disable HLT in cpu_idle. I am not sure what is the correct value for the sysctl on FreeBSD, perhaps sysctl machdep.idle=0 or some other value? Cheers Peeter --
On Mon, 27 Aug 2018 20:18:46 +0800 Meowthink <meowthink at gmail.com> wrote:> Hi Gary, > > On 8/27/18, Gary Jennejohn <gljennjohn at gmail.com> wrote: > > On Mon, 27 Aug 2018 10:13:10 +0200 > > Phil Norman <philnorm at gmail.com> wrote: > > > >> Hi. > >> > >> I have a similar setup: Ryzen 3 and Fatal1ty X370 mini-ITX. I had some > >> trouble with instability, although my problems weren't panics, but rather > >> two issues. One was random lockups (with no evidence left in logs), but I > >> *think* this was down to an inadequately cooled graphics card. > >> > > > > I had instability problems with my Ryzen 5 - lockups for no > > apparent reason. The only recourse waas a hard reset. > > > > It turned out that there were two causes > > 1) old CPU microcode > > 2) unhandled errate in the CPU > > > > I installed the /usr/ports/sysutils/devcpu-data port, which > > allowed me to install the latest microcode using cpucontrol(8). > > > > I also used a shell script called amd_errata.sh provided by one of > > the FreeBSD committers. To my shame I can't remember exactly > > who. Note that the errata fixups are now part of the kernel in > > FreeBSD 12. > > That's kib, who has committed things in that script to both 12 [1] and > stable/11 [2]. > > Unfortunately, that's for Ryzens family 17h model 00h-0fh, whereas my > Ryzen 5 2400G's model is 11h. >AMD has also relased a Revision Guide for Family 11h. Lots of errata listed there, but I didn't look at it closely enough to say whether any are relevant to lockups.> On the microcode. It shall be updated through UEFI/BIOS updates. I > think mine is now PinnaclePI-AM4_1.0.0.4 with microcode patchlevel > 0x810100b. >Well, I installed the latest BIOS for my ASUS B350M-A also, but it was no help. The lockups disappear only after I installed the latest microde using the port.> Seems like ... the only thing I can do is sit down and wait? > > > > > After taking these steps about two months ago I have had no more > > lockups and the machine runs very stabily. > > > > [big snip] > > > > -- > > Gary Jennejohn > > > > [1] https://svnweb.freebsd.org/base?view=revision&revision=336763 > [2] https://svnweb.freebsd.org/base?view=revision&revision=337235-- Gary Jennejohn