Skip to content

Commit dd7c46d

Browse files
committed
Revert "cpufreq: intel_pstate: Process HWP Guaranteed change notification"
Revert commit d0e936a ("cpufreq: intel_pstate: Process HWP Guaranteed change notification"), because it causes a NULL pointer dereference to occur on Lenovo X1 gen9 laptops due to an HWP guaranteed performance change interrupt arriving prematurely. This feature will be revisited in the next cycle. Reported-by: Jens Axboe <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 4bf8e58 commit dd7c46d

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <asm/cpu_device_id.h>
3333
#include <asm/cpufeature.h>
3434
#include <asm/intel-family.h>
35-
#include "../drivers/thermal/intel/thermal_interrupt.h"
3635

3736
#define INTEL_PSTATE_SAMPLING_INTERVAL (10 * NSEC_PER_MSEC)
3837

@@ -220,7 +219,6 @@ struct global_params {
220219
* @sched_flags: Store scheduler flags for possible cross CPU update
221220
* @hwp_boost_min: Last HWP boosted min performance
222221
* @suspended: Whether or not the driver has been suspended.
223-
* @hwp_notify_work: workqueue for HWP notifications.
224222
*
225223
* This structure stores per CPU instance data for all CPUs.
226224
*/
@@ -259,7 +257,6 @@ struct cpudata {
259257
unsigned int sched_flags;
260258
u32 hwp_boost_min;
261259
bool suspended;
262-
struct delayed_work hwp_notify_work;
263260
};
264261

265262
static struct cpudata **all_cpu_data;
@@ -1628,40 +1625,6 @@ static void intel_pstate_sysfs_hide_hwp_dynamic_boost(void)
16281625

16291626
/************************** sysfs end ************************/
16301627

1631-
static void intel_pstate_notify_work(struct work_struct *work)
1632-
{
1633-
mutex_lock(&intel_pstate_driver_lock);
1634-
cpufreq_update_policy(smp_processor_id());
1635-
wrmsrl(MSR_HWP_STATUS, 0);
1636-
mutex_unlock(&intel_pstate_driver_lock);
1637-
}
1638-
1639-
void notify_hwp_interrupt(void)
1640-
{
1641-
unsigned int this_cpu = smp_processor_id();
1642-
struct cpudata *cpudata;
1643-
u64 value;
1644-
1645-
if (!hwp_active || !boot_cpu_has(X86_FEATURE_HWP_NOTIFY))
1646-
return;
1647-
1648-
rdmsrl(MSR_HWP_STATUS, value);
1649-
if (!(value & 0x01))
1650-
return;
1651-
1652-
cpudata = all_cpu_data[this_cpu];
1653-
schedule_delayed_work_on(this_cpu, &cpudata->hwp_notify_work, msecs_to_jiffies(10));
1654-
}
1655-
1656-
static void intel_pstate_enable_hwp_interrupt(struct cpudata *cpudata)
1657-
{
1658-
/* Enable HWP notification interrupt for guaranteed performance change */
1659-
if (boot_cpu_has(X86_FEATURE_HWP_NOTIFY)) {
1660-
INIT_DELAYED_WORK(&cpudata->hwp_notify_work, intel_pstate_notify_work);
1661-
wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x01);
1662-
}
1663-
}
1664-
16651628
static void intel_pstate_hwp_enable(struct cpudata *cpudata)
16661629
{
16671630
/* First disable HWP notification interrupt as we don't process them */
@@ -1671,8 +1634,6 @@ static void intel_pstate_hwp_enable(struct cpudata *cpudata)
16711634
wrmsrl_on_cpu(cpudata->cpu, MSR_PM_ENABLE, 0x1);
16721635
if (cpudata->epp_default == -EINVAL)
16731636
cpudata->epp_default = intel_pstate_get_epp(cpudata, 0);
1674-
1675-
intel_pstate_enable_hwp_interrupt(cpudata);
16761637
}
16771638

16781639
static int atom_get_min_pstate(void)

0 commit comments

Comments
 (0)