linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org
Cc: lukasz.luba@arm.com, willy.mh.wolff.ml@gmail.com,
	k.konieczny@samsung.com, cw00.choi@samsung.com,
	b.zolnierkie@samsung.com, krzk@kernel.org, chanwoo@kernel.org,
	myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
	s.nawrocki@samsung.com, kgene@kernel.org
Subject: [PATCH v2 2/2] memory: samsung: exynos5422-dmc: Add module param to control IRQ mode
Date: Fri, 10 Jul 2020 20:11:22 +0100	[thread overview]
Message-ID: <20200710191122.11029-3-lukasz.luba@arm.com> (raw)
In-Reply-To: <20200710191122.11029-1-lukasz.luba@arm.com>

The driver can operate in two modes relaying on devfreq monitoring
mechanism which periodically checks the device status or it can use
interrupts when they are provided by loaded Device Tree. The newly
introduced module parameter can be used to choose between devfreq
monitoring and internal interrupts without modifying the Device Tree.
It also sets devfreq monitoring as default when the parameter is not set
(also the case for default when the driver is not built as a module).

Reported-by: Willy Wolff <willy.mh.wolff.ml@gmail.com>
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
---
 drivers/memory/samsung/exynos5422-dmc.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
index e03ee35f0ab5..53bfe6b7b703 100644
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -12,6 +12,7 @@
 #include <linux/io.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/of_device.h>
 #include <linux/pm_opp.h>
 #include <linux/platform_device.h>
@@ -21,6 +22,10 @@
 #include "../jedec_ddr.h"
 #include "../of_memory.h"
 
+static int irqmode;
+module_param(irqmode, int, 0644);
+MODULE_PARM_DESC(irqmode, "Enable IRQ mode (0=off [default], 1=on)");
+
 #define EXYNOS5_DREXI_TIMINGAREF		(0x0030)
 #define EXYNOS5_DREXI_TIMINGROW0		(0x0034)
 #define EXYNOS5_DREXI_TIMINGDATA0		(0x0038)
@@ -1428,7 +1433,7 @@ static int exynos5_dmc_probe(struct platform_device *pdev)
 	/* There is two modes in which the driver works: polling or IRQ */
 	irq[0] = platform_get_irq_byname(pdev, "drex_0");
 	irq[1] = platform_get_irq_byname(pdev, "drex_1");
-	if (irq[0] > 0 && irq[1] > 0) {
+	if (irq[0] > 0 && irq[1] > 0 && irqmode) {
 		ret = devm_request_threaded_irq(dev, irq[0], NULL,
 						dmc_irq_thread, IRQF_ONESHOT,
 						dev_name(dev), dmc);
@@ -1485,7 +1490,7 @@ static int exynos5_dmc_probe(struct platform_device *pdev)
 	if (dmc->in_irq_mode)
 		exynos5_dmc_start_perf_events(dmc, PERF_COUNTER_START_VALUE);
 
-	dev_info(dev, "DMC initialized\n");
+	dev_info(dev, "DMC initialized, in irq mode: %d\n", dmc->in_irq_mode);
 
 	return 0;
 
-- 
2.17.1


  parent reply	other threads:[~2020-07-10 19:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200710191144epcas1p30f82bf6371f7f09a4e1ea1262234f392@epcas1p3.samsung.com>
2020-07-10 19:11 ` [PATCH v2 0/2] Exynos5422 DMC: adjust to new devfreq monitoring mechanism Lukasz Luba
2020-07-10 19:11   ` [PATCH v2 1/2] memory: samsung: exynos5422-dmc: Adjust polling interval and uptreshold Lukasz Luba
2020-07-20 14:46     ` Krzysztof Kozlowski
2020-07-27  8:20       ` Lukasz Luba
2020-07-10 19:11   ` Lukasz Luba [this message]
2020-07-14  7:42     ` [PATCH v2 2/2] memory: samsung: exynos5422-dmc: Add module param to control IRQ mode Bartlomiej Zolnierkiewicz
2020-07-14  9:01       ` Lukasz Luba
2020-07-14  9:32         ` Willy Wolff
2020-07-14  9:50           ` Lukasz Luba
2020-07-17 11:53         ` Lukasz Luba
2020-07-17 12:31           ` Bartlomiej Zolnierkiewicz
2020-07-20 14:46     ` Krzysztof Kozlowski
2020-08-03 15:30     ` Marek Szyprowski
2020-08-03 15:35       ` Marek Szyprowski
2020-08-04  8:06         ` Lukasz Luba
2020-07-24  1:40   ` [PATCH v2 0/2] Exynos5422 DMC: adjust to new devfreq monitoring mechanism Chanwoo Choi
2020-07-27  8:21     ` Lukasz Luba

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=20200710191122.11029-3-lukasz.luba@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=chanwoo@kernel.org \
    --cc=cw00.choi@samsung.com \
    --cc=k.konieczny@samsung.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=s.nawrocki@samsung.com \
    --cc=willy.mh.wolff.ml@gmail.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;
as well as URLs for NNTP newsgroup(s).