Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2124596rwl; Thu, 30 Mar 2023 06:24:07 -0700 (PDT) X-Google-Smtp-Source: AKy350bvNBSKoTFCXkErMMmFoZen9BLAe4C3iIMz/+8UJVxLgnwUHIc2b92XkvCX+u7OkmL8oMQF X-Received: by 2002:a05:6402:34c6:b0:502:92d:4f50 with SMTP id w6-20020a05640234c600b00502092d4f50mr3137041edc.1.1680182647163; Thu, 30 Mar 2023 06:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680182647; cv=none; d=google.com; s=arc-20160816; b=ThpkBs6DaOmn6II4BeiqxTrUpECUWezoRgksfmuXmzBAhoWvWzbHCLXPM5vD91Pqm3 gPvaQW4ecoeVnu7gSA8VFDJWFBHiV+jXYVBOvs3mYPeXyexTPyJy754dGnijWpO4jkgR 9+8fXX8xxeNrUxrFVjiXXd/LzC/hky6Rcw097HmUi+s5gfAt0bKjKAraUW2GsgAh1/FJ DD2Q5dS5GI91OW7eGE4o10M0dp4bw026K2aDkywZHWTAezHYzuAqc8esWocLaiqJIBuF 4t4IXirAuOCCfcEGBeJkv3cw9hDu+MdMzVvBsWuY+GuHZvTdea4qb2ntVMDxU6ybHpwF 5jTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=YLD1mqxjlsbVQvLMsk0VeA0r3aDfHDGyWPnD13JZ0oA=; b=yF2LYeutsXXxffFwLvII+4nV1t0dmQpLFkl87So+HULuqNUQbsvshpNUf5sOFXubfO OXKyGQwSk192j5EtTX2L+vW6jLwLOyFZVtYx9HFH9H7yKhDrvDHa72zAwEz0Yr3i6KVQ GvRhgwhqDWt35HZN4JLmVV3SpyfIhG5JBJIUrQB2zItx4sx8pkOgPSz35piXNaheZ6oV aGXzNyDBm4NKREEGVjrE4i9d3Fxozt0tfyXSwGjGkJvHMZLLpnsH8dBRgFo/LmjEgINF rB8O/P9Etcb1dhQbM3ji171zRvRHw3V559lUXU0EV+JvHVGiYCn+G7e+O2pMTbvmC50m aqcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m16-20020a50ef10000000b00501daae80cfsi23474919eds.546.2023.03.30.06.23.41; Thu, 30 Mar 2023 06:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231937AbjC3NNo (ORCPT + 99 others); Thu, 30 Mar 2023 09:13:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231932AbjC3NNm (ORCPT ); Thu, 30 Mar 2023 09:13:42 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B74AC9760; Thu, 30 Mar 2023 06:13:38 -0700 (PDT) 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 CEA882F4; Thu, 30 Mar 2023 06:14:22 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F0FE33F663; Thu, 30 Mar 2023 06:13:36 -0700 (PDT) Date: Thu, 30 Mar 2023 14:13:34 +0100 From: Sudeep Holla To: Ulf Hansson Cc: Maulik Shah , andersson@kernel.org, dianders@chromium.org, swboyd@chromium.org, wingers@google.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, jwerner@chromium.org, quic_lsrao@quicinc.com, quic_rjendra@quicinc.com Subject: Re: [PATCH v2 1/2] cpuidle: psci: Move enabling OSI mode after power domains creation Message-ID: <20230330131334.idb25zf4tdf3zqn3@bogus> References: <20230330084250.32600-1-quic_mkshah@quicinc.com> <20230330084250.32600-2-quic_mkshah@quicinc.com> <20230330093431.xn5wwiwqbne5owf7@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 30, 2023 at 02:06:19PM +0200, Ulf Hansson wrote: > On Thu, 30 Mar 2023 at 11:34, Sudeep Holla wrote: > > > > On Thu, Mar 30, 2023 at 02:12:49PM +0530, Maulik Shah wrote: > > > A switch from OSI to PC mode is only possible if all CPUs other than the > > > calling one are OFF, either through a call to CPU_OFF or not yet booted. > > > > > > > As per the spec, all cores are in one of the following states: > > - Running > > - OFF, either through a call to CPU_OFF or not yet booted > > - Suspended, through a call to CPU_DEFAULT_SUSPEND > > > > Better to provide full information. > > > > > Currently OSI mode is enabled before power domains are created. In cases > > > where CPUidle states are not using hierarchical CPU topology the bail out > > > path tries to switch back to PC mode which gets denied by firmware since > > > other CPUs are online at this point and creates inconsistent state as > > > firmware is in OSI mode and Linux in PC mode. > > > > > > > OK what is the issue if the other cores are online ? As long as they are > > running, it is allowed in the spec, so your statement is incorrect. > > > > Is CPUidle enabled before setting the OSI mode. I see only that can cause > > issue as we don't use CPU_DEFAULT_SUSPEND. If idle is not yet enabled, it > > shouldn't be a problem. > > Sudeep, you may very well be correct here. Nevertheless, it looks like > the current public TF-A implementation doesn't work exactly like this, > as it reports an error in Maulik's case. We should fix it too, I > think. > > Although, to me it doesn't really matter as I think $subject patch > makes sense anyway. It's always nice to simplify code when it's > possible. > Agreed, I don't have any objection to the change. The wording the message worried me and wanted to check if there are any other issues because of this. As such it doesn't look like there are but the commit message needs to be updated as it gives a different impression/understanding. -- Regards, Sudeep