Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1393009ybz; Thu, 16 Apr 2020 08:23:17 -0700 (PDT) X-Google-Smtp-Source: APiQypLS82AmahwhjXx7w63id4+MDUXJkQHW41m63SzhdrmWQdyZwpD2CqMOxouzA+RAzcTrScUa X-Received: by 2002:a50:d718:: with SMTP id t24mr28660944edi.171.1587050597563; Thu, 16 Apr 2020 08:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587050597; cv=none; d=google.com; s=arc-20160816; b=OHFLGh/6L/L5vg90WYzaT2SoloHNc7b/FZWftGK0uyxzqRXUArwqLh4rr7l+JlUOMQ Gvr3WrT4EI9wmiN6DVizNtfzEFPi24NY32RvLmvG9J+4wV1kAspnknaecOs1fAa8DYrC nhmUhBTsUVOjz262j9mEMKpNjabQBPYmo0vZ1nFTXHopOyxO3oAfj72/fltbvvWIUv5i SndBquXLWqgNWuhFesHVHVcZI2M1oH2s9UALFEp/61cebsIXFC3lIVrcBrdcQE10poTY 2Fk1pv1E9LPDrSxlKPm8IfNAjQDhpEcqU21rYjzDJlVoDgCMgh/z6l9K4VdRC7bl6LtB I1zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AsHpk+7yx3G7ovu/KrTHvsbgwgbNfSycBcl0Q+sXFAY=; b=0IPSO6r5BH4AEVmq4UhwSwCq8fGz9DTzCDiV2qDqTOK8jec+E5fjtsAZfls0/KGovO 1SclrJ6+Y/hY+P/IO2156sprEWMXjeKYZqBczRnbQZd3/dle7RAOYwaMIMPWc24TnnKc rgCwbOhVRRT0eCABedSyiNJXgNyqolLQgG0Z7QkOZdI6Q9Q2MOnRve7TJJrQEVCuGvtu +2Re/M1A1+/VFr9jlxPuo17x03eR5b2SXBEeQ/03M+jt3/iMlhqdji2nM3LIFVzciMDu aPq4WR8w3a7IB0J5ePD3yNxA9gHylkrCpujABJeEbLuVJAbjBTs73bnuUcpiH0QQyK3x +qBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yU6WRZ6F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si4693441edk.298.2020.04.16.08.22.54; Thu, 16 Apr 2020 08:23:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yU6WRZ6F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633265AbgDPPVA (ORCPT + 99 others); Thu, 16 Apr 2020 11:21:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:33100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2898643AbgDPNrH (ORCPT ); Thu, 16 Apr 2020 09:47:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9024A21744; Thu, 16 Apr 2020 13:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587044826; bh=57XLkEo9IUFW0ke8/XfWMYUe3XW5lyxCAG3v48t6+k8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yU6WRZ6FKZCVPhAb4QdaAlsZ7J+3hfL2dNChN8UEoiP7gsrz8t0JnlyyAHo67D6m1 pX5SK+q6k764oCkWKnBiZTELGbsaLYxF470gQEdDUMBen61ZqYHHSjXs2zWUnC0kJH 7clYV/JoKrp3p90shJ7ui7vGW2YowISF9Ruo3lUg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Gaignard , Sudeep Holla , Ulf Hansson , "Rafael J. Wysocki" Subject: [PATCH 5.4 116/232] PM / Domains: Allow no domain-idle-states DT property in genpd when parsing Date: Thu, 16 Apr 2020 15:23:30 +0200 Message-Id: <20200416131329.628923588@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200416131316.640996080@linuxfoundation.org> References: <20200416131316.640996080@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ulf Hansson commit 56cb26891ea4180121265dc6b596015772c4a4b8 upstream. 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. Fixes: 2c361684803e ("PM / Domains: Don't treat zero found compatible idle states as an error") Reported-by: Benjamin Gaignard Cc: 4.20+ # 4.20+ Reviewed-by: Sudeep Holla Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/base/power/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2615,7 +2615,7 @@ static int genpd_iterate_idle_states(str 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) {