diff options
Diffstat (limited to 'debian/patches-rt/thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch')
-rw-r--r-- | debian/patches-rt/thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/debian/patches-rt/thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch b/debian/patches-rt/thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch index 9b644bfb0..fbf831409 100644 --- a/debian/patches-rt/thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch +++ b/debian/patches-rt/thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch @@ -1,11 +1,11 @@ From: Clark Williams <williams@redhat.com> Date: Mon, 15 Jul 2019 15:25:00 -0500 -Subject: [PATCH] thermal/x86_pkg_temp: make pkg_temp_lock a raw spinlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.17-rt9.tar.xz +Subject: [PATCH] thermal/x86_pkg_temp: Make pkg_temp_lock a raw_spinlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.4/older/patches-5.4.3-rt1.tar.xz The spinlock pkg_temp_lock has the potential of being taken in atomic -context on v5.2-rt PREEMPT_RT. It's static and limited scope so -go ahead and make it a raw spinlock. +context because it can be acquired from the thermal IRQ vector. +It's static and limited scope so go ahead and make it a raw spinlock. Signed-off-by: Clark Williams <williams@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> @@ -15,16 +15,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c -@@ -63,7 +63,7 @@ static int max_packages __read_mostly; - /* Array of package pointers */ - static struct pkg_device **packages; +@@ -63,7 +63,7 @@ static int max_id __read_mostly; + /* Array of zone pointers */ + static struct zone_device **zones; /* Serializes interrupt notification, work and hotplug */ -static DEFINE_SPINLOCK(pkg_temp_lock); +static DEFINE_RAW_SPINLOCK(pkg_temp_lock); /* Protects zone operation in the work function against hotplug removal */ static DEFINE_MUTEX(thermal_zone_mutex); -@@ -279,12 +279,12 @@ static void pkg_temp_thermal_threshold_w +@@ -266,12 +266,12 @@ static void pkg_temp_thermal_threshold_w u64 msr_val, wr_val; mutex_lock(&thermal_zone_mutex); @@ -32,14 +32,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + raw_spin_lock_irq(&pkg_temp_lock); ++pkg_work_cnt; - pkgdev = pkg_temp_thermal_get_dev(cpu); - if (!pkgdev) { + zonedev = pkg_temp_thermal_get_dev(cpu); + if (!zonedev) { - spin_unlock_irq(&pkg_temp_lock); + raw_spin_unlock_irq(&pkg_temp_lock); mutex_unlock(&thermal_zone_mutex); return; } -@@ -298,7 +298,7 @@ static void pkg_temp_thermal_threshold_w +@@ -285,7 +285,7 @@ static void pkg_temp_thermal_threshold_w } enable_pkg_thres_interrupt(); @@ -48,8 +48,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * If tzone is not NULL, then thermal_zone_mutex will prevent the -@@ -323,7 +323,7 @@ static int pkg_thermal_notify(u64 msr_va - struct pkg_device *pkgdev; +@@ -310,7 +310,7 @@ static int pkg_thermal_notify(u64 msr_va + struct zone_device *zonedev; unsigned long flags; - spin_lock_irqsave(&pkg_temp_lock, flags); @@ -57,8 +57,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ++pkg_interrupt_cnt; disable_pkg_thres_interrupt(); -@@ -335,7 +335,7 @@ static int pkg_thermal_notify(u64 msr_va - pkg_thermal_schedule_work(pkgdev->cpu, &pkgdev->work); +@@ -322,7 +322,7 @@ static int pkg_thermal_notify(u64 msr_va + pkg_thermal_schedule_work(zonedev->cpu, &zonedev->work); } - spin_unlock_irqrestore(&pkg_temp_lock, flags); @@ -66,19 +66,19 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } -@@ -381,9 +381,9 @@ static int pkg_temp_thermal_device_add(u - pkgdev->msr_pkg_therm_high); +@@ -368,9 +368,9 @@ static int pkg_temp_thermal_device_add(u + zonedev->msr_pkg_therm_high); - cpumask_set_cpu(cpu, &pkgdev->cpumask); + cpumask_set_cpu(cpu, &zonedev->cpumask); - spin_lock_irq(&pkg_temp_lock); + raw_spin_lock_irq(&pkg_temp_lock); - packages[pkgid] = pkgdev; + zones[id] = zonedev; - spin_unlock_irq(&pkg_temp_lock); + raw_spin_unlock_irq(&pkg_temp_lock); return 0; } -@@ -420,7 +420,7 @@ static int pkg_thermal_cpu_offline(unsig +@@ -407,7 +407,7 @@ static int pkg_thermal_cpu_offline(unsig } /* Protect against work and interrupts */ @@ -87,20 +87,20 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Check whether this cpu was the current target and store the new -@@ -452,9 +452,9 @@ static int pkg_thermal_cpu_offline(unsig +@@ -439,9 +439,9 @@ static int pkg_thermal_cpu_offline(unsig * To cancel the work we need to drop the lock, otherwise * we might deadlock if the work needs to be flushed. */ - spin_unlock_irq(&pkg_temp_lock); + raw_spin_unlock_irq(&pkg_temp_lock); - cancel_delayed_work_sync(&pkgdev->work); + cancel_delayed_work_sync(&zonedev->work); - spin_lock_irq(&pkg_temp_lock); + raw_spin_lock_irq(&pkg_temp_lock); /* * If this is not the last cpu in the package and the work * did not run after we dropped the lock above, then we -@@ -465,7 +465,7 @@ static int pkg_thermal_cpu_offline(unsig - pkg_thermal_schedule_work(target, &pkgdev->work); +@@ -452,7 +452,7 @@ static int pkg_thermal_cpu_offline(unsig + pkg_thermal_schedule_work(target, &zonedev->work); } - spin_unlock_irq(&pkg_temp_lock); |