From patchwork Tue Mar 3 20:35:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 184150 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4079638ile; Tue, 3 Mar 2020 12:36:19 -0800 (PST) X-Received: by 2002:ac2:42d9:: with SMTP id n25mr3762750lfl.97.1583267779420; Tue, 03 Mar 2020 12:36:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583267779; cv=none; d=google.com; s=arc-20160816; b=zw7L3T+i03/OPFXV+3ahqWg3ERSWd3TwHyonRPMtj5jpuDBgv1BT8vDKeE/YoDFTNs kFNjkA7I9plpQcFlBCFsVsVPmJdEnXryeGYwsc5sTUbRd61ri2OtwJG0Z7kV+Nw/nNeI S3A/dAwUQmSsleOHvhJfAhwo1KlevOHUvZfMVVNKOD2TMrCWRntryvSLepPvDThE3qcZ M91TPmpIUbBu0l6lC38u9gr8L8al0SgnBtL+Lbe/g53NYfrmG1SQNF9D7CSXTrpIQBB2 dUh8j76OGcDMluO/96jRHgG6iIR3YrNTuDfEiy5wd9QKWBA4JdO+9xvcp4r5STaMMsjW NbTg== 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=F8z5cL0Twxt+e94tdjDpPgRKhh67KE/KfT7fNG7VtIz3h/9uAkHC7+tVeYWsRst6mC qYYDPUjM8aUJ4OwTSP/2r2oab0ruFMFVyEkAauNnSMIea9olRHFGbCgPIlNsfzNdnd9M Age8+YHxLCiEArvWLWcSr0pNusgZi1XhW73F4pA5wbwnOK+02iawX+N7NcNz0UPOJqlp cqycyVd+W/LHlyDKmgO+S/pWnsGeKIhFIqlIDkms40hVKzpoe6WTyGOwWMCx70jJj6Kt HoS0NMixtOwcWtmMgm4qcO7HTuJuBSnsJ+csvnCbtc/OOqLTSwKZBZN2OV3IELoaRz7r nVUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M6nT4o+P; 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 y2sor9946181ljc.10.2020.03.03.12.36.19 for (Google Transport Security); Tue, 03 Mar 2020 12:36:19 -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=M6nT4o+P; 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=M6nT4o+PaOt0lluB6TctZ125cHNRlgBI/C3zswdbS6bE4Vor6LpM3xul+GzDk3LYMc qw+N/dL5nSOCxpgekkdUlti+upKi21MCbPGU/bH9dA31iwdJrjuUmx50lvX4KtVd47p/ lGSRoDHKlev29S/7Vs+Z/wjbkDTdKZJ3qP6cAKGHBQ4J3m5MJ3pL5+jtoffHYIz8rb/D LyJGPV8uyzka1C/i7OsLZ1YfXnjmIl1B6XuEbzK8VLlbznNOGVRIOhySviyL9ZP5yMhT CFX4hcgpE/r3MtTYFG9uc6R3sKXfs0gMaoa5+35Hr17dAW1rceC8NKY5fQ9zkfbSVx2u Md3w== 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=EF0zux5QZuIIHNvBKSN//CD/7t6UVkoOMDHT0x66jO+/OTBSmH7v2pJc8wytYepQ6R /ivC19TEqAXfXJHiGsNvbEVXW6KAxYNoNBA4F5KC7egjpVpsGErHuR+yPN1sySKMDOmO ijFE5lOZEQHY5z53mm0rDiLdzVSCCsQjt6RN7qJAs2IPd1grij9ewmOeFooctzq1uHS9 S+Mutq23q3bi/y0BZtRGA5k4xuF/chNmuKemMR8MvC6IxZi0QrrZzt8vyLimbEzZ+FAu lyebPjP1zACglx0SikPGbt/qjs65ZEE4yjk2JnBwTM1DaLREjpzt6uYNWK51mX9Uolbh I9fA== X-Gm-Message-State: ANhLgQ1+4LTzQsR24ffcRygSPXFCugaueO/hyUhiELXB1j3iiQSLeIlY +BvKMOeJxBT0Ur3upfWfdpz561IE X-Google-Smtp-Source: ADFU+vtxH5Gk3A2TqaasCf1CsCDxKPfx3AYiuDLFIZjyb++K4u0hf79plZcWKxwzcA4xfdBGagw2Yg== X-Received: by 2002:a2e:b442:: with SMTP id o2mr3427232ljm.261.1583267779037; Tue, 03 Mar 2020 12:36:19 -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 t195sm1339532lff.0.2020.03.03.12.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2020 12:36:18 -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 v2 1/4] PM / Domains: Allow no domain-idle-states DT property in genpd when parsing Date: Tue, 3 Mar 2020 21:35:56 +0100 Message-Id: <20200303203559.23995-2-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200303203559.23995-1-ulf.hansson@linaro.org> References: <20200303203559.23995-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) {