Skip to content

Commit 0ba9e3a

Browse files
ffainelligregkh
authored andcommitted
serial: 8250: Add missing wakeup event reporting
An 8250 UART configured as a wake-up source would not have reported itself through sysfs as being the source of wake-up, correct that. Fixes: b3b708f ("wake up from a serial port") Signed-off-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d57d56e commit 0ba9e3a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/tty/serial/8250/8250_port.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/moduleparam.h>
1616
#include <linux/ioport.h>
1717
#include <linux/init.h>
18+
#include <linux/irq.h>
1819
#include <linux/console.h>
1920
#include <linux/gpio/consumer.h>
2021
#include <linux/sysrq.h>
@@ -1932,6 +1933,7 @@ static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir)
19321933
int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
19331934
{
19341935
struct uart_8250_port *up = up_to_u8250p(port);
1936+
struct tty_port *tport = &port->state->port;
19351937
bool skip_rx = false;
19361938
unsigned long flags;
19371939
u16 status;
@@ -1957,6 +1959,8 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
19571959
skip_rx = true;
19581960

19591961
if (status & (UART_LSR_DR | UART_LSR_BI) && !skip_rx) {
1962+
if (irqd_is_wakeup_set(irq_get_irq_data(port->irq)))
1963+
pm_wakeup_event(tport->tty->dev, 0);
19601964
if (!up->dma || handle_rx_dma(up, iir))
19611965
status = serial8250_rx_chars(up, status);
19621966
}

0 commit comments

Comments
 (0)