aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Tull <atull@opensource.altera.com>2015-06-05 09:49:15 -0400
committerBorislav Petkov <bp@suse.de>2015-06-24 12:16:12 -0400
commit6f2b6422d4787ffa72bd81abdc1b503dbf87a49a (patch)
treec60f0f01187f8358805d7512cc430580ccdf4834
parentde2776787faa6859097a946e32f618f62fbce4c9 (diff)
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: Alan Tull <atull@opensource.altera.com> Signed-off-by: Dinh 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.com Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r--drivers/edac/altera_edac.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 182c741adf3e..23ef0917483c 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -477,11 +477,31 @@ static int altr_sdram_remove(struct platform_device *pdev)
477 return 0; 477 return 0;
478} 478}
479 479
480/*
481 * If you want to suspend, need to disable EDAC by removing it
482 * from the device tree or defconfig.
483 */
484#ifdef CONFIG_PM
485static int altr_sdram_prepare(struct device *dev)
486{
487 pr_err("Suspend not allowed when EDAC is enabled.\n");
488
489 return -EPERM;
490}
491
492static const struct dev_pm_ops altr_sdram_pm_ops = {
493 .prepare = altr_sdram_prepare,
494};
495#endif
496
480static struct platform_driver altr_sdram_edac_driver = { 497static struct platform_driver altr_sdram_edac_driver = {
481 .probe = altr_sdram_probe, 498 .probe = altr_sdram_probe,
482 .remove = altr_sdram_remove, 499 .remove = altr_sdram_remove,
483 .driver = { 500 .driver = {
484 .name = "altr_sdram_edac", 501 .name = "altr_sdram_edac",
502#ifdef CONFIG_PM
503 .pm = &altr_sdram_pm_ops,
504#endif
485 .of_match_table = altr_sdram_ctrl_of_match, 505 .of_match_table = altr_sdram_ctrl_of_match,
486 }, 506 },
487}; 507};