diff options
-rw-r--r-- | meta-yocto-bsp/recipes-kernel/linux/files/0001-Revert-serial-8250_omap-Drop-pm_runtime_irq_safe.patch | 130 | ||||
-rw-r--r-- | meta-yocto-bsp/recipes-kernel/linux/linux-yocto_6.12.bbappend | 2 |
2 files changed, 132 insertions, 0 deletions
diff --git a/meta-yocto-bsp/recipes-kernel/linux/files/0001-Revert-serial-8250_omap-Drop-pm_runtime_irq_safe.patch b/meta-yocto-bsp/recipes-kernel/linux/files/0001-Revert-serial-8250_omap-Drop-pm_runtime_irq_safe.patch new file mode 100644 index 0000000000..8837dd2346 --- /dev/null +++ b/meta-yocto-bsp/recipes-kernel/linux/files/0001-Revert-serial-8250_omap-Drop-pm_runtime_irq_safe.patch | |||
@@ -0,0 +1,130 @@ | |||
1 | From cc255f5132cf39e9154340cf58780f8c763c6481 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ross Burton <ross.burton@arm.com> | ||
3 | Date: Thu, 23 Jan 2025 17:06:08 +0000 | ||
4 | Subject: [PATCH] Revert "serial: 8250_omap: Drop pm_runtime_irq_safe()" | ||
5 | |||
6 | This reverts commit 8700a7ea5519fb0b3bad2362adfeac358c2119ce. | ||
7 | |||
8 | Upstream-Status: Inappropriate | ||
9 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
10 | --- | ||
11 | drivers/tty/serial/8250/8250_omap.c | 29 ++++++++--------------------- | ||
12 | 1 file changed, 8 insertions(+), 21 deletions(-) | ||
13 | |||
14 | diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c | ||
15 | index 0dd68bdbfbcf7..db24d7d1dcb67 100644 | ||
16 | --- a/drivers/tty/serial/8250/8250_omap.c | ||
17 | +++ b/drivers/tty/serial/8250/8250_omap.c | ||
18 | @@ -8,7 +8,6 @@ | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | -#include <linux/atomic.h> | ||
23 | #include <linux/clk.h> | ||
24 | #include <linux/device.h> | ||
25 | #include <linux/io.h> | ||
26 | @@ -134,7 +133,6 @@ struct omap8250_priv { | ||
27 | |||
28 | u8 tx_trigger; | ||
29 | u8 rx_trigger; | ||
30 | - atomic_t active; | ||
31 | bool is_suspending; | ||
32 | int wakeirq; | ||
33 | u32 latency; | ||
34 | @@ -636,23 +634,14 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) | ||
35 | unsigned int iir, lsr; | ||
36 | int ret; | ||
37 | |||
38 | - pm_runtime_get_noresume(port->dev); | ||
39 | - | ||
40 | - /* Shallow idle state wake-up to an IO interrupt? */ | ||
41 | - if (atomic_add_unless(&priv->active, 1, 1)) { | ||
42 | - priv->latency = priv->calc_latency; | ||
43 | - schedule_work(&priv->qos_work); | ||
44 | - } | ||
45 | - | ||
46 | #ifdef CONFIG_SERIAL_8250_DMA | ||
47 | if (up->dma) { | ||
48 | ret = omap_8250_dma_handle_irq(port); | ||
49 | - pm_runtime_mark_last_busy(port->dev); | ||
50 | - pm_runtime_put(port->dev); | ||
51 | return IRQ_RETVAL(ret); | ||
52 | } | ||
53 | #endif | ||
54 | |||
55 | + serial8250_rpm_get(up); | ||
56 | lsr = serial_port_in(port, UART_LSR); | ||
57 | iir = serial_port_in(port, UART_IIR); | ||
58 | ret = serial8250_handle_irq(port, iir); | ||
59 | @@ -701,8 +690,7 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) | ||
60 | schedule_delayed_work(&up->overrun_backoff, delay); | ||
61 | } | ||
62 | |||
63 | - pm_runtime_mark_last_busy(port->dev); | ||
64 | - pm_runtime_put(port->dev); | ||
65 | + serial8250_rpm_put(up); | ||
66 | |||
67 | return IRQ_RETVAL(ret); | ||
68 | } | ||
69 | @@ -1314,8 +1302,11 @@ static int omap_8250_dma_handle_irq(struct uart_port *port) | ||
70 | u16 status; | ||
71 | u8 iir; | ||
72 | |||
73 | + serial8250_rpm_get(up); | ||
74 | + | ||
75 | iir = serial_port_in(port, UART_IIR); | ||
76 | if (iir & UART_IIR_NO_INT) { | ||
77 | + serial8250_rpm_put(up); | ||
78 | return IRQ_HANDLED; | ||
79 | } | ||
80 | |||
81 | @@ -1348,6 +1339,7 @@ static int omap_8250_dma_handle_irq(struct uart_port *port) | ||
82 | |||
83 | uart_unlock_and_check_sysrq(port); | ||
84 | |||
85 | + serial8250_rpm_put(up); | ||
86 | return 1; | ||
87 | } | ||
88 | |||
89 | @@ -1539,6 +1531,8 @@ static int omap8250_probe(struct platform_device *pdev) | ||
90 | if (!of_get_available_child_count(pdev->dev.of_node)) | ||
91 | pm_runtime_set_autosuspend_delay(&pdev->dev, -1); | ||
92 | |||
93 | + pm_runtime_irq_safe(&pdev->dev); | ||
94 | + | ||
95 | pm_runtime_get_sync(&pdev->dev); | ||
96 | |||
97 | omap_serial_fill_features_erratas(&up, priv); | ||
98 | @@ -1776,7 +1770,6 @@ static int omap8250_runtime_suspend(struct device *dev) | ||
99 | |||
100 | priv->latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE; | ||
101 | schedule_work(&priv->qos_work); | ||
102 | - atomic_set(&priv->active, 0); | ||
103 | |||
104 | return 0; | ||
105 | } | ||
106 | @@ -1786,10 +1779,6 @@ static int omap8250_runtime_resume(struct device *dev) | ||
107 | struct omap8250_priv *priv = dev_get_drvdata(dev); | ||
108 | struct uart_8250_port *up = NULL; | ||
109 | |||
110 | - /* Did the hardware wake to a device IO interrupt before a wakeirq? */ | ||
111 | - if (atomic_read(&priv->active)) | ||
112 | - return 0; | ||
113 | - | ||
114 | if (priv->line >= 0) | ||
115 | up = serial8250_get_port(priv->line); | ||
116 | |||
117 | @@ -1805,10 +1794,8 @@ static int omap8250_runtime_resume(struct device *dev) | ||
118 | uart_port_unlock_irq(&up->port); | ||
119 | } | ||
120 | |||
121 | - atomic_set(&priv->active, 1); | ||
122 | priv->latency = priv->calc_latency; | ||
123 | schedule_work(&priv->qos_work); | ||
124 | - | ||
125 | return 0; | ||
126 | } | ||
127 | |||
128 | -- | ||
129 | 2.43.0 | ||
130 | |||
diff --git a/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_6.12.bbappend b/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_6.12.bbappend index 1ffd2194d9..831cb556be 100644 --- a/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_6.12.bbappend +++ b/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_6.12.bbappend | |||
@@ -7,3 +7,5 @@ KMACHINE:beaglebone-yocto ?= "beaglebone" | |||
7 | KMACHINE:genericx86 ?= "common-pc" | 7 | KMACHINE:genericx86 ?= "common-pc" |
8 | KMACHINE:genericx86-64 ?= "common-pc-64" | 8 | KMACHINE:genericx86-64 ?= "common-pc-64" |
9 | 9 | ||
10 | FILESEXTRAPATHS:prepend:genericarm64 := "${THISDIR}/files:" | ||
11 | SRC_URI:append:genericarm64 = " file://0001-Revert-serial-8250_omap-Drop-pm_runtime_irq_safe.patch" | ||