Home Home > GIT Browse > SLE12-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMian Yousaf Kaukab <yousaf.kaukab@suse.com>2019-08-08 12:22:02 +0200
committerMian Yousaf Kaukab <yousaf.kaukab@suse.com>2019-08-08 12:22:20 +0200
commitc6968cfa357abd9b34af971c371b596ea1213153 (patch)
tree8dbf8b776dab547ff2c048d6c2d65bac95e8170a
parente2ec8c59c0f5b08bfa464c00926fc403f93f1339 (diff)
PM / devfreq: rk3399_dmc: remove wait for dcf irq event
(bsc#1144718,bsc#1144813).
-rw-r--r--patches.drivers/0007-PM-devfreq-rk3399_dmc-remove-wait-for-dcf-irq-event.patch126
-rw-r--r--series.conf1
2 files changed, 127 insertions, 0 deletions
diff --git a/patches.drivers/0007-PM-devfreq-rk3399_dmc-remove-wait-for-dcf-irq-event.patch b/patches.drivers/0007-PM-devfreq-rk3399_dmc-remove-wait-for-dcf-irq-event.patch
new file mode 100644
index 0000000000..a2e2ba9265
--- /dev/null
+++ b/patches.drivers/0007-PM-devfreq-rk3399_dmc-remove-wait-for-dcf-irq-event.patch
@@ -0,0 +1,126 @@
+From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
+Date: Wed, 9 May 2018 14:57:45 +0200
+Subject: PM / devfreq: rk3399_dmc: remove wait for dcf irq event.
+
+Git-commit: 90dd72e1290dd86c4b6e5c421fcd13e60e625782
+Patch-mainline: v4.19-rc1
+References: bsc#1144718,bsc#1144813
+
+We have already wait dcf done in ATF, so don't need wait dcf irq
+in kernel, besides, clear dcf irq in kernel will import competiton
+between kernel and ATF, only handle dcf irq in ATF is a better way.
+
+Signed-off-by: Lin Huang <hl@rock-chips.com>
+Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
+Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
+Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
+Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
+---
+ drivers/devfreq/rk3399_dmc.c | 53 +-------------------------------------------
+ 1 file changed, 1 insertion(+), 52 deletions(-)
+
+diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
+index 5dfbfa3cc878..44a379657cd5 100644
+--- a/drivers/devfreq/rk3399_dmc.c
++++ b/drivers/devfreq/rk3399_dmc.c
+@@ -68,15 +68,6 @@ struct rk3399_dmcfreq {
+ struct devfreq_event_dev *edev;
+ struct mutex lock;
+ struct dram_timing timing;
+-
+- /*
+- * DDR Converser of Frequency (DCF) is used to implement DDR frequency
+- * conversion without the participation of CPU, we will implement and
+- * control it in arm trust firmware.
+- */
+- wait_queue_head_t wait_dcf_queue;
+- int irq;
+- int wait_dcf_flag;
+ struct regulator *vdd_center;
+ unsigned long rate, target_rate;
+ unsigned long volt, target_volt;
+@@ -117,7 +108,6 @@ static int rk3399_dmcfreq_target(struct device *dev, unsigned long *freq,
+ goto out;
+ }
+ }
+- dmcfreq->wait_dcf_flag = 1;
+
+ err = clk_set_rate(dmcfreq->dmc_clk, target_rate);
+ if (err) {
+@@ -129,14 +119,6 @@ static int rk3399_dmcfreq_target(struct device *dev, unsigned long *freq,
+ }
+
+ /*
+- * Wait until bcf irq happen, it means freq scaling finish in
+- * arm trust firmware, use 100ms as timeout time.
+- */
+- if (!wait_event_timeout(dmcfreq->wait_dcf_queue,
+- !dmcfreq->wait_dcf_flag, HZ / 10))
+- dev_warn(dev, "Timeout waiting for dcf interrupt\n");
+-
+- /*
+ * Check the dpll rate,
+ * There only two result we will get,
+ * 1. Ddr frequency scaling fail, we still get the old rate.
+@@ -241,22 +223,6 @@ static __maybe_unused int rk3399_dmcfreq_resume(struct device *dev)
+ static SIMPLE_DEV_PM_OPS(rk3399_dmcfreq_pm, rk3399_dmcfreq_suspend,
+ rk3399_dmcfreq_resume);
+
+-static irqreturn_t rk3399_dmc_irq(int irq, void *dev_id)
+-{
+- struct rk3399_dmcfreq *dmcfreq = dev_id;
+- struct arm_smccc_res res;
+-
+- dmcfreq->wait_dcf_flag = 0;
+- wake_up(&dmcfreq->wait_dcf_queue);
+-
+- /* Clear the DCF interrupt */
+- arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, 0, 0,
+- ROCKCHIP_SIP_CONFIG_DRAM_CLR_IRQ,
+- 0, 0, 0, 0, &res);
+-
+- return IRQ_HANDLED;
+-}
+-
+ static int of_get_ddr_timings(struct dram_timing *timing,
+ struct device_node *np)
+ {
+@@ -330,16 +296,10 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
+ struct device *dev = &pdev->dev;
+ struct device_node *np = pdev->dev.of_node;
+ struct rk3399_dmcfreq *data;
+- int ret, irq, index, size;
++ int ret, index, size;
+ uint32_t *timing;
+ struct dev_pm_opp *opp;
+
+- irq = platform_get_irq(pdev, 0);
+- if (irq < 0) {
+- dev_err(&pdev->dev,
+- "Cannot get the dmc interrupt resource: %d\n", irq);
+- return irq;
+- }
+ data = devm_kzalloc(dev, sizeof(struct rk3399_dmcfreq), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+@@ -358,17 +318,6 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
+ return PTR_ERR(data->dmc_clk);
+ };
+
+- data->irq = irq;
+- ret = devm_request_irq(dev, irq, rk3399_dmc_irq, 0,
+- dev_name(dev), data);
+- if (ret) {
+- dev_err(dev, "Failed to request dmc irq: %d\n", ret);
+- return ret;
+- }
+-
+- init_waitqueue_head(&data->wait_dcf_queue);
+- data->wait_dcf_flag = 0;
+-
+ data->edev = devfreq_event_get_edev_by_phandle(dev, 0);
+ if (IS_ERR(data->edev))
+ return -EPROBE_DEFER;
+--
+2.11.0
+
diff --git a/series.conf b/series.conf
index 6c964262e9..993fdb0e48 100644
--- a/series.conf
+++ b/series.conf
@@ -18372,6 +18372,7 @@
patches.drivers/leds-max8997-use-mode-when-calling-max8997_led_set_m
patches.drivers/ACPI-PM-save-NVS-memory-for-ASUS-1025C-laptop
patches.drivers/dt-bindings-clock-add-rk3399-ddr3-standard-speed-bins.patch
+ patches.drivers/0007-PM-devfreq-rk3399_dmc-remove-wait-for-dcf-irq-event.patch
patches.arch/PM-devfreq-rk3399_dmc-Fix-duplicated-opp-table-on-re.patch
patches.drivers/0007-cpufreq-CPPC-Add-cpuinfo_cur_freq-support-for-CPPC.patch
patches.drivers/ACPI-scan-Initialize-status-to-ACPI_STA_DEFAULT.patch