From patchwork Mon Jan 23 04:41:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 92178 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1055095obz; Sun, 22 Jan 2017 20:42:02 -0800 (PST) X-Received: by 10.84.140.133 with SMTP id 5mr39377110plt.178.1485146522812; Sun, 22 Jan 2017 20:42:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d127si410943pga.322.2017.01.22.20.42.02; Sun, 22 Jan 2017 20:42:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750744AbdAWEmB (ORCPT + 13 others); Sun, 22 Jan 2017 23:42:01 -0500 Received: from mail-pg0-f54.google.com ([74.125.83.54]:36449 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbdAWEmA (ORCPT ); Sun, 22 Jan 2017 23:42:00 -0500 Received: by mail-pg0-f54.google.com with SMTP id t6so41346509pgt.3 for ; Sun, 22 Jan 2017 20:42:00 -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; bh=gqR/IdwqZm3bFHVJnAaQNSaxIZfggCje13LiXaAm2Q4=; b=fBK013sB8mmIKG6JVmQvAs7AYT6pw1ReKLuPBfM1v7aZJaW6MexMP3fSMceKFAiVnX RrTTwvw/s2rG+rRNrP2YJ+AJPGRIRDGSDmw41fvzB/NOS9qtvHV0O+QJm0eaGd3g+gSr Z1MAyoM2LFxLikXUDtUCmKBrP0JIPeSM3deLc= 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; bh=gqR/IdwqZm3bFHVJnAaQNSaxIZfggCje13LiXaAm2Q4=; b=iJAE/86vRNhbMLqrZYZ3CU/hRch6v8rlUXbUnRbnWyPga9MBr55nwnKfqoF+oaXSfy leuT+nVqZ92W9tKjbo9M2C8C9HXkIsa2HAXCCVwg73PACrBR2eJK6GG9KqVqIL/i/HdY xRu3NVkAuG4xx5T0WcYjBoPNE7jvhxVNmCucKHJ23ZM3rgOUDACEd44GEAxURwkvpN7d ygYh3tOZI9AkT6JyA7a95H9cFTPJZJVTc6v9IOX6/jfdlAJrUiu5ho84i3DYXXHS25Ee /UOpBFi8ziArOhfZLJWzTJH+sdlI7fWUmpawNeaAWW8/Ea5BalwV8+/qlU4SVxTxWnR4 bpPA== X-Gm-Message-State: AIkVDXJeuYuKkbGYhzdkHVSUMC3+hN8B6mHJ17NeXqHKtt3XXbgZAz/5u8JO1e3M30ir6DRh X-Received: by 10.98.103.195 with SMTP id t64mr29936978pfj.106.1485146520007; Sun, 22 Jan 2017 20:42:00 -0800 (PST) Received: from localhost ([122.171.65.82]) by smtp.gmail.com with ESMTPSA id p66sm12580824pfb.88.2017.01.22.20.41.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jan 2017 20:41:58 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Boyd , Nishanth Menon , Vincent Guittot , Viresh Kumar Subject: [PATCH V2 00/12] PM / OPP: Use kref and move away from RCU locking Date: Mon, 23 Jan 2017 10:11:40 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.410.g6faf27b Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi Rafael, This series is based over the other OPP series [1] which is ready to be merged and is fully reviewed. In this series, 11 out of 12 patches have Reviewed-by from Stephen. Only the 7th patch hasn't got any of those. @Stephen: Can you see if you can do a generic review of it as well? Thanks for continuing to review this stuff. The RCU locking isn't well suited for the OPP core. The RCU locking fits better for reader heavy stuff, while the OPP core have at max one or two readers only at a time. Over that, it was getting very confusing the way RCU locking was used within the OPP core. The individual OPPs are mostly well handled, i.e. for an update a new structure was created and then that replaced the older one. But the OPP tables were updated directly all the time from various parts of the core. Though they were mostly used from within RCU locked region, they didn't had much to do with RCU and were governed by the mutex instead. And that mixed with the 'opp_table_lock' has made the core even more confusing. Similar concerns were shared by Stephen Boyd earlier [2]. This patchset simplifies the locking in OPP core to great extent using Kernel reference counting mechanism along with per OPP table mutex. And finally it gets rid of RCU locking as well. Each and every patch of this series is individually: - build tested - boot tested with cpufreq-dt.ko module. Insmod and rmmod to make sure the OPPs and the OPP tables are getting freed. More testing is also done by various build and boot bots for last few days. And they reported lots of issues (both build and boot time) that helped making this series more robust: - Kernel CI (Linaro) - Fengguang Wu's bot (Intel) V1->V2: - Minor documentation fixes pointed out by Stephen - dev_pm_opp_put() is called only if OPP is valid (in the 7th patch) -- viresh [1] https://marc.info/?l=linux-kernel&m=148334828916156&w=2 [2] https://marc.info/?l=linux-kernel&m=147742717527548&w=2 Viresh Kumar (12): PM / OPP: Add per OPP table mutex PM / OPP: Add 'struct kref' to OPP table PM / OPP: Return opp_table from dev_pm_opp_set_*() routines PM / OPP: Take reference of the OPP table while adding/removing OPPs PM / OPP: Use dev_pm_opp_get_opp_table() instead of _add_opp_table() PM / OPP: Add 'struct kref' to struct dev_pm_opp PM / OPP: Update OPP users to put reference PM / OPP: Take kref from _find_opp_table() PM / OPP: Move away from RCU locking PM / OPP: Simplify _opp_set_availability() PM / OPP: Simplify dev_pm_opp_get_max_volt_latency() PM / OPP: Update Documentation to remove RCU specific bits Documentation/power/opp.txt | 52 +- arch/arm/mach-omap2/pm.c | 5 +- drivers/base/power/opp/core.c | 888 +++++++++++------------------------ drivers/base/power/opp/cpu.c | 66 +-- drivers/base/power/opp/of.c | 94 +--- drivers/base/power/opp/opp.h | 31 +- drivers/clk/tegra/clk-dfll.c | 17 +- drivers/cpufreq/exynos5440-cpufreq.c | 5 +- drivers/cpufreq/imx6q-cpufreq.c | 10 +- drivers/cpufreq/mt8173-cpufreq.c | 8 +- drivers/cpufreq/omap-cpufreq.c | 4 +- drivers/cpufreq/sti-cpufreq.c | 13 +- drivers/devfreq/devfreq.c | 14 +- drivers/devfreq/exynos-bus.c | 14 +- drivers/devfreq/governor_passive.c | 4 +- drivers/devfreq/rk3399_dmc.c | 16 +- drivers/devfreq/tegra-devfreq.c | 4 +- drivers/thermal/cpu_cooling.c | 11 +- drivers/thermal/devfreq_cooling.c | 15 +- include/linux/pm_opp.h | 48 +- 20 files changed, 433 insertions(+), 886 deletions(-) -- 2.7.1.410.g6faf27b -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html