Bug 239607 - amdtemp: Does not recognize AMD Ryzen 5 3600
Summary: amdtemp: Does not recognize AMD Ryzen 5 3600
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-amd64 mailing list
Keywords: feature
Depends on:
Reported: 2019-08-03 05:24 UTC by drclaw
Modified: 2019-11-15 01:58 UTC (History)
6 users (show)

See Also:
koobs: mfc-stable11?
koobs: mfc-stable12?

devinfo (21.89 KB, text/plain)
2019-08-03 05:24 UTC, drclaw
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description drclaw 2019-08-03 05:24:21 UTC
Created attachment 206229 [details]

System : FreeBSD 12.0-RELEASE-p8 r350525 GENERIC  amd64
CPU : Ryzen 5 3600
Motherboard : MSI B450 Mortar

After kldloading amdtemp, amdsmn, no temperatures appear under sysctl dev.cpu

dmidecode -t processor

# dmidecode 3.2
# SMBIOS entry point at 0xdce5e000
Found SMBIOS entry point in EFI, reading table from /dev/mem.
SMBIOS 2.8 present.

Handle 0x0015, DMI type 4, 48 bytes
Processor Information
        Socket Designation: AM4
        Type: Central Processor
        Family: Zen
        Manufacturer: Advanced Micro Devices, Inc.
        ID: 10 0F 87 00 FF FB 8B 17
        Signature: Family 23, Model 113, Stepping 0
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                MMX (MMX technology supported)
                FXSR (FXSAVE and FXSTOR instructions supported)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                HTT (Multi-threading)
        Version: AMD Ryzen 5 3600 6-Core Processor
        Voltage: 1.1 V
        External Clock: 100 MHz
        Max Speed: 4200 MHz
        Current Speed: 3600 MHz
        Status: Populated, Enabled
        Upgrade: Socket AM4
        L1 Cache Handle: 0x0012
        L2 Cache Handle: 0x0013
        L3 Cache Handle: 0x0014
        Serial Number: Unknown
        Asset Tag: Unknown
        Part Number: Unknown
        Core Count: 6
        Core Enabled: 6
        Thread Count: 12
                64-bit capable
                Hardware Thread
                Execute Protection
                Enhanced Virtualization
                Power/Performance Control

Attachments :

devinfo -v > output.txt
pciconf -lv >> output.txt

Let me know if you need any further details.
Comment 1 Conrad Meyer freebsd_committer 2019-08-05 21:36:47 UTC
Please try the following patch.  I believe it is all that is needed to add support for Zen 2 family 17h devices (such as Ryzen 3):

Comment 2 commit-hook freebsd_committer 2019-08-06 03:54:37 UTC
A commit references this bug:

Author: cem
Date: Tue Aug  6 03:54:28 UTC 2019
New revision: 350624
URL: https://svnweb.freebsd.org/changeset/base/350624

  amdtemp(4), amdsmn(4): Attach to Ryzen 3 (Zen 2) hostbridges

  PR:	239607
  Reported by:	"drclaw" <drclaw AT gmail.com>

Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2019-08-06 09:49:08 UTC
@Conrad Thanks for resolving this so quickly! Could/should this be merged to stable/12,11 or did amdtemp et al only make it to 12?

Re-open for MFC (at least to 12)
Comment 4 Conrad Meyer freebsd_committer 2019-08-06 15:49:26 UTC
(In reply to Kubilay Kocak from comment #3)
> @Conrad Thanks for resolving this so quickly! Could/should this be merged to
> stable/12,11 or did amdtemp et al only make it to 12?
> Re-open for MFC (at least to 12)

They're both in 12 thanks to mav and vangyzen.  I don't do MFCs myself, but anyone else is welcome to.
Comment 5 drclaw 2019-08-08 23:04:25 UTC
Sorry for the delay.

Finally got around to installing kernel with the patches, looks good here. Thanks for fixing so quickly :)

% uname -a
FreeBSD dutch 12.0-STABLE FreeBSD 12.0-STABLE #2 r350624M: Wed Aug  7 08:43:02 AEST 2019     root@dutch:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

% sysctl dev.cpu | grep -i temp
dev.cpu.11.temperature: 40.1C
dev.cpu.10.temperature: 40.1C
dev.cpu.9.temperature: 40.1C
dev.cpu.8.temperature: 40.1C
dev.cpu.7.temperature: 40.1C
dev.cpu.6.temperature: 40.1C
dev.cpu.5.temperature: 40.1C
dev.cpu.4.temperature: 40.1C
dev.cpu.3.temperature: 40.1C
dev.cpu.2.temperature: 40.1C
dev.cpu.1.temperature: 40.1C
dev.cpu.0.temperature: 40.1C
Comment 6 Conrad Meyer freebsd_committer 2019-08-08 23:18:32 UTC
Cool, thanks for confirming the fix!
Comment 7 drclaw 2019-11-07 22:38:09 UTC
Still present in 12.1, updating to reflect.

Patch works fine. Just applied and rebuilt kernel and my temps are back again.
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2019-11-15 01:58:49 UTC
Unless an EN or approval to merge support to releng/12.1 is possible, the feature/support will land in 12.2-RELEASE.

It is apparently presently supported in CURRENT 12-STABLE (stable/12), effectively 'resolving' this issue, minus a merge to stable/11.


- Would you consider a merge to stable/11 ?
- I couldn't find the MFC commit to stable/12 for this issue (base r350624), can you mention which one it was in "base r<revision>" comment formatting