mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 18:17:49 +07:00
d0f9f16788
Calling platform-specific code unconditionally blows up when running
an ARCH_MULTIPLATFORM kernel on a different platform. Don't do it.
Reported-by: Paolo Pisati <p.pisati@gmail.com>
Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: stable@vger.kernel.org # v4.8+
Fixes: a30eceb7a5
("ARM: tango: add Suspend-to-RAM support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
32 lines
625 B
C
32 lines
625 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <linux/init.h>
|
|
#include <linux/suspend.h>
|
|
#include <asm/suspend.h>
|
|
#include "smc.h"
|
|
#include "pm.h"
|
|
|
|
static int tango_pm_powerdown(unsigned long arg)
|
|
{
|
|
tango_suspend(__pa_symbol(cpu_resume));
|
|
|
|
return -EIO; /* tango_suspend has failed */
|
|
}
|
|
|
|
static int tango_pm_enter(suspend_state_t state)
|
|
{
|
|
if (state == PM_SUSPEND_MEM)
|
|
return cpu_suspend(0, tango_pm_powerdown);
|
|
|
|
return -EINVAL;
|
|
}
|
|
|
|
static const struct platform_suspend_ops tango_pm_ops = {
|
|
.enter = tango_pm_enter,
|
|
.valid = suspend_valid_only_mem,
|
|
};
|
|
|
|
void __init tango_pm_init(void)
|
|
{
|
|
suspend_set_ops(&tango_pm_ops);
|
|
}
|