Received: by 10.192.165.156 with SMTP id m28csp550805imm; Thu, 19 Apr 2018 03:42:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx49fAAk5s0G+KIYvhH20GjSbcaBpBybUZeOlxJ1qPx/BCd2az92yWdmM1j36s/dLlwMaOp69 X-Received: by 2002:a17:902:9042:: with SMTP id w2-v6mr5596224plz.34.1524134543973; Thu, 19 Apr 2018 03:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524134543; cv=none; d=google.com; s=arc-20160816; b=W7fEa5G8ForJ9XQrVcn/AoA+70bCEktIbFNpfFpmAj62BmoX4g0+HuDv5P2UJFp9lV S9ht2rR2DXt3+oRfRYCCNyqQfX/m2jdVD2OBVJNqh9zDGgmPiKmdv7ZxZXfGSYrpVhsN AODChkE94bCkbYUXYlunvi45+LO/TWP8qpEATQ/Zz4NRUW5atCDbQcMXU/072F435/5g ihhBZYMaONgYAMmkyTBkGcjEHHx3iB3efSdUXdDpfL2833s5TiZIrYvMRswSFT62RzhP Rm0p4x/zpeo4fudceL+acbMy2cj5NfqKYuPvknwRmYIWe4GNJUdwh3T+kQTuNTCA7XwG 6pTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ozcyuJcrzRJ9ssafBrkMMvTSzhfE+nFqeSuAxnutjnQ=; b=PW7dIu63vQoZ6O+VBEH3Bkg1/wnL/qqOWvycqhMfM8fHi8QxJJh0tm0LzHw/YOCHpG MsAvnZ9isLbAOh/J5UF2PKGgb0KpOcYyUt4a5JT69YsaQ22R0xwA7JMn1xKqqmOnN06N VWuaOIU13kRvLt3Vf4mot6DLmPc5Nri/iViPYL6wUMmO0ohDcM3pDKSYmijkHhxsi5V+ qhs8prD8wTAmA4CS8MwkRW2NlaCRCX1uhbq9ljK5jwz5XoV9rsNLUfkhWCJQejzWVsId c8QrXD35G4TyiL+1dffdGigBjHzMXFZyhkknF7zcsNkGZAYcqcZY3zZEyZY86cuNYEIB kf3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si2926089pff.119.2018.04.19.03.42.09; Thu, 19 Apr 2018 03:42:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752696AbeDSKk6 (ORCPT + 99 others); Thu, 19 Apr 2018 06:40:58 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:35016 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751151AbeDSKky (ORCPT ); Thu, 19 Apr 2018 06:40:54 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id CA11D27CA45 From: Enric Balletbo i Serra To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, heiko@sntech.de, linux-pm@vger.kernel.org, dbasehore@chromium.org, linux-kernel@vger.kernel.org, dianders@google.com, groek@google.com, kernel@collabora.com, Lin Huang , Chanwoo Choi Subject: [PATCH 3/6] devfreq: rk3399_dmc: remove wait for dcf irq event. Date: Thu, 19 Apr 2018 12:40:16 +0200 Message-Id: <20180419104019.24406-4-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419104019.24406-1-enric.balletbo@collabora.com> References: <20180419104019.24406-1-enric.balletbo@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Enric Balletbo i Serra --- 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) { @@ -128,14 +118,6 @@ static int rk3399_dmcfreq_target(struct device *dev, unsigned long *freq, goto out; } - /* - * 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, @@ -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.17.0