Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4607984iob; Sun, 8 May 2022 19:03:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5trl5FszUg2KL03ygbkOJm7yw3hNgXELUJ4DIO12VaTUA6dRx6PpG0YBrxsWgXA7E/+Uh X-Received: by 2002:a05:622a:58d:b0:2f3:cceb:d9ab with SMTP id c13-20020a05622a058d00b002f3ccebd9abmr9960062qtb.36.1652061802942; Sun, 08 May 2022 19:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652061802; cv=none; d=google.com; s=arc-20160816; b=LL/Aaiy1FtWtX5XKgFTbKFrgVfvP7if/BVCMLXE9FTaY46w6l0M8xm8GKjTDPuCWc5 bFwAm/+WsBva6SRRzoiJblYqvI5ORKHan4+cOOJl+8+o2aaDAOEHyPPliYTye5atFTvM RarGoseGvY65oRB1k7glW+mqXn53E2A4bfQlSBaA1/TcG2kfxPyLOXWH91jR+xuuUbgZ iBDdwn7K7Mj+M0jHWDO6uv17CpIhjcOgA6dhAm+GYUOhiemDZI/v8lhvElel1dJq0uEA 9PHJeMlekG/kh5GSAhVER//6u72T4M5fZrfp2a+AvUxhYu0BbgOznzbfk+IJRr/S/y5s 7f5w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=8NKAyyQ3FnM44x6XP0i+mCi4s4b8wIYmk1Eo3/lHAUw=; b=mL+wsrImrVdydx0ojktbR/vV2HOGSLX02S+jbaNLpN4fzrHsIOS9I3ebnO9x1RK0fj O5OuCX11D+jzFZ3pjCOLwtvdL0rJ/bWK5wAheXONepiKN6volh+NgMnQ102Zg6037c+5 9vnTVR/vq+pFNeq0TebX3n7SbCLN9BYbYxBa9UXUDTQn7m5sV9laaHnOtLU+TzKYCvfM zwAS1yTKHaSJNfqsbDfCM9R6C21LLbxCZ71W4/kJZXbIA1iH+/mJ7bglX39/c4uuqxQo Ze6YfeaJDoI0vXcTG7wImLd7zW+WR6pMfda/T18y8Cf54FAsBhkdE17SgbA4SdB46WGk 27bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pkO8aQEX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m6-20020a0cfde6000000b0045b09ec71desi1538765qvu.312.2022.05.08.19.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 19:03:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pkO8aQEX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D348D4A907; Sun, 8 May 2022 19:03:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384116AbiEGPFl (ORCPT + 99 others); Sat, 7 May 2022 11:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241703AbiEGPFj (ORCPT ); Sat, 7 May 2022 11:05:39 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8816B13F31; Sat, 7 May 2022 08:01:52 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id gj17-20020a17090b109100b001d8b390f77bso13328821pjb.1; Sat, 07 May 2022 08:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8NKAyyQ3FnM44x6XP0i+mCi4s4b8wIYmk1Eo3/lHAUw=; b=pkO8aQEX32pGRB6cUQTzlskx96fDI3Zch6J0tmix+6b5lGYO/1jGYuLlYBUGGX8y+b RzPMgK4Yds5nTwHp6DI6eiKA26MkIT3wOdSeLRfQN1jwLaEbXddgn4DaOHodEJ1On1qV 7w6/Nk8TCg/aOIRCKKq8CA7mRalGPGVC3cAClDiPTQunafRK7Y6hVb6R1WoIWb+JWjGU PpqwoEFFFbs3EOneBSVzVDNi0c8Jhd7wU/lWLsXuNs0K1VkAKD5m1bQTKAuFY0K/yCql ATg3cDO2ERtFPpsLJw1lMkKPesDTO3euoIijW80hnYohJPDvKh/wUAw814ADYB9w88W4 jszA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8NKAyyQ3FnM44x6XP0i+mCi4s4b8wIYmk1Eo3/lHAUw=; b=3TtWEqwl+VTzLVQDd9RrSUbUEAXqFV8GSE1isDMVVJOcY+IeOBrRrX4xyNJA6GtUu/ yiB9yQ9u0wr+Q8sHIkTle+023BqFzkX7AjFrlU+NAqHsfT8W9ZLftMSbyMa+dIG/Lnnh RDepvrnX33UG5d8qAR97t9dljiyVnUwR+LLfCrIpJCHpSbVg3bfafzs31WX+gTAe3k2w mBm6SgWArvusZVFoyuR0G076IyO3fos5SgN0EA6Og0LC0slM9Bo13wHsA7Aw1Bvkq8Up t+h4dqt/9TeHah/1N09XpEFhuapGHTFXl6TEDs6gj0WU+LXGO6kfAS78draRvQIpo5G8 dZrg== X-Gm-Message-State: AOAM532C+4/DwuEH4qE40y2B8z5RC9Sfh7X52MWCCuLxHcPB37eu9OGl Ins4KjVrmMBoogoVra2E8EAhluhnFmNdMg== X-Received: by 2002:a17:902:9a4c:b0:156:6735:b438 with SMTP id x12-20020a1709029a4c00b001566735b438mr8561903plv.46.1651935711878; Sat, 07 May 2022 08:01:51 -0700 (PDT) Received: from localhost.localdomain ([14.32.163.5]) by smtp.gmail.com with ESMTPSA id v21-20020a170902ca9500b0015e8d4eb2a8sm3711007pld.242.2022.05.07.08.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 May 2022 08:01:51 -0700 (PDT) From: Chanwoo Choi X-Google-Original-From: Chanwoo Choi To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: cw00.choi@samsung.com, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, johnson.wang@mediatek.com, mka@chromium.org, jia-wei.chang@mediatek.com, andrew-sh.cheng@mediatek.com, hsinyi@chromium.org, sibis@codeaurora.org, saravanak@google.com Subject: [PATCH v2 0/5] PM / devfreq: Add cpu based scaling support to passive governor Date: Sun, 8 May 2022 00:01:40 +0900 Message-Id: <20220507150145.531864-1-cw00.choi@samsung.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The devfreq passive governor has already supported the devfreq parent device for coupling the frequency change if some hardware have the constraints such as power sharing and so on. Add cpu based scaling support to passive governor with required-opp property. It uses the cpufreq notifier to catch the frequency change timing of cpufreq and get the next frequency according to new cpu frequency by using required-opp property. It is based on patch[1] and then just code clean-up by myself. Make the common code for both passive_devfreq and passive_cpufreq parent type to remove the duplicate code. [1] [RFC,v2] PM / devfreq: Add cpu based scaling support to passive_governor - https://lore.kernel.org/patchwork/patch/1101049/ Changes from v1: : https://patchwork.kernel.org/project/linux-pm/cover/20210617060546.26933-1-cw00.choi@samsung.com/ - Rename cpu_data variable to parent_cpu_data to avoid build fail - Use for_each_possible_cpu macro when register cpufreq transition notifier - Add missing exception handling when cpufreq_passive_register_notifier is failed - Keep cpufreq_policy for posible cpus instead of NR_CPU in order to avoid the memory waste when NR_CPU is too high. - Add reviewed-by tag of Matthias Kaehlcke for patch1 Chanwoo Choi (4): PM / devfreq: Export devfreq_get_freq_range symbol within devfreq PM / devfreq: passive: Reduce duplicate code when passive_devfreq case PM / devfreq: passive: Keep cpufreq_policy for possible cpus PM / devfreq: passive: Update frequency when start governor Saravana Kannan (1): PM / devfreq: Add cpu based scaling support to passive governor drivers/devfreq/devfreq.c | 20 +- drivers/devfreq/governor.h | 27 ++ drivers/devfreq/governor_passive.c | 412 ++++++++++++++++++++++++----- include/linux/devfreq.h | 17 +- 4 files changed, 402 insertions(+), 74 deletions(-) -- 2.25.1