Skip to content

Commit 0863bff

Browse files
griffinkhgregkh
authored andcommitted
Revert "serial: 8250_omap: Set the console genpd always on if no console suspend"
This reverts commit 68e6939. Kevin reported that this causes a crash during suspend on platforms that dont use PM domains. Link: https://lore.kernel.org/r/[email protected] Cc: Thomas Richard <[email protected]> Fixes: 68e6939 ("serial: 8250_omap: Set the console genpd always on if no console suspend") Cc: stable <[email protected]> Reported-by: Kevin Hilman <[email protected]> Signed-off-by: Griffin Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c9f6613 commit 0863bff

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

drivers/tty/serial/8250/8250_omap.c

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <linux/pm_wakeirq.h>
2828
#include <linux/dma-mapping.h>
2929
#include <linux/sys_soc.h>
30-
#include <linux/pm_domain.h>
3130

3231
#include "8250.h"
3332

@@ -119,12 +118,6 @@
119118
#define UART_OMAP_TO_L 0x26
120119
#define UART_OMAP_TO_H 0x27
121120

122-
/*
123-
* Copy of the genpd flags for the console.
124-
* Only used if console suspend is disabled
125-
*/
126-
static unsigned int genpd_flags_console;
127-
128121
struct omap8250_priv {
129122
void __iomem *membase;
130123
int line;
@@ -1655,7 +1648,6 @@ static int omap8250_suspend(struct device *dev)
16551648
{
16561649
struct omap8250_priv *priv = dev_get_drvdata(dev);
16571650
struct uart_8250_port *up = serial8250_get_port(priv->line);
1658-
struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
16591651
int err = 0;
16601652

16611653
serial8250_suspend_port(priv->line);
@@ -1666,19 +1658,8 @@ static int omap8250_suspend(struct device *dev)
16661658
if (!device_may_wakeup(dev))
16671659
priv->wer = 0;
16681660
serial_out(up, UART_OMAP_WER, priv->wer);
1669-
if (uart_console(&up->port)) {
1670-
if (console_suspend_enabled)
1671-
err = pm_runtime_force_suspend(dev);
1672-
else {
1673-
/*
1674-
* The pd shall not be powered-off (no console suspend).
1675-
* Make copy of genpd flags before to set it always on.
1676-
* The original value is restored during the resume.
1677-
*/
1678-
genpd_flags_console = genpd->flags;
1679-
genpd->flags |= GENPD_FLAG_ALWAYS_ON;
1680-
}
1681-
}
1661+
if (uart_console(&up->port) && console_suspend_enabled)
1662+
err = pm_runtime_force_suspend(dev);
16821663
flush_work(&priv->qos_work);
16831664

16841665
return err;
@@ -1688,16 +1669,12 @@ static int omap8250_resume(struct device *dev)
16881669
{
16891670
struct omap8250_priv *priv = dev_get_drvdata(dev);
16901671
struct uart_8250_port *up = serial8250_get_port(priv->line);
1691-
struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
16921672
int err;
16931673

16941674
if (uart_console(&up->port) && console_suspend_enabled) {
1695-
if (console_suspend_enabled) {
1696-
err = pm_runtime_force_resume(dev);
1697-
if (err)
1698-
return err;
1699-
} else
1700-
genpd->flags = genpd_flags_console;
1675+
err = pm_runtime_force_resume(dev);
1676+
if (err)
1677+
return err;
17011678
}
17021679

17031680
serial8250_resume_port(priv->line);

0 commit comments

Comments
 (0)