From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BDFCC47E49 for ; Sun, 27 Oct 2019 02:21:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 508F220867 for ; Sun, 27 Oct 2019 02:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726592AbfJ0CVT (ORCPT ); Sat, 26 Oct 2019 22:21:19 -0400 Received: from foss.arm.com ([217.140.110.172]:53494 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbfJ0CVT (ORCPT ); Sat, 26 Oct 2019 22:21:19 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7A7DE1FB; Sat, 26 Oct 2019 19:21:18 -0700 (PDT) Received: from e107533-lin.cambridge.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9BA263F6C4; Sat, 26 Oct 2019 19:21:13 -0700 (PDT) Date: Sun, 27 Oct 2019 02:20:56 +0000 From: Sudeep Holla To: Ulf Hansson Cc: Lorenzo Pieralisi , Bjorn Andersson , Daniel Lezcano , Lina Iyer , Kevin Hilman , Linux ARM , linux-arm-msm , Linux PM , Mark Rutland , "Rafael J. Wysocki" , Rob Herring , Stephen Boyd , Vincent Guittot Subject: Re: [PATCH] cpuidle: psci: Align psci_power_state count with idle state count Message-ID: <20191027022056.GA18111@e107533-lin.cambridge.arm.com> References: <20191010113937.15962-2-ulf.hansson@linaro.org> <20191024151834.17036-1-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Thu, Oct 24, 2019 at 06:10:09PM +0200, Ulf Hansson wrote: > On Thu, 24 Oct 2019 at 17:18, Sudeep Holla wrote: > > > > Instead of allocating 'n-1' states in psci_power_state to manage 'n' > > idle states which include "ARM WFI" state, it would be simpler to have > > 1:1 mapping between psci_power_state and cpuidle driver states. > > > > ARM WFI state(i.e. idx == 0) is handled specially in the generic macro > > CPU_PM_CPU_IDLE_ENTER_PARAM and hence state[-1] is not possible. However > > for sake of code readability, it is better to have 1:1 mapping and not > > use [idx - 1] to access psci_power_state corresponding to driver cpuidle > > state for idx. > > > > psci_power_state[0] is default initialised to 0 and is never accessed > > while entering WFI state. > > > > Signed-off-by: Sudeep Holla > > Reported-by: Ulf Hansson > Reviewed-by: Ulf Hansson > > > --- > > drivers/cpuidle/cpuidle-psci.c | 8 +++++--- > > 1 file changed, 5 insertions(+), 3 deletions(-) > > > > Hi Ulf, Lorenzo, > > > > Just to avoid confusion, I thought I will just write this patch as I was > > about to make reference to this in my review. > > As discussed with Lorenzo, I said I was going to adopt his review > comments, which means I already have a patch for this locally. > > Nevermind this time, but I would appreciate if this kind of > bikeshedding can been avoided future wise. > That's one of the reason I just wrote the patch as I felt describing it it words was difficult compared to patch :). Sorry if you felt this was bikeshedding. -- Regards, Sudeep