Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5137909imm; Wed, 12 Sep 2018 01:30:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYF0OivFu/4s84ng6m8JtrI26F0X7/NyNYWrP+zHAA5xB/m7j6w/lEXzXFx8uJBY9j87ep5 X-Received: by 2002:a63:f206:: with SMTP id v6-v6mr894148pgh.319.1536741011578; Wed, 12 Sep 2018 01:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536741011; cv=none; d=google.com; s=arc-20160816; b=WgaOYSVIMPZ2aByquhNPDi5BstqpvAFrUiHPKhBeCSQALsZiysVz9f/1AFj/2P7279 Xah4Wz5sMIJ6iQ/KVVR1XgwS/qgnk2yOditj3gx2UUwbZtY2ywphCBaNoFhME7iKf5zP 5Gko15LA/yTA+A1mD/QezvFDkwVM1kE1n4NM8SuAmD/Lv05HibvmwH66xBOTJLZ5porV BqXDNdDQ0oBlMiM/ukQ6jkxSp2nkTj9LlpchhnJpopT0OPiHHZEy1BJeApjAe686VuSf rBSUXRvF/wNSIbSPDic7i/TfDQfHncE5QClHBZwpYcRjFZNgGHFXVvfrUXO7/FuwI2Pz BsOg== 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=gd8fYMqI884+QWK++TjL1akko6mQNBC2hjj+YO4JZyj96xpngt7rNZzbh9O3w7FMNV FvjRD1XtKEX8lcUo0Ob8MgvxjghPcN6CKu1rhZPj4Dn/DQlYtsycCSv2Aeh5BVjBNESR deVoIJzG/BIhb13WEZUpJPHmQefcYXUKiDGeh5PhRjxetV2rv8zQIiStUkvkcYK7eZod lDPrl7vSEDUm3jL4HvOQt0oVvLx0UAsBU6LGnvgyX0wquDvAjinBcnqWbvQwOqh+I7vC AFj5U4xZ7ofu1cMsElZcqLYclQtcU4f/1YifqzAZgasqSCvLVqQGJVdddczVpXrS98PP XzQA== 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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id k2-v6si395512pgp.602.2018.09.12.01.29.55; Wed, 12 Sep 2018 01:30:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727670AbeILNdO (ORCPT + 99 others); Wed, 12 Sep 2018 09:33:14 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42860 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726552AbeILNdO (ORCPT ); Wed, 12 Sep 2018 09:33:14 -0400 Received: by mail-pl1-f196.google.com with SMTP id g23-v6so618259plq.9 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=QX8T9wcQXCiA9G/vdtpwX6XNRryChPexdKjt8j4SKfPoLopR5i0YkQEGhvzy4AfrUX jygzrG2s3C5TU72QjCnPD/CNTuvVdJs+P4H4gjclY3tIlv6qwgqbcg0TcfcL3huqRxLp jxH3ZO/0XzTnvXFJt8mQU73ZFDkohbO0jO/ckHDcvR103tVxw0ViIVYdLY6OV5QpBG8N xFsgwg8WxYbNOJ6WtQgaSTcwSl4t+NE3Ddr/GvOhnq6tcDvUVvUx8hdGdQq7SWPJLINF 0RsEIaiWjAyQgFo4CCmClWl71pxEGZFzg7uV6mPqWRO9sMRGDOX0OzkBhzg9hecxpwmR gFAA== X-Gm-Message-State: APzg51CVHvD2/TnBgRlIXSwy7Kz/cykXTOyfesd/m7k6lnwGI9yhn6/S jSUkDYZg8ZlCNzhdIYWFB5+clA== 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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