Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143930267
D55001.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D55001.id.diff
View Options
diff --git a/sys/x86/cpufreq/hwpstate_amd.c b/sys/x86/cpufreq/hwpstate_amd.c
--- a/sys/x86/cpufreq/hwpstate_amd.c
+++ b/sys/x86/cpufreq/hwpstate_amd.c
@@ -209,6 +209,13 @@
{0, 0}
};
+static inline void
+check_cppc_enabled(const struct hwpstate_softc *const sc, const char *const func)
+{
+ KASSERT((sc->flags & PSTATE_CPPC) != 0, (HWP_AMD_CLASSNAME
+ ": %s() called but PSTATE_CPPC not set", func));
+}
+
struct get_cppc_regs_data {
uint64_t enable;
uint64_t caps;
@@ -277,8 +284,10 @@
int ret;
sc = (struct hwpstate_softc *)arg1;
- dev = sc->dev;
+ /* Sysctl knob does not exist if PSTATE_CPPC is not set. */
+ check_cppc_enabled(sc, __func__);
+ dev = sc->dev;
pc = cpu_get_pcpu(dev);
if (pc == NULL)
return (ENXIO);
@@ -343,8 +352,8 @@
dev = oidp->oid_arg1;
sc = device_get_softc(dev);
- if (!(sc->flags & PSTATE_CPPC))
- return (ENODEV);
+ /* Sysctl knob does not exist if PSTATE_CPPC is not set. */
+ check_cppc_enabled(sc, __func__);
val = BITS_VALUE(AMD_CPPC_REQUEST_EPP_BITS, sc->req) * 100 /
max_energy_perf;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 3, 3:43 AM (9 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28358745
Default Alt Text
D55001.id.diff (1 KB)
Attached To
Mode
D55001: hwpstate_amd(4): Assert PSTATE_CPPC is on in corresponding sysctl handlers
Attached
Detach File
Event Timeline
Log In to Comment