Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "serial: 8250_omap: Set the console genpd always on if no console suspend"

This reverts commit 68e6939ea9ec3d6579eadeab16060339cdeaf940.

Kevin reported that this causes a crash during suspend on platforms that
dont use PM domains.

Link: https://lore.kernel.org/r/7ha5hgpchq.fsf@baylibre.com
Cc: Thomas Richard <thomas.richard@bootlin.com>
Fixes: 68e6939ea9ec ("serial: 8250_omap: Set the console genpd always on if no console suspend")
Cc: stable <stable@kernel.org>
Reported-by: Kevin Hilman <khilman@kernel.org>
Signed-off-by: Griffin Kroah-Hartman <griffin@kroah.com>
Link: https://lore.kernel.org/r/20240814111747.82371-1-griffin@kroah.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Griffin Kroah-Hartman and committed by
Greg Kroah-Hartman
0863bffd c9f6613b

+5 -28
+5 -28
drivers/tty/serial/8250/8250_omap.c
··· 27 27 #include <linux/pm_wakeirq.h> 28 28 #include <linux/dma-mapping.h> 29 29 #include <linux/sys_soc.h> 30 - #include <linux/pm_domain.h> 31 30 32 31 #include "8250.h" 33 32 ··· 117 118 /* Timeout low and High */ 118 119 #define UART_OMAP_TO_L 0x26 119 120 #define UART_OMAP_TO_H 0x27 120 - 121 - /* 122 - * Copy of the genpd flags for the console. 123 - * Only used if console suspend is disabled 124 - */ 125 - static unsigned int genpd_flags_console; 126 121 127 122 struct omap8250_priv { 128 123 void __iomem *membase; ··· 1648 1655 { 1649 1656 struct omap8250_priv *priv = dev_get_drvdata(dev); 1650 1657 struct uart_8250_port *up = serial8250_get_port(priv->line); 1651 - struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain); 1652 1658 int err = 0; 1653 1659 1654 1660 serial8250_suspend_port(priv->line); ··· 1658 1666 if (!device_may_wakeup(dev)) 1659 1667 priv->wer = 0; 1660 1668 serial_out(up, UART_OMAP_WER, priv->wer); 1661 - if (uart_console(&up->port)) { 1662 - if (console_suspend_enabled) 1663 - err = pm_runtime_force_suspend(dev); 1664 - else { 1665 - /* 1666 - * The pd shall not be powered-off (no console suspend). 1667 - * Make copy of genpd flags before to set it always on. 1668 - * The original value is restored during the resume. 1669 - */ 1670 - genpd_flags_console = genpd->flags; 1671 - genpd->flags |= GENPD_FLAG_ALWAYS_ON; 1672 - } 1673 - } 1669 + if (uart_console(&up->port) && console_suspend_enabled) 1670 + err = pm_runtime_force_suspend(dev); 1674 1671 flush_work(&priv->qos_work); 1675 1672 1676 1673 return err; ··· 1669 1688 { 1670 1689 struct omap8250_priv *priv = dev_get_drvdata(dev); 1671 1690 struct uart_8250_port *up = serial8250_get_port(priv->line); 1672 - struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain); 1673 1691 int err; 1674 1692 1675 1693 if (uart_console(&up->port) && console_suspend_enabled) { 1676 - if (console_suspend_enabled) { 1677 - err = pm_runtime_force_resume(dev); 1678 - if (err) 1679 - return err; 1680 - } else 1681 - genpd->flags = genpd_flags_console; 1694 + err = pm_runtime_force_resume(dev); 1695 + if (err) 1696 + return err; 1682 1697 } 1683 1698 1684 1699 serial8250_resume_port(priv->line);