From patchwork Thu Jan 21 11:17:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12035637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D92B8C433E6 for ; Thu, 21 Jan 2021 11:21:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3350A238E2 for ; Thu, 21 Jan 2021 11:21:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3350A238E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=SQIranIW15lnc6BFvkHeDjStwpOAB36lBuc2Pc1uVp4=; b=CRZAJ9BRoU9QAJa/iOO4XG00eE 0/g9YI8E87TOp+cwcdpSC/uW8f8G61m9jfzEFmdbhMbu57AM3tvXuhXIBrxjxZdU3wg9OqGcXOO0O /VTC+r9ye82K1Ox7rkW2SrEuS12rOdR6wcaaIVdkSbYAn/Eu2IIZyWYGOiYYH+6woEc84VM8sAij8 B/bfdT+SMvndAIgBCKtBDv0HwLABXVKrEFBd3ch1XAyyYjLH0jSxV6/yBkPdubI/B5HwmFdVB9kh9 p+R9+v5BA+X9aeehnUHnX/TsUC/7Fi2CPcNp74kSma/EWuckh3L1KOxz9oaJPtNAKNC8nx3jy8u2A FxY5N25A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2Xyx-0004s0-Nh; Thu, 21 Jan 2021 11:18:31 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2Xyu-0004qr-Hx for linux-arm-kernel@lists.infradead.org; Thu, 21 Jan 2021 11:18:29 +0000 Received: by mail-pf1-x430.google.com with SMTP id j12so1286297pfj.12 for ; Thu, 21 Jan 2021 03:18:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=x3SmdleK8UZBluZ+gLv61IXIdA7ChI0uJ8q02WGnkWs=; b=kKul5ID8v5TbX97ww+cpfmgrUv3kSKDwJ5+iClldpCxSEMEvh16BW9c99r9D6TxUF/ UJy9U+fbp6GgTXqQAKH2vpfq+OBFaUhJAFtmu2GlHVA0WGpq/UGkkQR9iGMbQoj1Iitv n10xlrNXdq0kiQQIE5ELsxJO+0LGCp2wS9uujRkXF7ZC8F+po6ARY/vc2Wfe1Q2Hl5ea ea/DVLs27iqJz6zMgl0grfTLeQyN5TuTmnmrzme3iilGPe9v/xC35tR/mdM3Bl/HM1qU XZS/WWhF29VdoamNtm9NTJNGg++hLG8LJsFS9ZiaU3Au8PjSKQyPReA9zoIHqr/wIRDf hK1A== 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:mime-version :content-transfer-encoding; bh=x3SmdleK8UZBluZ+gLv61IXIdA7ChI0uJ8q02WGnkWs=; b=H050vszAwj8GNOgOKXx2v1KPboEdg+UlGeCAV9Ft1YEoDp5YvwLjei2KscXrIYXqJZ +ZIilxe6GMj0C6JZULmKvFKfPW4q9SwiqPjwJHFznxaavLwmimIhhe397WG8NJVCT5AT Ua95F1jldPHpSIFZRN93KNCADRNb6QEy+i3fjCEG58BEncZaALiI9ayjMigjFToEa9Sl 274gxhxHwsmorEO46eu77fEeW8VCqCWB3sGmtgG4JZuZfBzROWCfz4M2Q4/7R3IIdwTy 6I504RXvdoPgMivfGDXaqJi10o+kj8phDH6kStQZsLkuKQ2bbpk+bl0x2c84bNMqsmR6 yotw== X-Gm-Message-State: AOAM5312u2L/iIqg20QODKjXrjq7OqhDQwtV4CY2A/qz4gLFoR7Zfd6D xRSrnwQogyL42xkBr6CfR0OS4Q== X-Google-Smtp-Source: ABdhPJzYjBGnMJtovsRHZ48WHArs33wC1W8Lrm5qvHpSIs5QnnIQMqLBBg9eMiM+WEzPlls9eOjVdQ== X-Received: by 2002:aa7:84d5:0:b029:19d:da20:73fe with SMTP id x21-20020aa784d50000b029019dda2073femr13718975pfn.16.1611227895317; Thu, 21 Jan 2021 03:18:15 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id 68sm5691390pfg.90.2021.01.21.03.18.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jan 2021 03:18:14 -0800 (PST) From: Viresh Kumar To: Dmitry Osipenko , Andy Gross , Bjorn Andersson , Chanwoo Choi , Jonathan Hunter , Kyungmin Park , MyungJoo Ham , Nishanth Menon , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Stephen Boyd , Thierry Reding , Viresh Kumar , Viresh Kumar Subject: [PATCH 00/13] opp: Implement dev_pm_opp_set_opp() Date: Thu, 21 Jan 2021 16:47:40 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210121_061828_927984_13DB333E X-CRM114-Status: GOOD ( 13.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vincent Guittot , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sibi Sankar , linux-tegra@vger.kernel.org, freedreno@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, This patchset implements a new API dev_pm_opp_set_opp(), which configures the devices represented by an opp table to a particular opp. The opp core supports a wide variety of devices now, some of them can change frequency and other properties (like CPUs), while others can just change their pstates or regulators (like power domains) and then there are others which can change their bandwidth as well (interconnects). Instead of having separate implementations for all of them, where all will eventually lack something or the other, lets try to implement a common solution for everyone. This takes care of setting regulators, bw, required opps, etc for all device types. Dmitry, please go ahead and try this series. This is based of opp tree's linux-next branch. Sibi, since you added dev_pm_opp_set_bw() earlier, it would be good if you can give this a try. In case this breaks anything for you. I have already tested this on hikey board for CPU devices. To get this tested better and as early as possible, I have pushed it here: git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git opp/linux-next This will be part of linux-next tomorrow. Note, all the patches need to go through OPP tree here. Please provide your Acks for platform specific bits. --- Viresh Viresh Kumar (13): opp: Rename _opp_set_rate_zero() opp: No need to check clk for errors opp: Keep track of currently programmed OPP opp: Split _set_opp() out of dev_pm_opp_set_rate() opp: Allow _set_opp() to work for non-freq devices opp: Allow _generic_set_opp_regulator() to work for non-freq devices opp: Allow _generic_set_opp_clk_only() to work for non-freq devices opp: Update parameters of _set_opp_custom() opp: Implement dev_pm_opp_set_opp() cpufreq: qcom: Migrate to dev_pm_opp_set_opp() devfreq: tegra30: Migrate to dev_pm_opp_set_opp() drm: msm: Migrate to dev_pm_opp_set_opp() opp: Remove dev_pm_opp_set_bw() drivers/cpufreq/qcom-cpufreq-hw.c | 2 +- drivers/devfreq/tegra30-devfreq.c | 2 +- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 8 +- drivers/opp/core.c | 314 ++++++++++++++------------ drivers/opp/opp.h | 2 + include/linux/pm_opp.h | 6 +- 6 files changed, 184 insertions(+), 150 deletions(-)