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);