From patchwork Tue Mar 3 20:35:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 184151 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4079656ile; Tue, 3 Mar 2020 12:36:21 -0800 (PST) X-Received: by 2002:a19:840d:: with SMTP id g13mr3912242lfd.162.1583267781008; Tue, 03 Mar 2020 12:36:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583267781; cv=none; d=google.com; s=arc-20160816; b=y0J5etQEerU6i4lKxoHdUWlLJGxqoPrXf+NuSKmJ5gU/FUDeBAanzSRcsszFYvhgye PcGNIffefsW0yrBnerhY/S6ARtOFKubabe9pdR8sn/ae4LjxfZSOh8gGEkd+sRV+LBuO Uk2/Mlk6t6OGDYSS7JVgkD0p6+XWSc699d7b9sBeemneDcT6FQOiydBj0QOHK2uFLVKr w2CqirV/h8/3yDJtuza+ix2laJOjaoDVPn8WP45Kj1VpMjBovwqlPPTWvYK9OjSRROjr gG86MJv/F9viPHfgA+fN1KDaxbHxf6drH1mIpYfLLj7yLO5rorqqRV4xE+rhZVuaXvnA xBMg== 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=NROpLkqIKQsmOxVfnI3TCB5D/se19mcdjX7Jsvn77Ws=; b=kXq0H+SE8meyd9rXwnjsBynfvX74CCM4KIEk8xamThs9dBXSlz6cHziqvJEg496HnK Nj8+kdRlPxUAy5v5luYVO1K58ZqTOzaYr3z+BCzYdMEVHiPRZ3B6PbWw0WR197Hgtq1J Tr1QjjzSirCNZyNJNXujn2Xrcgxudzu7gP9UYDK8KyBk8lZ9jAkQjDetki0dxVjBB+Kj TT0ExMNYaI1m/b4f9/+mJmx8FoNE0XwVTCisc9NmWwenDgSMOPB/7UgGTphAq99clB3a Owxlk+KEJ1/CkBaxSqzTCLNKkuuQsEqxRLuDd1aTpApkdNbIQZu83g7w+qhMl6+T+hSm SUTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z4JKkqN1; 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 t14sor4955403lfk.6.2020.03.03.12.36.20 for (Google Transport Security); Tue, 03 Mar 2020 12:36:20 -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=z4JKkqN1; 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=NROpLkqIKQsmOxVfnI3TCB5D/se19mcdjX7Jsvn77Ws=; b=z4JKkqN1r6xRG/KIVxn8rmsB5O65VLA31nuxkGSm+tnCsAynoEP9joIT0dW5u+frjr JOlrQLtXbkN8siv27mSjBLOMMLUXSCLVlzDVAhvV8sGDQp/BHBd92V79Sh+/wZ5MRY8+ PoSDLHf23NLIt7YzoSkdsbz/WPP1+DRFdvsaU4/KD2Af/0+Pb54gQUARhQmJpGvYIK9n n+eBd8csqq57uOxodmQ5EKSE/Kh3WENqdrUou1a8C2F8Pqd0Zs4b3YORqcuRhHKXVNa0 vaq3aMWT/6JGXo92PgRuKP+rMc9mhcJBgnaMT2OZ+b3mZywsnprdDXo3sqAXZj5zM++Y 9Xrg== 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=NROpLkqIKQsmOxVfnI3TCB5D/se19mcdjX7Jsvn77Ws=; b=rZlQSsqTj/g8C02ACXUCpnOoIfbaMHd3++WPv2/QAcUjZ8Ywb5tdIepToJsV6bIf4F BRoaO6d5kNoKUmM7+XYTTWlfd6QjAeaHvFlFOAgFTREF+QfKKropt6yDp8/HaARYwpBB FRp4UmROVH6b48bQ1d41ZHmso1zNN5DaDkxRddBSMvPIg5nfMlPj7IIuABrbDX950Vai 9XAOWPFQKTgjGYfqSMEO/PIwKOGVrGWUyCGbncNFGPjet4dc7jWRVGsV33YZtQPJ2WSs fjuh3czrQfISLnimY04XmDHBM0rIp177j/mi7uo8k3eV4eeEQ3ZdVWirb6LI6+ymjiWv eU+g== X-Gm-Message-State: ANhLgQ08C2CTasdRk94FrY1uSuk4wI8swzD/Hc5ZjviiN0klSL9ty4mW /DWCd/vA6+H6febTUalN8v96GM92 X-Google-Smtp-Source: ADFU+vvzLeYQbIe0vTeTmA7QTfjZa5SPu8+43nq3kqPmgzCEuIsW2a14EHXf+icCB4h+M6eJ1zgXPg== X-Received: by 2002:ac2:5a05:: with SMTP id q5mr3792740lfn.143.1583267780603; Tue, 03 Mar 2020 12:36:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2020 12:36:19 -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 Subject: [PATCH v2 2/4] cpuidle: psci: Fixup support for domain idle states being zero Date: Tue, 3 Mar 2020 21:35:57 +0100 Message-Id: <20200303203559.23995-3-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 The current code intends to allow a PSCI PM domain to have none domain idle states defined in DT. However, a few minor things needs to be fixed to make this correctly supported, so let's do that. Reported-by: Benjamin Gaignard Fixes: a65a397f2451 ("cpuidle: psci: Add support for PM domains by using genpd") Signed-off-by: Ulf Hansson --- drivers/cpuidle/cpuidle-psci-domain.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c index 423f03bbeb74..c34b12c4069a 100644 --- a/drivers/cpuidle/cpuidle-psci-domain.c +++ b/drivers/cpuidle/cpuidle-psci-domain.c @@ -49,6 +49,9 @@ static int __init psci_pd_parse_state_nodes(struct genpd_power_state *states, int i, ret; u32 psci_state, *psci_state_buf; + if (!states) + return 0; + for (i = 0; i < state_count; i++) { ret = psci_dt_parse_state_node(to_of_node(states[i].fwnode), &psci_state); @@ -96,6 +99,9 @@ static void psci_pd_free_states(struct genpd_power_state *states, { int i; + if (!states) + return; + for (i = 0; i < state_count; i++) kfree(states[i].data); kfree(states);