Revert "serial: 8250_omap: Set the console genpd always on if no console suspend"
BugLink: https://bugs.launchpad.net/bugs/2084005 commit 0863bffda1131fd2fa9c05b653ad9ee3d8db127e upstream. This reverts commit68e6939ea9. 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:68e6939ea9("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> Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
4df49ff0a4
commit
082d54cdd9
@@ -28,7 +28,6 @@
|
||||
#include <linux/pm_wakeirq.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/sys_soc.h>
|
||||
#include <linux/pm_domain.h>
|
||||
|
||||
#include "8250.h"
|
||||
|
||||
@@ -116,12 +115,6 @@
|
||||
/* RX FIFO occupancy indicator */
|
||||
#define UART_OMAP_RX_LVL 0x19
|
||||
|
||||
/*
|
||||
* Copy of the genpd flags for the console.
|
||||
* Only used if console suspend is disabled
|
||||
*/
|
||||
static unsigned int genpd_flags_console;
|
||||
|
||||
struct omap8250_priv {
|
||||
void __iomem *membase;
|
||||
int line;
|
||||
@@ -1647,7 +1640,6 @@ static int omap8250_suspend(struct device *dev)
|
||||
{
|
||||
struct omap8250_priv *priv = dev_get_drvdata(dev);
|
||||
struct uart_8250_port *up = serial8250_get_port(priv->line);
|
||||
struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
|
||||
int err = 0;
|
||||
|
||||
serial8250_suspend_port(priv->line);
|
||||
@@ -1658,19 +1650,8 @@ static int omap8250_suspend(struct device *dev)
|
||||
if (!device_may_wakeup(dev))
|
||||
priv->wer = 0;
|
||||
serial_out(up, UART_OMAP_WER, priv->wer);
|
||||
if (uart_console(&up->port)) {
|
||||
if (console_suspend_enabled)
|
||||
err = pm_runtime_force_suspend(dev);
|
||||
else {
|
||||
/*
|
||||
* The pd shall not be powered-off (no console suspend).
|
||||
* Make copy of genpd flags before to set it always on.
|
||||
* The original value is restored during the resume.
|
||||
*/
|
||||
genpd_flags_console = genpd->flags;
|
||||
genpd->flags |= GENPD_FLAG_ALWAYS_ON;
|
||||
}
|
||||
}
|
||||
if (uart_console(&up->port) && console_suspend_enabled)
|
||||
err = pm_runtime_force_suspend(dev);
|
||||
flush_work(&priv->qos_work);
|
||||
|
||||
return err;
|
||||
@@ -1680,16 +1661,12 @@ static int omap8250_resume(struct device *dev)
|
||||
{
|
||||
struct omap8250_priv *priv = dev_get_drvdata(dev);
|
||||
struct uart_8250_port *up = serial8250_get_port(priv->line);
|
||||
struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
|
||||
int err;
|
||||
|
||||
if (uart_console(&up->port) && console_suspend_enabled) {
|
||||
if (console_suspend_enabled) {
|
||||
err = pm_runtime_force_resume(dev);
|
||||
if (err)
|
||||
return err;
|
||||
} else
|
||||
genpd->flags = genpd_flags_console;
|
||||
err = pm_runtime_force_resume(dev);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
serial8250_resume_port(priv->line);
|
||||
|
||||
Reference in New Issue
Block a user