From patchwork Fri Apr 2 10:06:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 414343 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1285222jai; Fri, 2 Apr 2021 03:07:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5vQN8PX86iSCbJdlEbR1oj/9YaRGZt0dzN3XTmiNVR54UGrLoGA+9qPt8ex3YDjqm8zHy X-Received: by 2002:a02:694b:: with SMTP id e72mr12379555jac.89.1617358078783; Fri, 02 Apr 2021 03:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617358078; cv=none; d=google.com; s=arc-20160816; b=0nWE13B6fZ3cmGdJXhjwOHSxzVB517TIJQgqel+y2Ieto5ugnS9Con0iA6RXjbwEO6 Ab8/JLsQGrx9s4RBrTJwn2tFv7Ls3S5EVCWE2pqRUVmsj07lfRSEW3xaUVqQQLHHmzqK 5Z1x0dzbUH+tuacbunnfY1/vnPmH6MdNxUJdUKD4f7faxJISaLpC1OyZliXKndb27bYe +E26aLnBlp3WpT1jS0QT7Hy/Bkhi+OkPQGx4uE9gpsiK6G1et2X2sqLgQBsI7LWCCqvL mfC8+Mq0EwoCjSCqOzYEBNR/Bf8+h+b+0+pzunfsNPq9A4/FEnn6ACHAP2WzUz+JzBbz +yYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jC/nAoOA5wxgtGfB1JzVVDDrp9E9awsc1iAxv29P8SY=; b=OeHa/48LPXqRnhK9LMZzaKz4hukQNSL2gvjn2tU9IVzCDlsd4Lu4onnd2p6q9yXZ98 bynga8dlJtjyayggmtvs0grrnmFR5DZ9lCXB4qGGeSknsTjKg7nazIegQonDS4Wz1q9E /clNc3Qif2gfxS5b8v79N1kW/Acb8fd6HpByxvDaNeY5QSIzkkOhkmrviQ4bAhLOsIxW Bo6ytJ5af+0Rb1XVZq6XTHk9vjQFiFNxyWSy/PPtmWgHYpRYk9d3LJixUhLQ61JvTPw9 pMijLwFRhKjMgVSq/91jp1V6/fq3ZoZjz/pX9BvxwLbTk/Z7zxyMbNDjCHJxSBwTEh2A O+wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pbUhDi5h; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si6942838ile.30.2021.04.02.03.07.58; Fri, 02 Apr 2021 03:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pbUhDi5h; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235064AbhDBKFo (ORCPT + 17 others); Fri, 2 Apr 2021 06:05:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234954AbhDBKFi (ORCPT ); Fri, 2 Apr 2021 06:05:38 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39A43C061788 for ; Fri, 2 Apr 2021 03:05:35 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id i18so845149wrm.5 for ; Fri, 02 Apr 2021 03:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jC/nAoOA5wxgtGfB1JzVVDDrp9E9awsc1iAxv29P8SY=; b=pbUhDi5hNO63pJvumcEhmebOG/sfnPRDTUEiG9G9H1q8tbkL/ALrBaKHF/QMBh2kBO vVfzer+6nn0to8yY8fzWnADRbApwCyLjgX6InqdKXFYL71Q1pb91qOn1PxNmev5WxC9n VP1ehzT9hSgCVTT/ezUC03utkeqXFKJNiFJU8WM6MN1fJqlCZkvManMYM8mqEd7yXB1M h8NghO8Nu9OgceGqjqFTQDeezQv2vbXGMk/CQ06n7Vw4/FvgFjTGCxBBSYoYZoAIrKOv +sJFaplqCXjA3xHu291kqU/qpY1al7DZyrLe2Plw1Lc0W3e108hX3ngEyqhLu+B+tdIo hvqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jC/nAoOA5wxgtGfB1JzVVDDrp9E9awsc1iAxv29P8SY=; b=Ux+7GW6KG1/KR/T8stensar9WizuAro1qcRyt+DUwWo79QgQX6vW3vUOi9F+AoxiM4 KyMeu9OCe45jwF1jEao5uVH0Q0qETViog5Jo4zWozLWqPTtwJjBMgZhysw1sACkF/EHt ZAIWTjd7UWveeR9W5KQ+SRZ/bhCLBSd44JjptN4JXvJ/9mwWr4UyL16PIAlnmkOJ4pCa uNFPWVjj4OHfS2YgkNmkJX6rE6clZbFvHJ25htS65oCyM8aFKaenHI2a51cUVGxXXSxl gWl5pBE5X+K5X0vwcrhToxvm/zA5mffbC/iknZFwJu0YwlT6exCrc4dVBIqQWxUX9F5T df/g== X-Gm-Message-State: AOAM532FtwIm+UAMG70HojWBNFqjR8wrTedQ0L/hoP7KauD4d6CiQ3/4 a4bBpoTlkPcqHarBfU4etluu3Q== X-Received: by 2002:a5d:654a:: with SMTP id z10mr14680154wrv.335.1617357934079; Fri, 02 Apr 2021 03:05:34 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id v18sm15466618wrf.41.2021.04.02.03.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 03:05:33 -0700 (PDT) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v3 17/25] media: venus: core, pm: Vote for min clk freq during venus boot Date: Fri, 2 Apr 2021 11:06:40 +0100 Message-Id: <20210402100648.1815854-18-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210402100648.1815854-1-bryan.odonoghue@linaro.org> References: <20210402100648.1815854-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Dikshita Agarwal Vote for min clk frequency for core clks during prepare and enable clocks at boot sequence. Without this the controller clock runs at very low value (9.6MHz) which is not sufficient to boot venus. Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue Acked-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/pm_helpers.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index a23e490b6139..a91dc24de2a4 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -41,10 +41,24 @@ static int core_clks_get(struct venus_core *core) static int core_clks_enable(struct venus_core *core) { const struct venus_resources *res = core->res; + const struct freq_tbl *freq_tbl = core->res->freq_tbl; + unsigned int freq_tbl_size = core->res->freq_tbl_size; + unsigned long freq; unsigned int i; int ret; + if (!freq_tbl) + return -EINVAL; + + freq = freq_tbl[freq_tbl_size - 1].freq; + for (i = 0; i < res->clks_num; i++) { + if (IS_V6(core)) { + ret = clk_set_rate(core->clks[i], freq); + if (ret) + goto err; + } + ret = clk_prepare_enable(core->clks[i]); if (ret) goto err;