Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4319489pxb; Thu, 14 Oct 2021 02:57:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9/z6nXbqfIULzLNnOP3sKBgDOyErAC0kgKemK8EohaDZ3OEMiGRxdD7cHBjsH7XSQ9h+i X-Received: by 2002:a05:6a00:1242:b0:44c:2025:29e3 with SMTP id u2-20020a056a00124200b0044c202529e3mr4469436pfi.59.1634205468377; Thu, 14 Oct 2021 02:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634205468; cv=none; d=google.com; s=arc-20160816; b=gF74PzrqvGFAp9qnaCRvq2rt/VeaG7Xy1s8CWz1RhF+1sj+7aLc1K5OhWniTFt5INQ M1YRXbXL52IRNENeUrZhDAFZHmRbfm9dIlIasoV7o2xzfdfTGCNcrGR+NIAPi6SbepSt kp+Qcn+2th08eHBAmWcF446nohQCDpKIX4L8XipfQDJYDkDvUB9xF8c8S9AhKRyO/wo9 HkxNboG4A3AYl33VZzmwlPUU24Wa8HJuArG7XxxjrWk1bWISDozFydLd0vyZsmKP4wOG 8BzlDFik7e8hDqBvZt6AqoL0dl/Nuol9yjZfTBu+K5DJb+oJ0So7RBxA4R4tT8kZL8rD cDLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JmYUMK/UpCPTQkNa2eHt3u3bSnQ6UeJZgf9fcyINgsU=; b=QQBvJaiPJXwsReeWjLKyfRvWRsyaRzvTbYKBfL+5EyDbyqDLfnYm/Xgrq4TZuijLT9 04bk1+Q96k45ii1WXxizV3aopoYPGqxdsXHF0UMZth6j96AcNZBP0aRcWy5hWXFKym9G kOoLd5180RgnEJaICavon8goXNvOZSbx/Mk0vRmtmGk4V2bUR7vsdd2slCMIEdkFZLHT H1MWgBp3Z15EnrRmwQAOrfj8JjxNXC/0quMIpJS3kggx+UhfCuL0WMHWcJNlVX0lgqjS /8fiF72m2FKBmJuJjsz4H5IprqNElzhqGG1XIOLJzM0TvVScAVH0rtB/j2w42jVbGcrH fTsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mVYlAwjT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 p2si2326584plp.201.2021.10.14.02.57.35; Thu, 14 Oct 2021 02:57:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=mVYlAwjT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S230106AbhJNJ6E (ORCPT + 99 others); Thu, 14 Oct 2021 05:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbhJNJ6D (ORCPT ); Thu, 14 Oct 2021 05:58:03 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C769C06174E for ; Thu, 14 Oct 2021 02:55:58 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id y15so24507278lfk.7 for ; Thu, 14 Oct 2021 02:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JmYUMK/UpCPTQkNa2eHt3u3bSnQ6UeJZgf9fcyINgsU=; b=mVYlAwjTxWDUaBNLDN0kgN/g/YvJGNU+qqXTHe/yDPKOT7wKUmz2VhEvsDmJpaLbUF JzmX5SOBfopOFWv4MMobCXKvOtq35pi9+Tv2h99NRH7LDKiMgD13AGFjtqXdfZVmA3/2 LBBEQ24GND2moC7wMKG2krrUoGENkEJdY9LuvzsJIAXnUZ+qbQGNJhMBv7F4Zf5OLuFw 0X+9oY7KpkjEJuBfbYCGHYr/2+Fx3OyQ9M/4ihjNNdGXU+RQYM5EfLcbh/75NClaUyHQ swSYYlaB6z+O2nPtdN8qjfZdFJUykeYjnZHyWiWQnuIHIDEf/QNrD9FadDjd70wRTuZZ eEHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JmYUMK/UpCPTQkNa2eHt3u3bSnQ6UeJZgf9fcyINgsU=; b=K11gv/C5K60IaEEfA1e6Bb5N/qGoejiK52hu11u2JsaOXk/+xHWQXeDfY2BBACLoI/ CpimbfH49y9cEwF3xP2SGUGkWDcsw0GiqEoMDbIBNL0zNQgbGfHiokNHh9EM9rOuyMN8 LR9a2zsPL4jumCGwfPOXZquTEyZYdfi4b//Bpnaz4Xgp9ZXeXMXuqvWIQQRtc/Zd8Ljc atbObDuWzqZAUfu67UXk9n5dACKirLUdjM692gnO8WXtP2BU0DDbrB8Sd7F93OYYp+9y ysJW153OVDd7iimNhPqGl78moIHgGf5HSxsyJlNm+yR7u6ZicesNgoPtyvIUfcxhl8DG WCXg== X-Gm-Message-State: AOAM530/JiuSKSKMhuoZWBb3Xz+j9WfLHeyRX0KwJEuxc+voSuA1rA2q 4YQT8fdpz0Ov1h8ahmCN+61cMkPkOhFNmPYL9WGaqQ== X-Received: by 2002:a2e:85c4:: with SMTP id h4mr5021872ljj.4.1634205356539; Thu, 14 Oct 2021 02:55:56 -0700 (PDT) MIME-Version: 1.0 References: <20211011165707.138157-1-marcan@marcan.st> <20211011165707.138157-5-marcan@marcan.st> <20211012032144.2ltlpat7orrsyr6k@vireshk-i7> <20211012055143.xmkbvhbnolspgjin@vireshk-i7> In-Reply-To: From: Ulf Hansson Date: Thu, 14 Oct 2021 11:55:16 +0200 Message-ID: Subject: Re: [RFC PATCH 4/9] opp: core: Don't warn if required OPP device does not exist To: Hector Martin Cc: Viresh Kumar , Sibi Sankar , Saravana Kannan , Linux ARM , Alyssa Rosenzweig , Sven Peter , Marc Zyngier , Mark Kettenis , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Viresh Kumar , Nishanth Menon , Catalin Marinas , "Rafael J. Wysocki" , Kevin Hilman , linux-clk , DTML , Linux PM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Oct 2021 at 07:57, Hector Martin wrote: > > On 12/10/2021 14.51, Viresh Kumar wrote: > > On 12-10-21, 14:34, Hector Martin wrote: > >> The table *is* assigned to a genpd (the memory controller), it's just that > >> that genpd isn't actually a parent of the CPU device. Without the patch you > >> end up with: > >> > >> [ 3.040060] cpu cpu4: Failed to set performance rate of cpu4: 0 (-19) > >> [ 3.042881] cpu cpu4: Failed to set required opps: -19 > >> [ 3.045508] cpufreq: __target_index: Failed to change cpu frequency: -19 > > > > Hmm, Saravana and Sibi were working on a similar problem earlier and decided to > > solve this using devfreq instead. Don't remember the exact series which got > > merged for this, Sibi ? > > > > If this part fails, how do you actually set the performance state of the memory > > controller's genpd ? > > The clock controller has the genpd as an actual power-domain parent, so > it does it instead. From patch #7: > > > + if (cluster->has_pd) > > + dev_pm_genpd_set_performance_state(cluster->dev, > > + dev_pm_opp_get_required_pstate(opp, 0)); > > + > > This is arguably not entirely representative of how the hardware works, > since technically the cluster switching couldn't care less what the > memory controller is doing; it's a soft dependency, states that should > be switched together but are not interdependent (in fact, the clock code > does this unconditionally after the CPU p-state change, regardless of > whether we're shifting up or down; this is, FWIW, the same order macOS > uses, and it clearly doesn't matter which way you do it). Yes, this sounds like you should move away from modeling the memory part as a parent genpd for the CPUs' genpd. As Viresh pointed out, a devfreq driver seems like a better way to do this. As a matter of fact, there are already devfreq drivers that do this, unless I am mistaken. It looks like devfreq providers are listening to opp/cpufreq notifiers, as to get an indication of when it could make sense to change a performance state. In some cases the devfreq provider is also modeled as an interconnect provider, allowing consumers to specify memory bandwidth constraints, which may trigger a new performance state to be set for the memory controller. In the tegra case, the memory controller is modelled as an interconnect provider and the devfreq node is modelled as an interconnect-consumer of the memory controller. Perhaps this can work for apple SoCs too? That said, perhaps as an option to move forward, we can try to get the cpufreq pieces solved first. Then as a step on top, add the performance scaling for the memory controller? > > -- > Hector Martin (marcan@marcan.st) > Public Key: https://mrcn.st/pub Kind regards Uffe