From patchwork Thu Feb 27 12:45:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 183946 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4469028ile; Thu, 27 Feb 2020 04:46:16 -0800 (PST) X-Received: by 2002:a2e:7d0e:: with SMTP id y14mr2886346ljc.158.1582807576742; Thu, 27 Feb 2020 04:46:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582807576; cv=none; d=google.com; s=arc-20160816; b=LDq3ZPGEcBxXHHQq6NpaaLgtVtFIhQsrjahdwE8FVe30O5Egqk347/mhlyzrxm0JtS dQm0tjhxo3KdGh4zG90q4jMsqn9qN0QlpYzTVjHUXx1bdazcSY1T+wou5OJLYGel59YK RXlo4yXGCoXZJ7ychUJmNh/5fVD2oq9BUCQCI/tLggXmjDKnsyf0aBcOR5sG70o2UW7Y YoWR+a1m2LLZ243SGVPvs18IZFd7UJJ9ntRRL9Qu83i693ChptiR+FHnbZ8bYXxoQZ0Z j87jhEeHIPt8PMO17lS9SPwyuDfXYwDaO0IopXm+h5hUAdb8sDiK7iLJG2lzng1ixX16 RNIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=3+0UYj3qVJZMwBRFalwhwumi1SLOyZkXHX2X4PQigTk=; b=IM2eUHz+ljP+MuLiGIKsVKMKEWIai4LmrD5HzUrZu52QRaJg0ys3be477q4b1RxFMk Athlsl03G7DFaam68hvqGyZGprBU38LTWTG238NRYxW+BWb4kBa5umrakFjnBdVSMEVk VzZzZHxpk0ZsfMStB+ChVTQmk2KYC7ge8Mt6NaADim9hJx/XmjVdfbmwqo98zcz1+fyg MBjPzomWYSZ9tCZ2RRZJkImC5Az8BgV1H5X2oaG4TtEx68bC6H62jZE2/9veeX0+7fqX dM5BMWjeD7+EVOyboMo9MUUmJmy6ffZzXfDmu9puaK58osh+qLhkUyXH0xr4eAth07JI Rlpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mXb6at++; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id d28sor12417lfn.55.2020.02.27.04.46.15 for (Google Transport Security); Thu, 27 Feb 2020 04:46:15 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mXb6at++; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 :mime-version:content-transfer-encoding; bh=3+0UYj3qVJZMwBRFalwhwumi1SLOyZkXHX2X4PQigTk=; b=mXb6at++ivddD2NTVyokGX6Bv9FhnYBxuwJBu37CLMiC7ZKw+agfQ8IcqYkg5R62dV UbBJskVFA9v0xAAj88zbm115M1Ky/Shbongm6s1uqNzblmPlJpA2AlhbNzAonTqF6KVT 3f/G2VBMbDM89Gh1lBSYuFEgrllGeNDN08WuURX9P9tevKQmiXieDsY0P2yJqyq3PT9i oVHssqDaQ1V4wZZAid9+NJ84Jnb46rLodKD+SSpZ/3FX0TCDUBxHuSYZBntM+ZH66VrM J7J/NKuN7xia8AKCAQQtvg87aTIL4OKo8vWc6bJ6Ce5c9W/CjOlDCG+LC+WNFAbe2hcJ eX7g== 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:mime-version:content-transfer-encoding; bh=3+0UYj3qVJZMwBRFalwhwumi1SLOyZkXHX2X4PQigTk=; b=hV+h/uFnrRSZNGGZkCRxNzNNHYr9QOYYp1rOIWxQoHi/fvl9O0b108BGJ//z56Ln/i EXrtsq5Wep/FlpcrC17V0/NUmWFYPong9JHXhMMoX885fFH19DkUdxAQqQPNjx59N4wC RUpoAGvEp2z1pfn2GbDmvTtSADSJREXK5a0+zesmULGIqe8du9PC1jEdpBjXQ+kBBv/q EHXHpqaomKRygnnJwVvpcdaM1b5bxlCY8tFCyHguoMONVV8jt5kwPD00nZZ1iqnGnraQ k5vE0fyncbpxqwOhtCLBtboHzjk5/kDagJkhmdosfV5Zfw46E0VrVXCsYdjLbGbopIoc FxiA== X-Gm-Message-State: ANhLgQ3e2QWNXIKntjebS+mMZsXZ6cMu1jIk28ZEDUxWwhTzfeQDmRAX WH1HFS2dNUcGFaBDGrfMuCGMmIcc X-Google-Smtp-Source: ADFU+vsHQVosAGa6s8cq304/BYeC23/PJ+nzRpBSOGRg4zjwsWrSheAAC7nA+O5n//KNTf0/gfXSPw== X-Received: by 2002:ac2:5299:: with SMTP id q25mr2092593lfm.213.1582807575348; Thu, 27 Feb 2020 04:46:15 -0800 (PST) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id l16sm2669334lfh.74.2020.02.27.04.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 04:46:12 -0800 (PST) From: Ulf Hansson To: Sudeep Holla , Lorenzo Pieralisi , linux-pm@vger.kernel.org Cc: "Rafael J . Wysocki" , Daniel Lezcano , Lina Iyer , Vincent Guittot , Stephen Boyd , Bjorn Andersson , Benjamin Gaignard , Ulf Hansson , linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org Subject: [PATCH 1/4] PM / Domains: Allow no domain-idle-states DT property in genpd when parsing Date: Thu, 27 Feb 2020 13:45:48 +0100 Message-Id: <20200227124551.31860-2-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200227124551.31860-1-ulf.hansson@linaro.org> References: <20200227124551.31860-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Commit 2c361684803e ("PM / Domains: Don't treat zero found compatible idle states as an error"), moved of_genpd_parse_idle_states() towards allowing none compatible idle state to be found for the device node, rather than returning an error code. However, it didn't consider that the "domain-idle-states" DT property may be missing as it's optional, which makes of_count_phandle_with_args() to return -ENOENT. Let's fix this to make the behaviour consistent. Reported-by: Benjamin Gaignard Fixes: 2c361684803e ("PM / Domains: Don't treat zero found compatible idle states as an error") Cc: Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 959d6d5eb000..0a01df608849 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2653,7 +2653,7 @@ static int genpd_iterate_idle_states(struct device_node *dn, ret = of_count_phandle_with_args(dn, "domain-idle-states", NULL); if (ret <= 0) - return ret; + return ret == -ENOENT ? 0 : ret; /* Loop over the phandles until all the requested entry is found */ of_for_each_phandle(&it, ret, dn, "domain-idle-states", NULL, 0) {