From patchwork Thu Feb 27 12:45:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 183947 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4469069ile; Thu, 27 Feb 2020 04:46:20 -0800 (PST) X-Received: by 2002:a19:c1cd:: with SMTP id r196mr2116284lff.22.1582807580660; Thu, 27 Feb 2020 04:46:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582807580; cv=none; d=google.com; s=arc-20160816; b=Zrf5R2ANbWG4eHlkZHSboIwx/lfuWx5l3eUr5FDgOS1owkL3W08ivJ8vKjLIeuaq/+ 3n+BqZ5+1In5E5PpmUzU8gJRvz5q2l/O2ZLi8GbgaFrfrpDn+RoW/1EJfqsYz+H94Lz2 w+ZBWz42l94cKGnp3hOmLgttGM7RFuKnYlRdRf/IfPzDctg/2YNKtAYMhBuoyto+ec8P Ux9vVp7q9oIwvZpQfJ80EjvcxxUvyw4NpRSH65T5XLhZu96bzVRu3yC/4xq714pAQ5N6 vvo6KmRE2zH+rKj89EiGSwhb0plsAOxjd7oB8wt9S2oZdacNsFo7dbfjTctiMWoKMtZU vb7w== 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=o9TWd5ueZItAaXrUD5CMf1mP/m6lwebrmOpd+zVUTNc2alZON6SJ5sYncksdr+f0Kn FSv7x+4jpnIThiihtJm40OhixjoX3KgK/JR2zi/Iaqxzsxi/Dhd1RbuxKltrXhQOIE1p HvOwfRdp9rMRdifvEb8oJyY3N6n96IJkprF/nvNoa+HMoiohWEzmGnILJu2CQu6qlP6u tfQvfbq4lzM5RV8O2W2Xotz1DzJcnkGZ3865X3rkpMhAeeBuPl+OZUt5l5A0yzzMCEY+ bPUv5YobULH/p21nShL+yqfVR7FBdKPmJMYFAbghvBYnVrp1nxa+SginZRiLVOKOJxAM Tvqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zJlxUbiY; 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 o28sor761009lfg.2.2020.02.27.04.46.19 for (Google Transport Security); Thu, 27 Feb 2020 04:46: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=zJlxUbiY; 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=zJlxUbiYhFoF+ODVDIvKjAu386tBZM5zdC9FOjCrrAN13EelHbSprIimZNdA9DUoAV HkDCSE3OSDzA5dNryQ2b9btHIUkJRTlRng1zEMwkc+XwCHscftdZISwd1pqrl+BwtHqv GlD8ZaB9R1oX1MDCPKIlITtO4YG6dJh7RZZAOXumSZkEOwCp3JhVK/bpllsEEQrzn8k2 o/gU2N6cqqB7dbSwPiqnkijOTNTasogux6I/C8ZWBKKFy9gM8lmYh4TTcTBQQJ/CxsrM XWv6ndjECgFxLLJ/1x/6NU6gCzaV5JEcxLS17mV1i0dmQtSDVdQQ9/QeAcybUpkrhOLN /DaA== 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=OaUvePD360LHylkYniO6BTsnSwmYUy6ChE97siy941f2Ui8Aky9nmiXrPT7o+76eF+ L0OiP90mIqaIqnB+bI+ujAoVsys3ISdi4x/coG4vFTsltAz+PykLF6ahasQTcv/bfWD2 /GiriccNe7mFzW3Mt4nyzi9btYi609t4P+jVSNELOJXEmA9svbhGdk+laDeFA2RfrBs7 UaiQYcLEhLC0HHOQPESwHHArP8nthPa5/w0aYRaWmvc+C+hPKPxyC3V5jTDTbvBWaGsl WQxSe++r/gMgkPVB3jT3/0aTJuqFgIwMIKzZrGDFddHCDlgtoBQK+t+7Z3QhiujMM2g8 Vz4w== X-Gm-Message-State: ANhLgQ16qtigcQanZljM9E7aOn/1eufSHX3MlukZY3zOStS3F7mio5hf Pyk94exbath14LoSOMe1H3kY6+0N X-Google-Smtp-Source: ADFU+vu8QOXDccJ4lKeIOMwWimtNYjnsyBTcgqPyMEimE4UADfTmMgToy/05O3pHPo7qI+ThXa9XeA== X-Received: by 2002:ac2:4a66:: with SMTP id q6mr2085068lfp.16.1582807579162; Thu, 27 Feb 2020 04:46: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 l16sm2669334lfh.74.2020.02.27.04.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 04:46:17 -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 2/4] cpuidle: psci: Fixup support for domain idle states being zero Date: Thu, 27 Feb 2020 13:45:49 +0100 Message-Id: <20200227124551.31860-3-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 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);