Commit 6f2b6422 authored by Alan Tull's avatar Alan Tull Committed by Borislav Petkov

EDAC, altera: Do not allow suspend when EDAC is enabled

Suspend-to-RAM and EDAC support are mutually exclusive on SOCFPGA. If
EDAC is enabled, it will prevent the platform from going into suspend.

The reason is that the IRQ vectors for OCRAM reside on DDR and in
Suspend-to-RAM mode we're executing out of OCRAM. If an ECC error
occurs, we can't handle it so it was decided to make them mutually
exclusive.
Signed-off-by: default avatarAlan Tull <atull@opensource.altera.com>
Signed-off-by: default avatarDinh Nguyen <dinguyen@opensource.altera.com>
Cc: dinh.linux@gmail.com
Cc: dougthompson@xmission.com
Cc: linux-edac <linux-edac@vger.kernel.org>
Cc: mchehab@osg.samsung.com
Cc: tthayer@opensource.altera.com
Link: http://lkml.kernel.org/r/1433512155-9906-1-git-send-email-dinguyen@opensource.altera.comSigned-off-by: default avatarBorislav Petkov <bp@suse.de>
parent de277678
...@@ -477,11 +477,31 @@ static int altr_sdram_remove(struct platform_device *pdev) ...@@ -477,11 +477,31 @@ static int altr_sdram_remove(struct platform_device *pdev)
return 0; return 0;
} }
/*
* If you want to suspend, need to disable EDAC by removing it
* from the device tree or defconfig.
*/
#ifdef CONFIG_PM
static int altr_sdram_prepare(struct device *dev)
{
pr_err("Suspend not allowed when EDAC is enabled.\n");
return -EPERM;
}
static const struct dev_pm_ops altr_sdram_pm_ops = {
.prepare = altr_sdram_prepare,
};
#endif
static struct platform_driver altr_sdram_edac_driver = { static struct platform_driver altr_sdram_edac_driver = {
.probe = altr_sdram_probe, .probe = altr_sdram_probe,
.remove = altr_sdram_remove, .remove = altr_sdram_remove,
.driver = { .driver = {
.name = "altr_sdram_edac", .name = "altr_sdram_edac",
#ifdef CONFIG_PM
.pm = &altr_sdram_pm_ops,
#endif
.of_match_table = altr_sdram_ctrl_of_match, .of_match_table = altr_sdram_ctrl_of_match,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment