From patchwork Tue Mar 10 10:40:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 184346 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp552366ile; Tue, 10 Mar 2020 03:40:30 -0700 (PDT) X-Received: by 2002:ac2:4316:: with SMTP id l22mr12296837lfh.150.1583836830273; Tue, 10 Mar 2020 03:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583836830; cv=none; d=google.com; s=arc-20160816; b=Q2lqSlnR5L0sGiy73b/dXKJbUm06QiD8MMoHeBQ3fhjATKQVhPQvutgL+CY1hpVN3g Fg/to3CqCunqdefZd9IRBvvFmc6Peg38jxhVzz4+S40wnRor5nUV1MCQfIBY7/E/sI9I 0L+GWchS98GboU5yVPYc8FL12KtmtUICt2GJEbVo8ZYKSdvX/CqP90cpdR0w37AdUP1W zJ8kG+YmO1lwUgsZdl7HqHVfTd1Iy0w2PQEqJBUinaXnMmaR3gwBY/X6EmBS5LrTAFJy qXkibAruC8mjzz1ys3HamNTp7cbj2cWKvLVys9gA8LtRGUZ7qH2DAKUIiACIo560Rkwr GK2g== 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=VOmLbFg4f7m0VWnyO1xDaH/AZNMu+kPMNjgBVvsbMM4=; b=MayNC7MQWiop54+HdOVUAEcPxz2oUSE5yDYKgppCUzbabCKiWGpwRFNlPppyrJZPLo cyzuBLGN/yeIP3EO/s4foNO4eGr20/tUGWPkqsRCa+FgNgLLwE4Z9NCgpvkCiYJBdZq5 hLlMqk6A0p4z1dITvNgJ3si21mO8guLJRJ6cFOdn1Ce23+3vYhFK3janvpvYoYzQHMFE oe6f8bQy43UzeBfLlYF3XKYhu+m1guuRkFo2PMsVtG+odyV0CW1elma+jc/yXQd935Vb MfY3J8xoHkYLX5UHexnLDhkLtvBtcsoU5HzNv4BOgxwnDtPgCB5+KUpZ/+ACcgwahITi c4cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XmPV7pmf; 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 w4sor665790ljo.27.2020.03.10.03.40.30 for (Google Transport Security); Tue, 10 Mar 2020 03:40:30 -0700 (PDT) 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=XmPV7pmf; 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=VOmLbFg4f7m0VWnyO1xDaH/AZNMu+kPMNjgBVvsbMM4=; b=XmPV7pmfeVwv3eR7FYLArkOxNj27Kv2v7Sx7iRQrmZdzWxfxlm1/2+6ROU4I24Rih4 sfMG2dff10ReM0skBVyIR8ywsuBgmcvdt12e2ZCTI4Qo81wWI1tCCP6jUdZkGjLPQ50P C2QGEB9K3G/dqaRMfDNWxuHMFPrymb3R5agvF0Agm+VQuOdUfUNHoEj/9ksEQ9gUlLxo gzqwva0Zs4/SDsB2Rmj4itCDw/94E8QchLWRxf8WuPigcg2aybGDW82RNXqaWGSTHjDk n8qThSPy6zFIN95KirHptSJJ8TZgWB1sm61UPdbxfwz5KxBBZLhuMi4nL8GQ5ebHturv M2nQ== 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=VOmLbFg4f7m0VWnyO1xDaH/AZNMu+kPMNjgBVvsbMM4=; b=IBjylpZxFtSJKv05AWo1k6H3vaNf5E56CbYbkDyGKhzZafIPhhxTbqCKrwnHdsvDBw 5WO28yRt9nEmLfMfgcAjqm7RoxQ5m+219qnW86cnnuLM1FeLOe3N5TxzWIkibbWYs/WH 9GbnFhP5nioWvZpKxkj1Qpe9HmMsQORC3dreCODpN+ZrIJxIfF6AVNBhGFjNII6EnRIg ukzEI5EpWtGWniT5tb7xNHpejgkTvEBNjJgMO+Z8B7n0cEOGWymCtChQaJtMGqPS73U3 RlOtCaJc/3wYNE3bT9Tm4KdXEW0SRgqWu0/1mMFmO4M9ovuPaSn25j6vTRpTgSCA49dJ 0Rjw== X-Gm-Message-State: ANhLgQ0syoPHvtptKCxP5/kpTNaDlj77h36Hy9sEmiz1p2F45TN3zmGK uh/UH1A0imTNkX2eKl4O6s5vIqXzRrp7nQ== X-Google-Smtp-Source: ADFU+vt0BFBJbAznVQSE1PNl5MnrDZymFS2judAVRaRDmr4mbgXWDTWu7QcpSCh+5klHcSq6m8dkfw== X-Received: by 2002:a2e:8654:: with SMTP id i20mr12334652ljj.248.1583836829816; Tue, 10 Mar 2020 03:40:29 -0700 (PDT) Return-Path: Received: from uffe-XPS13.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id j6sm3414632lfb.13.2020.03.10.03.40.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2020 03:40:28 -0700 (PDT) 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 v3 1/2] PM / Domains: Allow no domain-idle-states DT property in genpd when parsing Date: Tue, 10 Mar 2020 11:40:23 +0100 Message-Id: <20200310104023.4018-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <0002-cpuidle-psci-Split-psci_dt_cpu_init_idle.patch> References: <0002-cpuidle-psci-Split-psci_dt_cpu_init_idle.patch> 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: Reviewed-by: Sudeep Holla Signed-off-by: Ulf Hansson --- Changes in v3: - Resending with reviewed-tags added. --- 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) {