mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <dinguyen@opensource.altera.com>
To: <bp@alien8.de>
Cc: <dinh.linux@gmail.com>, <tthayer@opensource.altera.com>,
	<atull@opensource.altera.com>, <dougthompson@xmission.com>,
	<mchehab@osg.samsung.com>, <linux-edac@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Dinh Nguyen <dinguyen@opensource.altera.com>
Subject: [PATCH] EDAC, altera: wrap edac pm with a CONFIG_PM
Date: Fri, 5 Jun 2015 08:49:15 -0500	[thread overview]
Message-ID: <1433512155-9906-1-git-send-email-dinguyen@opensource.altera.com> (raw)

From: Alan Tull <atull@opensource.altera.com>

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

Signed-off-by: Alan Tull <atull@opensource.altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Acked-by: Borislav Petkov <bp@suse.de>
---
Hi Boris,

Please apply this patch to your for-next? This was part of Alan Tull's
suspend-to-ram patch that I was going to take through arm-soc. But if
I left the patch as it was, it would have caused a merge conflict for
v4.2.

Thanks,
Dinh
---
 drivers/edac/altera_edac.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 182c741..23ef091 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)
 	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 = {
 	.probe = altr_sdram_probe,
 	.remove = altr_sdram_remove,
 	.driver = {
 		.name = "altr_sdram_edac",
+#ifdef CONFIG_PM
+		.pm = &altr_sdram_pm_ops,
+#endif
 		.of_match_table = altr_sdram_ctrl_of_match,
 	},
 };
-- 
2.2.1


             reply	other threads:[~2015-06-05 13:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 13:49 dinguyen [this message]
2015-06-05 15:15 ` Borislav Petkov
2015-06-05 21:40   ` Thor Thayer
2015-06-06  8:01     ` Borislav Petkov
2015-06-08  0:46       ` atull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433512155-9906-1-git-send-email-dinguyen@opensource.altera.com \
    --to=dinguyen@opensource.altera.com \
    --cc=atull@opensource.altera.com \
    --cc=bp@alien8.de \
    --cc=dinh.linux@gmail.com \
    --cc=dougthompson@xmission.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=tthayer@opensource.altera.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome