From patchwork Tue May 23 04:02:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 100350 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp138067qge; Mon, 22 May 2017 21:02:36 -0700 (PDT) X-Received: by 10.99.247.83 with SMTP id f19mr30169325pgk.190.1495512156192; Mon, 22 May 2017 21:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495512156; cv=none; d=google.com; s=arc-20160816; b=aKzVVh1/vlyanjxq44QWQrv1BktoT/uEJc4fPcdy2ZP5GBxESjaOon/yTVRozrqFZK pehQjPU3KfMieIPiBMC23c4B7IagFQ3iBJkiP/AXuWbi7BFD5/ZSKKm159HAhyynSKVS su8uIY0yQSntOUA2NjOlqKkql+1ErqA2NP4kb8VJbRkXiO8X7pdftzp6d3R7Jfwi7RhJ 3EqdVjYn68nf4ta94Vv646orbOPYuVKv1dcx76k7mZcqSymoe+aaRSP9UBkYlgc3CHN1 UarzQiyAyZv121vUTHa26JHzz+9bujMFWS68ICOJi5R+XnSJEV9SO0/OPVoxtg5JVkF7 vpPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Wi+STXaXMwKgmd0gvGJ7d79KTO9lKIRHo7PqBI8Qtrg=; b=bsDUsaddR2C/v6byxjYNJ7WAVD1KxehOXGqpTAJUfcI2AmZ05kZ+UHDiYggQVcdfwe aetcV5WeuVf+Ulc+6KRLXKXfaVYjbsse3nL/38hka0533bcDUg5Kk49X1JR0nrXRNvsf EKeuI9Jh+9Q63WH6mq95VfcCfEhx7n3PPE4cDK5JKMtW0ep4X4KLO6B62VxpgcbJT8ld o6ip/BwF/z+YKShHXZhzv1sa3CEG43N8fNEHWZ4qlPBVyy6sUlqn34ry6gQPqY3mN34P Y4jO7ibfTyUwfyh9fshX65h9pNdy2oVl+5J+F/Xy0VymHgv4wMLw0J0SuUq8nI8lfCii WSmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; 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 g84si18961413pfj.201.2017.05.22.21.02.35; Mon, 22 May 2017 21:02:36 -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; 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 S1753961AbdEWECa (ORCPT + 25 others); Tue, 23 May 2017 00:02:30 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:36232 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbdEWECZ (ORCPT ); Tue, 23 May 2017 00:02:25 -0400 Received: by mail-pf0-f176.google.com with SMTP id m17so101263374pfg.3 for ; Mon, 22 May 2017 21:02:24 -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:in-reply-to:references :in-reply-to:references; bh=Wi+STXaXMwKgmd0gvGJ7d79KTO9lKIRHo7PqBI8Qtrg=; b=hh66JmfPXtVEepdiAVWp0C2wRt6LpIXJ2w6UG/Y0cGkvPgfH9hkAep3Eg2MKf6OsH6 ipFVtu+SqITxqVUGxSn0Yp7Pr76XPN2KPHmt5IVI9UsPxe00LvrxGvuGEZ4zbaQnpKzB nnhXKzM0M4/qRqAaNxRdYci7LUx07FxV2TzcU= 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:in-reply-to :references:in-reply-to:references; bh=Wi+STXaXMwKgmd0gvGJ7d79KTO9lKIRHo7PqBI8Qtrg=; b=RDxqQRoABp3ae3Hu5MCsSv/UgW4/8JZHEUKXChF/qX72FqxUIJ7qW4gSuR8UXypJJW gWyfgsg2UtMQqTjuyDYqfOSX6l1cGX0lljuaJaGg5MCh3BH+5r3/pWgzv8xY4AXcC7RD PpqtTA0xFTh+Kb1pWwZCKIYOaXWtdlrJZgry3FRx8txS0SGu1PAKtLLorP+X2jx1XlGc 473IPylT+saX8zoBkTltihk/Y6hrIwxY/kgXuWk69KDDtSbErpKvF/PjoJynGt9r6BQW /gGRaXxQSZuVP86DycpzMpQorIByAEPLBPe2cTtmn9Ol4Dl2m/8SwNUImeXjKmrJ/Lbj I2FQ== X-Gm-Message-State: AODbwcCYbmB/Xdvx0mELQTOPuKQQko8Lcr+0ySyiAX6iOCNaTxRTYguq QEY15kSo/F1F7jdK X-Received: by 10.84.168.67 with SMTP id e61mr14943582plb.124.1495512144314; Mon, 22 May 2017 21:02:24 -0700 (PDT) Received: from localhost ([122.167.143.58]) by smtp.gmail.com with ESMTPSA id g10sm31785950pgn.35.2017.05.22.21.02.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 May 2017 21:02:23 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot Subject: [PATCH V2 3/4] PM / OPP: opp-microvolt is not optional if regulators are set Date: Tue, 23 May 2017 09:32:12 +0530 Message-Id: X-Mailer: git-send-email 2.13.0.70.g6367777092d9 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If dev_pm_opp_set_regulators() is called for a device and its regulators are set in the OPP core, the OPP nodes for the device must contain the "opp-microvolt" property, otherwise there is something wrong and we better error out. Signed-off-by: Viresh Kumar --- drivers/base/power/opp/of.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.13.0.70.g6367777092d9 Reviewed-by: Stephen Boyd diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c index 779428676f63..57eec1ca0569 100644 --- a/drivers/base/power/opp/of.c +++ b/drivers/base/power/opp/of.c @@ -131,8 +131,14 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev, prop = of_find_property(opp->np, name, NULL); /* Missing property isn't a problem, but an invalid entry is */ - if (!prop) - return 0; + if (!prop) { + if (!opp_table->regulator_count) + return 0; + + dev_err(dev, "%s: opp-microvolt missing although OPP managing regulators\n", + __func__); + return -EINVAL; + } } vcount = of_property_count_u32_elems(opp->np, name); From patchwork Tue May 23 04:02:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 100351 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp138070qge; Mon, 22 May 2017 21:02:37 -0700 (PDT) X-Received: by 10.98.21.17 with SMTP id 17mr28684017pfv.71.1495512156967; Mon, 22 May 2017 21:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495512156; cv=none; d=google.com; s=arc-20160816; b=gpkE+tdJWh1Mf/Vwrz5YSKLjm+qddaD5BBiHkL1d50hKAJrYNFfVcewWxuNiiT4mob xyoZjuUzX2yXDO1IOHtdpj2KSF0gZN+5t3q8Sqrn0CrpOnQxY/rcBkRMgq7RVhAeAgHl JoryEiiIdvuHhbDRxVBFlhaUNdyH0EV15iSUTKfS78kU1nOwKSQh920wnWEWUSs+E9am XJBm3ICOMqGoT6gb0DceGYS/YMmIYNMgMTRvGEkVhFKoAjd9d+Xrf3+Q4ujcQ+v0hm+q Uri99M836ld3YTVoh+Zh9+i93D6sKNW7WZBWnmwQ/Lght/RFC5snNBvI0ILJloBw06Nc Bq0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=pIcB8KUtH19SR9fm/iFnGr+LoIw2eVy9+ac0TASL1Mo=; b=lhZ26km7nITuQ99AimosPcjWiNP+cBH8ekYCbUFyYoj/QfL/sbvF3nIJHMqbnGlrMR JgaXITm/nLOfIpI7eVF7SP32B5DXwA/LNbOYpLsm0wHyms0D7qKiWiAoMf/KZVoIa/wi MM5cweL1IiRgKPFidX47NQtLAEsG8k5JV/7ZtNVjKKkjzXEnua/heKmzXPDNTuMoJyj6 +2NiuMhUMblvr+ZputUkVAzeOQOa/wfiF8ZQQooIxpw7c3WfEeB9mTQQ/VToqomJtL9H KXStkd5L2r6nl9Pp2zGAvvbV6xMNt3gkMryIWINXK8MeWEnSboa6ctEvqkWHSjvmJ+0l AVNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; 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 g84si18961413pfj.201.2017.05.22.21.02.36; Mon, 22 May 2017 21:02:36 -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; 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 S1760838AbdEWECe (ORCPT + 25 others); Tue, 23 May 2017 00:02:34 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:36253 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504AbdEWEC1 (ORCPT ); Tue, 23 May 2017 00:02:27 -0400 Received: by mail-pf0-f178.google.com with SMTP id m17so101264461pfg.3 for ; Mon, 22 May 2017 21:02:27 -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:in-reply-to:references :in-reply-to:references; bh=pIcB8KUtH19SR9fm/iFnGr+LoIw2eVy9+ac0TASL1Mo=; b=NjXuG2niqc1eI9fePcXVXZRohcnKNTMm4cd2WLZcaPDXVgKVvZDJm/lZPqCg5ukN9H uLxVNN48yvwAyPsEvhWYO2iTyNKhggANnuu/+1GTlnB5q2Pc+d5ZBhoM5BG/u15UR0ko hmaYRfFaoSUFxP/YvyAqOQTcfJfzW4h4tmGpU= 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:in-reply-to :references:in-reply-to:references; bh=pIcB8KUtH19SR9fm/iFnGr+LoIw2eVy9+ac0TASL1Mo=; b=QYw2kRok2NyalN3N9ubW8wERtoGg8aFCj44Iyt1KaGxy9Vi8ZkTOE/KRCb+BfFudUz Kt95/aVTkQ6+6Ha464XHFG+9P4ykzollouN8KLR8O3EQYqFNt7XifAfsE/QvyV/Rv+AU JxDjfDGyLA1cnbmeo90bUqeU75E3Zfrgucow8cX6KxhCyg75daRJ0W2Q7tjTM27r+nLf OMNTy/4/OeXwLIMKoxfNh+7ICTZxoHQcDoK3kDTOm5OpJXSnxoyjM9vCRemYRqIECjit L65lmcyEQxN7XVbE1rYE1DRwzVtsKyQeqvlyXhQOFEaSJcLe5CkunwQ46RIRcvhoTQku ENRQ== X-Gm-Message-State: AODbwcA9G0YbbTOHcJz0PegN9eLiiP5RnUim2fzRcY8OJ8XbsAk2MrPE R4QSewhgwXi5GMBe X-Received: by 10.84.218.7 with SMTP id q7mr32601889pli.80.1495512147201; Mon, 22 May 2017 21:02:27 -0700 (PDT) Received: from localhost ([122.167.143.58]) by smtp.gmail.com with ESMTPSA id n65sm38288229pga.8.2017.05.22.21.02.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 May 2017 21:02:26 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot Subject: [PATCH V2 4/4] PM / OPP: Don't create debugfs "supply-0" directory unnecessarily Date: Tue, 23 May 2017 09:32:13 +0530 Message-Id: <0381fc50b84535fcb7964eaa345d2501c5c903b3.1495511998.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.13.0.70.g6367777092d9 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We create "supply-0" debugfs directory even if the device doesn't do voltage scaling. That looks confusing, as if the regulator is found but we never managed to get voltage levels for it. Avoid creating such a directory unnecessarily. Signed-off-by: Viresh Kumar --- drivers/base/power/opp/debugfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.13.0.70.g6367777092d9 diff --git a/drivers/base/power/opp/debugfs.c b/drivers/base/power/opp/debugfs.c index 95f433db4ac7..81cf120fcf43 100644 --- a/drivers/base/power/opp/debugfs.c +++ b/drivers/base/power/opp/debugfs.c @@ -40,11 +40,10 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp, struct dentry *pdentry) { struct dentry *d; - int i = 0; + int i; char *name; - /* Always create at least supply-0 directory */ - do { + for (i = 0; i < opp_table->regulator_count; i++) { name = kasprintf(GFP_KERNEL, "supply-%d", i); /* Create per-opp directory */ @@ -70,7 +69,7 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp, if (!debugfs_create_ulong("u_amp", S_IRUGO, d, &opp->supplies[i].u_amp)) return false; - } while (++i < opp_table->regulator_count); + } return true; }