From patchwork Wed Sep 12 08:28:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 146511 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4546644ljw; Wed, 12 Sep 2018 01:29:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZOsWb9wzDDk5xYO8wN7p2PY4HdXbHZTtqg3Yj9V8Xyk+YfnMCsD0UbZD63B9OpWg8PmiVJ X-Received: by 2002:a17:902:7c96:: with SMTP id y22-v6mr907186pll.332.1536740988398; Wed, 12 Sep 2018 01:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536740988; cv=none; d=google.com; s=arc-20160816; b=GCHA2SPc8xkbaks3N1pAGWd1BRLelvXn11INtOzxDWdkf0EnfIi7uMMtgmCejKVC22 Gp9SS+i23C+i+FQgv4kqfHxLga3zgEgxGIfRJSKg76myw9xB0qK53/M9zYKMcoQJYtWf 99MfUUHukHs911cobxFsVe6Cv+WA5ZI8RtChnaAyGtCH7Zb2KLT3lChY+W/QBkcUAaWx XsAr/zIqMjMhoqxXt2dkRuLuuUG0rhIYwtawNdugMdyRmbDMggYgpkJw5Xlw3GdRvaBp e2enGm5EDeIp0++Ij/iLAR1q3oAJgEi5trLl/8SxIj2h6eHTlc7oDz1VHtbgnjRbVLhK 7D1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=+OmOlv50znc2tgHYJkRyI/UDE2I0tRf5T900X5bNP9A=; b=V7Rp8YVQqmnhHtoD+4rxHTm6kWG7Ow47zuODlxPeEHAW1nps/spw6m32L/pxZFRp1y C0kQC99CV08VKEyTwkCzLtXMkfeR/qh7ZAwlwgbCzjYZRChHGs8r/9SN3GetI+WKn5GA TznWmQ6IzpfBLM8a/BQpaNQ+TNRmrsYLhmkwC3/vwIJ81rkv5/T0OpVytSGeWSIe1Ain dXpea9hc4Q0d3zmaArDkSWk/Abd4P5lWbWIS77/aIYW6O6mKrz3LRKn7/OoXR/SIS+JK PwUrPhTdfl9Hpfp+qINHckH+JOdR9t3aoK+wfSUg6NtyJLWRRkoYNcdajanty282Wumm eRvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hkddc2GP; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si363386ply.483.2018.09.12.01.29.48; Wed, 12 Sep 2018 01:29:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hkddc2GP; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1726537AbeILNdO (ORCPT + 13 others); Wed, 12 Sep 2018 09:33:14 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:44148 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726670AbeILNdO (ORCPT ); Wed, 12 Sep 2018 09:33:14 -0400 Received: by mail-pl1-f196.google.com with SMTP id ba4-v6so613632plb.11 for ; Wed, 12 Sep 2018 01:29:47 -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; bh=+OmOlv50znc2tgHYJkRyI/UDE2I0tRf5T900X5bNP9A=; b=Hkddc2GPFBgqNXe25RLszXjOCkWhh39MV/uIK+libyf+2PiTX8Tv83xlV8f4KE++hy mFsz5zsPuNv9qaknsyQu2vc9TJxOyqMTv4G0/GuWnFXLEfA1eoZ6HdXgqPeYVcFe6RDG XPsbPBpVtrzcEzID+tjXCuFW2o27bGo7o7W/k= 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=+OmOlv50znc2tgHYJkRyI/UDE2I0tRf5T900X5bNP9A=; b=iDrafzOR1oNwIs+xaJ/cmYIGAyninmyR4bjvzEF8FO8kFYfbzhzmOFw0XMxyuOlvpf 0i3ZJwHvDz7d49bhl99DeQympJ95AC/Bdx3kfI+1kSnmHOwbVA53n3aCpw3/yDaRvZED qd7WBmtxxuI7v1/Q2Ei4Uup6ys1A9MaEfYFOJOv0T3MiEpl8S2LnUhffD259/zKCrASU 5GicVJPqJcYUbcbvvMJUADTVZ8kzZbcqtL0u5KJIU8K2i4Kt6AzJ98Iyy6D5HTXNLFHK yDgj6V/VFDk9o0tHue51CjGjNGZ57hI8OClZOATM2t5PcIQMG0onZNqzo3LvO7pD6bky 0Bsw== X-Gm-Message-State: APzg51CQDYFBqGKNp54E2zP7qBroiL68TpXXFQKG5KRKypP1GhB/6vBc GrMrHK7dJpxLCbiCDOGqVvqJWw== X-Received: by 2002:a17:902:aa49:: with SMTP id c9-v6mr855934plr.195.1536740986604; Wed, 12 Sep 2018 01:29:46 -0700 (PDT) Received: from localhost ([122.171.64.45]) by smtp.gmail.com with ESMTPSA id w81-v6sm977560pfk.92.2018.09.12.01.29.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 01:29:45 -0700 (PDT) From: Viresh Kumar To: niklas.cassel@linaro.org, Andrew Lunn , Gregory Clement , Jason Cooper , Nishanth Menon , "Rafael J. Wysocki" , Sebastian Hesselbarth , Stephen Boyd , Viresh Kumar Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , "4.18" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 00/11] OPP: Don't create multiple OPP tables for devices sharing OPP table Date: Wed, 12 Sep 2018 13:58:39 +0530 Message-Id: X-Mailer: git-send-email 2.18.0.rc1.242.g61856ae69a2c Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Hello, Niklas Cassle recently reported some regressions with his Qcom cpufreq driver where he was getting some errors while creating the OPPs tables. After looking into it I realized that the OPP core incorrectly creates multiple OPP tables for the devices even if they are sharing the OPP table in DT. This happens when the request comes using different CPU devices. For example, dev_pm_opp_set_supported_hw() getting called using CPU0 and dev_pm_opp_of_add_table() getting called using CPU1. This series redesigns the internals of the OPP core to fix that. The redesign has simplified the core itself though. @Niklas: Can you please confirm that this series fixes the issues you have reported ? I have already tested it on Hikey960. -- viresh Viresh Kumar (11): OPP: Free OPP table properly on performance state irregularities OPP: Protect dev_list with opp_table lock OPP: Pass index to _of_init_opp_table() OPP: Parse OPP table's DT properties from _of_init_opp_table() OPP: Don't take OPP table's kref for static OPPs OPP: Create separate kref for static OPPs list cpufreq: mvebu: Remove OPPs using dev_pm_opp_remove() OPP: Don't remove dynamic OPPs from _dev_pm_opp_remove_table() OPP: Use a single mechanism to free the OPP table OPP: Prevent creating multiple OPP tables for devices sharing OPP nodes OPP: Pass OPP table to _of_add_opp_table_v{1|2}() drivers/cpufreq/mvebu-cpufreq.c | 9 +- drivers/opp/core.c | 147 ++++++++++++++++--------- drivers/opp/cpu.c | 11 +- drivers/opp/of.c | 186 +++++++++++++++++--------------- drivers/opp/opp.h | 19 ++-- include/linux/pm_opp.h | 6 ++ 6 files changed, 221 insertions(+), 157 deletions(-) -- 2.18.0.rc1.242.g61856ae69a2c Tested-by: Niklas Cassel