aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/patches-5.10/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
diff options
context:
space:
mode:
authorIlya Lipnitskiy <ilya.lipnitskiy@gmail.com>2021-02-19 19:11:14 -0800
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2021-03-06 11:24:12 +0100
commit10267e17299806f9885d086147878f6c492cb904 (patch)
treef120f0b1f4b4e10a7d8f7dc17e0cb997fb7184e1 /target/linux/ramips/patches-5.10/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
parentef1e6520164e19451bc9cb8275cf293a699e1684 (diff)
downloadupstream-10267e17299806f9885d086147878f6c492cb904.tar.gz
upstream-10267e17299806f9885d086147878f6c492cb904.tar.bz2
upstream-10267e17299806f9885d086147878f6c492cb904.zip
ramips: 5.10: port and refresh patches, ralink drv
Enable testing kernel. Fix compile errors by using new kernel APIs. Fix fuzz by manually editing patches to ensure the code goes in the right place. For 721-NET-no-auto-carrier-off-support.patch, revert upstream commit a307593a6 to keep the OpenWrt ralink driver operational. Add mt7621-pci-phy patch to select REGMAP_MMIO as discussed in PR #3693 and #3952. Run automatic quilt refresh on the rest. Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Diffstat (limited to 'target/linux/ramips/patches-5.10/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch')
-rw-r--r--target/linux/ramips/patches-5.10/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch32
1 files changed, 25 insertions, 7 deletions
diff --git a/target/linux/ramips/patches-5.10/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch b/target/linux/ramips/patches-5.10/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
index 773c74f4e9..a0b81bc6c5 100644
--- a/target/linux/ramips/patches-5.10/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
+++ b/target/linux/ramips/patches-5.10/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
@@ -31,15 +31,19 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
bool
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
-@@ -15,6 +15,26 @@
+@@ -16,6 +16,31 @@
#include <asm/time.h>
#include <asm/cevt-r4k.h>
++#ifdef CONFIG_CEVT_SYSTICK_QUIRK
+static int mips_state_oneshot(struct clock_event_device *evt)
+{
++ unsigned long flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED;
+ if (!cp0_timer_irq_installed) {
+ cp0_timer_irq_installed = 1;
-+ setup_irq(evt->irq, &c0_compare_irqaction);
++ if (request_irq(evt->irq, c0_compare_interrupt, flags, "timer",
++ c0_compare_interrupt))
++ pr_err("Failed to request irq %d (timer)\n", evt->irq);
+ }
+
+ return 0;
@@ -49,21 +53,34 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+{
+ if (cp0_timer_irq_installed) {
+ cp0_timer_irq_installed = 0;
-+ remove_irq(evt->irq, &c0_compare_irqaction);
++ free_irq(evt->irq, NULL);
+ }
+
+ return 0;
+}
++#endif
+
static int mips_next_event(unsigned long delta,
struct clock_event_device *evt)
{
-@@ -281,17 +301,21 @@ int r4k_clockevent_init(void)
+@@ -296,7 +321,9 @@ core_initcall(r4k_register_cpufreq_notif
+
+ int r4k_clockevent_init(void)
+ {
++#ifndef CONFIG_CEVT_SYSTICK_QUIRK
+ unsigned long flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED;
++#endif
+ unsigned int cpu = smp_processor_id();
+ struct clock_event_device *cd;
+ unsigned int irq, min_delta;
+@@ -326,11 +353,16 @@ int r4k_clockevent_init(void)
cd->rating = 300;
cd->irq = irq;
cd->cpumask = cpumask_of(cpu);
++#ifdef CONFIG_CEVT_SYSTICK_QUIRK
+ cd->set_state_shutdown = mips_state_shutdown;
+ cd->set_state_oneshot = mips_state_oneshot;
++#endif
cd->set_next_event = mips_next_event;
cd->event_handler = mips_event_handler;
@@ -73,9 +90,10 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (cp0_timer_irq_installed)
return 0;
- cp0_timer_irq_installed = 1;
-
- setup_irq(irq, &c0_compare_irqaction);
+@@ -339,6 +371,7 @@ int r4k_clockevent_init(void)
+ if (request_irq(irq, c0_compare_interrupt, flags, "timer",
+ c0_compare_interrupt))
+ pr_err("Failed to request irq %d (timer)\n", irq);
+#endif
return 0;