Received: by 10.192.165.148 with SMTP id m20csp5489584imm; Wed, 9 May 2018 06:00:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoiDL1hC/5zqRohory73j0FgapeXug/83XML4ByuS04fMx2cV5ZybGNSEdGiOui8X3Svh/7 X-Received: by 2002:a65:5b4a:: with SMTP id y10-v6mr36241191pgr.243.1525870817295; Wed, 09 May 2018 06:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525870817; cv=none; d=google.com; s=arc-20160816; b=IYkAjiXKrbyUjKdZyf4iTgOyw5km2az8zTDcUBIdb7gV5lA/8GbzWh1gZF2LVIXy9U 5yn7NyHIlfGEqMKDLDFRAeXCV+hvEi8DIilYnblAS25uXCy1CrJY40Dmv4ZzQyj4UFTD a7nIE0X2piZ06IOs8Wzl7U9dKgsbahjiiXLmRc3fV4an6sXCynOpjclVjmyhDRPxZXJO tnXV1MMxv8fpOrAqsGIhQaYwtLUpE7sceW45z73el4AKiKPzfDG6F+TOHMhFvCYb5glz 0eTgDTCzeDPd/XqTxeNNSVya4+WZoqO7uVRg9WAcdl1S6ulbhdDjBtazYlFyycPAo50+ oEoA== 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=sl7Jmf/JiC0iqhOR/s21X2eRj7TaMDH1ZE4zaNS3aO4=; b=pD4Wad8oZLdv/V4D3k6yuSmeH5wTWmVk7JITqnF7aXLdy3WhxyXnazqdsjtCvKbslJ Af+VdrY/W/Gd5sHGENdRh6N9OolU+cpYx3OCNyJckTX62iBYwdyQhOCaE0/JOn/r+VBK t8eIwd/IlaEC//xVODX2SuexMHAUZUxUNX2/RQS5C2MEPrJBb0byKE/9rNU7m28fu91y D+7jV4BWtLX9aJJ0V5eHi/8M5/H2P2sqjPqNGzqi/0MCQdTcYTGjp3D67p0uE5GGlWas oTDdoMPG/bu6Td4wuExCMewWWLWJVB9qkQVoQq29zOBx765FghtkH30Q8cIYhUew97lv Garw== 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 w135si15274022pff.340.2018.05.09.06.00.02; Wed, 09 May 2018 06:00:17 -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 S934991AbeEIM7B (ORCPT + 99 others); Wed, 9 May 2018 08:59:01 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:55320 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934884AbeEIM6A (ORCPT ); Wed, 9 May 2018 08:58:00 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 8555D286F9F From: Enric Balletbo i Serra To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, ulf.hansson@linaro.org, heiko@sntech.de, linux-pm@vger.kernel.org, dbasehore@chromium.org, linux-kernel@vger.kernel.org, dianders@google.com, groeck@chromium.org, kernel@collabora.com, hl@rock-chips.com, Chanwoo Choi Subject: [PATCH v4 3/6] devfreq: rk3399_dmc: remove wait for dcf irq event. Date: Wed, 9 May 2018 14:57:45 +0200 Message-Id: <20180509125749.31318-4-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509125749.31318-1-enric.balletbo@collabora.com> References: <20180509125749.31318-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 Reviewed-by: Chanwoo Choi --- Changes in v4: None Changes in v3: None Changes in v2: - [3/6] Add Reviewed-by Chanwoo Choi 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