From c0178373c341b9ea36002bc8e0f467af7555c313 Mon Sep 17 00:00:00 2001 From: lanefu Date: Wed, 5 Aug 2020 19:17:48 -0400 Subject: [PATCH] patch xu4 dynamic memory controller bug in dev kernel(#2135) --- ...ynos5422-dmc-Adjust-polling-interval.patch | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 patch/kernel/odroidxu4-dev/LKML-0001-XU4-exynos5422-dmc-Adjust-polling-interval.patch diff --git a/patch/kernel/odroidxu4-dev/LKML-0001-XU4-exynos5422-dmc-Adjust-polling-interval.patch b/patch/kernel/odroidxu4-dev/LKML-0001-XU4-exynos5422-dmc-Adjust-polling-interval.patch new file mode 100644 index 0000000000..f313dedce2 --- /dev/null +++ b/patch/kernel/odroidxu4-dev/LKML-0001-XU4-exynos5422-dmc-Adjust-polling-interval.patch @@ -0,0 +1,58 @@ +diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c +index 93e9c2429c0d..e03ee35f0ab5 100644 +--- a/drivers/memory/samsung/exynos5422-dmc.c ++++ b/drivers/memory/samsung/exynos5422-dmc.c +@@ -1466,10 +1466,10 @@ static int exynos5_dmc_probe(struct platform_device *pdev) + * Setup default thresholds for the devfreq governor. + * The values are chosen based on experiments. + */ +- dmc->gov_data.upthreshold = 30; ++ dmc->gov_data.upthreshold = 10; + dmc->gov_data.downdifferential = 5; + +- exynos5_dmc_df_profile.polling_ms = 500; ++ exynos5_dmc_df_profile.polling_ms = 100; + } + + +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 + #include + #include ++#include + #include + #include + #include +@@ -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; +