From patchwork Wed May 17 04:40:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 99901 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp63377qge; Tue, 16 May 2017 21:41:13 -0700 (PDT) X-Received: by 10.98.212.66 with SMTP id u2mr1649132pfl.73.1494996073652; Tue, 16 May 2017 21:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494996073; cv=none; d=google.com; s=arc-20160816; b=WYepCqIseHTPAQgSRFqd3oCl+gHxDbGkeKxbsKuvFIhKnR0JM8sH7VncS7beBNPs1x 0gkV+R4WNX9yW/wVE4UdKE+PK5XlZOnQCywzDzSHIBZkS2hKaFT+tVcUHxiohfNBQg/g HhDTorMtBar1AFGzSaZt16qM+lVJwSfLHwWCwxLlOvLJ+sostSSBx+u0aW14Frh3U80W ZjupErgSSO3fJVyAA5mjv4B7jVBRzRzv4jxeoq0K6mNWTFJoeqIruSOoUiA23o6R0H08 eIAZKn0ltHuH5RP43XOjuao9eRR2CSagb+3g3AbfjWbw072A1dx5t4HQ2KVfKtVoKt6B 4Mmw== 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=6uynZQWlquv90tpsM7Nn9S80BVBUw3QLtpIa4UYzsVE=; b=TRRFNE8I0Vd688SYI/krvaIQx7qBnj54GAP0i9KBxVeE7n+46xeTWHj57IEUYiA/Dp 5HrOES2W0gJdUdDwXRQLkFCU1NrE+XXbAJj/ymJqj39RxKlcSyd8rPWU2bFED4yybNNu tiqhLzSIXDUkCOpltMxHkgteEIcMHePR/X2DrXuB+tZdQ8DW3I5yQX8NJgkcwEomcHJp FnaXrZUZDiD9Y1VOZkkV1KGhedbu2JRxVsJg6tBWmA1pAUm42AxBxuX6cqneM1NmXgO0 Tu5vVcAL40sQEcFrLkBtrUpXliTd9glM5HnmW7plpYySpaLlwAZkc44fwrkOYbTVxZU5 rFXw== 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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 h79si976926pfh.1.2017.05.16.21.41.13; Tue, 16 May 2017 21:41:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1751566AbdEQElF (ORCPT + 14 others); Wed, 17 May 2017 00:41:05 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:34392 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752750AbdEQElC (ORCPT ); Wed, 17 May 2017 00:41:02 -0400 Received: by mail-pg0-f43.google.com with SMTP id u28so1006520pgn.1 for ; Tue, 16 May 2017 21:41:02 -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=6uynZQWlquv90tpsM7Nn9S80BVBUw3QLtpIa4UYzsVE=; b=EYIKltB4tOC0GcOI6i0S6kTLEtup88buFAADVItnvnfqQQNHwWdEGOjt4aBOR1s2DE IGdQVW0bvHPoeKbB1Xio7AEhXKXYvcTLhbp1k6jWsE9EP/sjtqC3tNOrWsu6mnryKZhe IXOCoFwecWQmZBvpbP8ZRBfbKS8EQsrVSoPuU= 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=6uynZQWlquv90tpsM7Nn9S80BVBUw3QLtpIa4UYzsVE=; b=SGYmVhO0S3IH/fkElSoDS9Q2xpDl+YQjV/yG6IqdK1syWRdhl46p183BIIBAGca6rc q1ugleefnAyGa0C5ETHcZIza+Z3zV9QnGeKZ40W4QJpLSSfLvsaEehWShlpbPfL88BE5 A47L8W+SW2/3iF+cSG9aXXrqTqRkG2mBCGz7+STwO7rt7N+xCI3j+/Nev+IUHdETzubi SNIbhv6TAGgi9e/DU6Jy9Do4jkj2mBjhtE8NDbodTBkLJ37JUWPAh04hFPKPh1iaPhG9 Za6epVGx3Brshv+qp212+PYvxk0X6nDCwjtJoIpgqTtriCZ29g2V9XoIrfL+efN88pzO E//A== X-Gm-Message-State: AODbwcCF/JT8BIigPlmTZhRxgHRPGw9ZdgXjC9V5/uYNvfhpvCsLdeD9 wLCP10an69XToryd X-Received: by 10.98.97.4 with SMTP id v4mr1673720pfb.23.1494996061725; Tue, 16 May 2017 21:41:01 -0700 (PDT) Received: from localhost ([122.172.129.253]) by smtp.gmail.com with ESMTPSA id a24sm1008145pfl.70.2017.05.16.21.41.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 May 2017 21:41:00 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , Viresh Kumar Subject: [PATCH 3/4] PM / OPP: opp-microvolt is not optional if regulators are set Date: Wed, 17 May 2017 10:10:34 +0530 Message-Id: <0e9ac75f0e94d7b0bff9a398b501e2fe4f409051.1494995911.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.13.0.303.g4ebf3021692d In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) -- 2.13.0.303.g4ebf3021692d diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c index 779428676f63..c6fc8cbad10d 100644 --- a/drivers/base/power/opp/of.c +++ b/drivers/base/power/opp/of.c @@ -131,8 +131,15 @@ 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) { + /* The regulator-count must be zero here */ + if (!opp_table->regulator_count) + return 0; + + dev_err(dev, "%s: opp-microvolt missing even if regulators are available\n", + __func__); + return -EINVAL; + } } vcount = of_property_count_u32_elems(opp->np, name);