From patchwork Wed Sep 19 22:20:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10606611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45956913 for ; Wed, 19 Sep 2018 22:21:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 349112CC86 for ; Wed, 19 Sep 2018 22:21:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 285162CC9A; Wed, 19 Sep 2018 22:21:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CE55D2C9BC for ; Wed, 19 Sep 2018 22:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=NN0/L6a5jbNcffUecZmwLPIXQgyEf3wWQf5bmK7kePY=; b=Rh6 huxqiCj4gminFxZx9nkQBtVgEGx4qOQj0qaDxkjj1dEmA1yIX24fm4extibsHRGSe1+KT+PWAd64r oZ4Kl2xB67MP1HTcCZM+NUQRDCCCMTlvxqKSxkr9JetnUwoM1k0BDw6pHwLKImTWy6Cdpb3aVsVNU M1UnmFpxoNDBqllBC5aL07tH/khPl4twotd6e+Zq3EhEZ9C/SwEc1M+N4rYDsxlux1gtjdSK5EJpB nvC/YYsMlp37apseq8F3mpE/rVCwICw/ZVHtbzKmaMGlaqu2WLcyURAZuL6FGBqsq/C9Zt6khwKoo +PMINti8LK4Tl2HlEYz0PX0GuFv8cbQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2kq9-0005sQ-GY; Wed, 19 Sep 2018 22:20:57 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2kq5-0005p4-Ph for linux-arm-kernel@lists.infradead.org; Wed, 19 Sep 2018 22:20:55 +0000 Received: by mail-pg1-x544.google.com with SMTP id 85-v6so327501pge.6 for ; Wed, 19 Sep 2018 15:20:43 -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=QMPnc7R+KyqhorgJumqr7AhbuHK1r2kT9gXIvgUfXcI=; b=QQJOsWhwF9fVIUvIuUog6dZWXs5axvm2Q7ws8laO4W34mlrwVDzTbJk1BskHA221rA mDVQvYKPMy4EKfsUaCAGwLH1lREG7//GxzgxS+791++dihvJPsgQjkfzkEdmcAjipCI1 D+Shke0qiauCTDPBtLgPPw75h29xN8Oec5fmQ= 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=QMPnc7R+KyqhorgJumqr7AhbuHK1r2kT9gXIvgUfXcI=; b=HWJ2go2vu9snnUxIP+f1iHc6F4z1hFJwSniWnMTlaSTohG14UuIqalEpsucsbZJhTn wqg1QaB8oKGdLtOm1MR98/jIwI1WFP4yh2C1pvFSL/BN9Yr9tppdUvIuals5aO5SrCI7 ej7c9u3MNU3Ww6rmLK2spCBfTx0cLxkL4PheSncdlqhHHmSgQ1QIJnIb4Ajb+BuTT4Ps Ic4JC6rSPefYTklcMljqMrBF1SSj3kQZDCNcR0lsI2Eth/kLw0JfH5/HniDBj2fqSgDw +AqPoIEp0IW/lzreMIetH3+o+dL7ahM2/Dq91whXUEDZT2BlC/Wls//ZZjyVExY9ZDdB eaKA== X-Gm-Message-State: APzg51COnfsgwgDTXQ9/rl4BJM6TUg4k5tjEvzTLt+CSBaZ7oMdDMCF7 KlupXJnExLvf1uEPZWiaEom4KA== X-Google-Smtp-Source: ANB0VdZUNeEbFh3jHbRD+MZ0TxynVLhOJMlg8KdkAC/H5CGZq7Glm0caXdBSISCcJSy3as5RvKhTiQ== X-Received: by 2002:a62:1192:: with SMTP id 18-v6mr38341906pfr.54.1537395643007; Wed, 19 Sep 2018 15:20:43 -0700 (PDT) Received: from localhost ([209.121.128.187]) by smtp.gmail.com with ESMTPSA id g5-v6sm28676961pgn.73.2018.09.19.15.20.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 15:20:41 -0700 (PDT) From: Viresh Kumar To: Andrew Lunn , Gregory Clement , Jason Cooper , Nishanth Menon , "Rafael J. Wysocki" , Sebastian Hesselbarth , Stephen Boyd , Viresh Kumar Subject: [PATCH V2 00/12] OPP: Don't create multiple OPP tables for devices sharing OPP table Date: Wed, 19 Sep 2018 15:20:19 -0700 Message-Id: X-Mailer: git-send-email 2.14.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180919_152053_838528_707B88C4 X-CRM114-Status: GOOD ( 12.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vincent Guittot , linux-pm@vger.kernel.org, Viresh Kumar , linux-kernel@vger.kernel.org, "4.18" , Niklas Cassel , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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. The first three patches are fixes really for the current code and the rest of them are making necessary changes to fix the issue defined in $subject here. Nikklas already tested this series and his Tested-by is already applied to series here. I would like to get this merged during the 4.20 merge window and will push the series to linux-next soon to get more test coverage. Please provide comments as soon as possible, else will send it as part of the pull request to Rafael for 4.20. --- viresh V1->V2: - Nikklas reported another regressions which is fixed by the 2nd commit in this series. Viresh Kumar (12): OPP: Free OPP table properly on performance state irregularities OPP: Don't try to remove all OPP tables on failure 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 | 15 ++-- drivers/opp/of.c | 188 +++++++++++++++++++++------------------- drivers/opp/opp.h | 19 ++-- include/linux/pm_opp.h | 6 ++ 6 files changed, 226 insertions(+), 158 deletions(-)