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 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4C8B6C43217 for ; Wed, 19 Oct 2022 14:14:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) id 01F4DC433B5; Wed, 19 Oct 2022 14:14:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D85F0C433C1; Wed, 19 Oct 2022 14:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666188856; bh=/6HxliF+O90I74ybFJn/y4dqB2sGJTLvlhB20rV8hUg=; h=Date:From:To:List-Id:Cc:Subject:References:In-Reply-To:From; b=gmx/8MoVdje7U94zG8PcHLFNeZt3k0ywIZhFlKOqIgb9H10XfJXFNEiRjZZurlRrx N+V+uHpZv+HeQl3MMZmO21CCUChNDOKKmLCvRCo3W9dl2kie+5cPBO8xOXo9tA3WYM FLplIflSfm362Qp5AkOfnrrUrkz0qS7Gw7Q9yZQHo7ZHrdgUcSOQ8hBYNNKlTVC3VK qsktyGP4DIjidBRsH/tRf1ZfIC+IHNMcBXWPq2b7gNogF3bbOl5E3mqzJzL/XS7iWT rGHb9We7PUtFSTH6SWxOulvhDnS9nUZLHf3rx+wYBlJYg/7dn/PaGYre2Fb60aLXjO adVG/rSVIu2nA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ol9pc-0002qm-7Z; Wed, 19 Oct 2022 16:14:04 +0200 Date: Wed, 19 Oct 2022 16:14:04 +0200 From: Johan Hovold To: Dmitry Baryshkov , Sudeep Holla , Arnd Bergmann List-Id: Cc: Mark Rutland , Lorenzo Pieralisi , Ulf Hansson , "Rafael J. Wysocki" , Daniel Lezcano , linux-arm-kernel@lists.infradead.org, soc@kernel.org, linux-pm@vger.kernel.org Subject: Re: [RESEND PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Message-ID: References: <20220926110249.666813-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220926110249.666813-1-dmitry.baryshkov@linaro.org> On Mon, Sep 26, 2022 at 02:02:49PM +0300, Dmitry Baryshkov wrote: > The function psci_pd_try_set_osi_mode() will print an error if enabling > OSI mode fails. To ease debugging PSCI issues print corresponding > message if switching to PC mode fails too. > > Acked-by: Mark Rutland > Reviewed-by: Sudeep Holla > Reviewed-by: Ulf Hansson > Signed-off-by: Dmitry Baryshkov > --- > This is a replacement for [1], now moving the warning from > psci_set_osi_mode() callers to the function iself. > > The patch is resent to include soc@kernel.org > > [1] https://lore.kernel.org/all/20220727182034.983727-1-dmitry.baryshkov@linaro.org/ > > --- > drivers/cpuidle/cpuidle-psci-domain.c | 4 +--- > drivers/firmware/psci/psci.c | 2 ++ > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c > index 3db4fca1172b..821984947ed9 100644 > --- a/drivers/cpuidle/cpuidle-psci-domain.c > +++ b/drivers/cpuidle/cpuidle-psci-domain.c > @@ -124,10 +124,8 @@ static bool psci_pd_try_set_osi_mode(void) > return false; > > ret = psci_set_osi_mode(true); > - if (ret) { > - pr_warn("failed to enable OSI mode: %d\n", ret); > + if (ret) > return false; > - } > > return true; > } > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c > index 9fdcb6bff403..42cae0ba10e2 100644 > --- a/drivers/firmware/psci/psci.c > +++ b/drivers/firmware/psci/psci.c > @@ -164,6 +164,8 @@ int psci_set_osi_mode(bool enable) > PSCI_1_0_SUSPEND_MODE_PC; > > err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0); > + if (err < 0) > + pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err); > return psci_to_linux_errno(err); > } When booting 6.1-rc1 I now see: [ 0.000000] psci: OSI mode supported. [ 0.000000] psci: failed to set PC mode: -3 on every boot with sc8280xp, while later enabling OSI mode still works: [ 0.227358] CPUidle PSCI: psci_pd_try_set_osi_mode - success [ 0.227599] CPUidle PSCI: Initialized CPU PM domain topology Judging from Sudeep's comment on v1: The platform must boot in PC mode, so even if it fails we ignore so not sure if the logging is of much help here IMO. perhaps logging this as an error is not a good idea? Johan 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0F40C4332F for ; Wed, 19 Oct 2022 14:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J5calMbts3rEuSKqKL3B6ifvQ6kdc2Dl1IDCOWr8ASY=; b=HsvJ+zKYAg/syz 3eUgJl2hWLXa3yehsqKujHPXbVx3JqzHUv+nFOLYFCY4o/cmNoKlPJmwIMr/A44Zjg4U2TiMDFGWd wV0foLY5XT63EJ8GTDp8MNlGa0t0oiHaD8gkFcbe9Nf2EgPjlXfeGPb7jyGLxcZyv46mo04D+D4YF 6sEbaFVb1Ainperb0e1jgcH7j8qu0m3sUUY7pz4ah9IbfmBTOBblGf3+G+thYVhoY+GAmccT2YaKF CIqQP2gBwRndrImOLYaTpA8wx+BlvkocnBdoJDBXbV+HAPDIR5EvCvkWliHy/WpR2zG8+Gd8iiLg4 vmyJE+UN3SI7rhbNZMtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol9py-002dSW-Cn; Wed, 19 Oct 2022 14:14:26 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ol9pv-002d8X-EO for linux-arm-kernel@lists.infradead.org; Wed, 19 Oct 2022 14:14:25 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7E570618F3; Wed, 19 Oct 2022 14:14:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D85F0C433C1; Wed, 19 Oct 2022 14:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666188856; bh=/6HxliF+O90I74ybFJn/y4dqB2sGJTLvlhB20rV8hUg=; h=Date:From:To:List-Id:Cc:Subject:References:In-Reply-To:From; b=gmx/8MoVdje7U94zG8PcHLFNeZt3k0ywIZhFlKOqIgb9H10XfJXFNEiRjZZurlRrx N+V+uHpZv+HeQl3MMZmO21CCUChNDOKKmLCvRCo3W9dl2kie+5cPBO8xOXo9tA3WYM FLplIflSfm362Qp5AkOfnrrUrkz0qS7Gw7Q9yZQHo7ZHrdgUcSOQ8hBYNNKlTVC3VK qsktyGP4DIjidBRsH/tRf1ZfIC+IHNMcBXWPq2b7gNogF3bbOl5E3mqzJzL/XS7iWT rGHb9We7PUtFSTH6SWxOulvhDnS9nUZLHf3rx+wYBlJYg/7dn/PaGYre2Fb60aLXjO adVG/rSVIu2nA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ol9pc-0002qm-7Z; Wed, 19 Oct 2022 16:14:04 +0200 Date: Wed, 19 Oct 2022 16:14:04 +0200 From: Johan Hovold To: Dmitry Baryshkov , Sudeep Holla , Arnd Bergmann Cc: Mark Rutland , Lorenzo Pieralisi , Ulf Hansson , "Rafael J. Wysocki" , Daniel Lezcano , linux-arm-kernel@lists.infradead.org, soc@kernel.org, linux-pm@vger.kernel.org Subject: Re: [RESEND PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Message-ID: References: <20220926110249.666813-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220926110249.666813-1-dmitry.baryshkov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221019_071423_577767_187CE0AE X-CRM114-Status: GOOD ( 23.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Sep 26, 2022 at 02:02:49PM +0300, Dmitry Baryshkov wrote: > The function psci_pd_try_set_osi_mode() will print an error if enabling > OSI mode fails. To ease debugging PSCI issues print corresponding > message if switching to PC mode fails too. > > Acked-by: Mark Rutland > Reviewed-by: Sudeep Holla > Reviewed-by: Ulf Hansson > Signed-off-by: Dmitry Baryshkov > --- > This is a replacement for [1], now moving the warning from > psci_set_osi_mode() callers to the function iself. > > The patch is resent to include soc@kernel.org > > [1] https://lore.kernel.org/all/20220727182034.983727-1-dmitry.baryshkov@linaro.org/ > > --- > drivers/cpuidle/cpuidle-psci-domain.c | 4 +--- > drivers/firmware/psci/psci.c | 2 ++ > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c > index 3db4fca1172b..821984947ed9 100644 > --- a/drivers/cpuidle/cpuidle-psci-domain.c > +++ b/drivers/cpuidle/cpuidle-psci-domain.c > @@ -124,10 +124,8 @@ static bool psci_pd_try_set_osi_mode(void) > return false; > > ret = psci_set_osi_mode(true); > - if (ret) { > - pr_warn("failed to enable OSI mode: %d\n", ret); > + if (ret) > return false; > - } > > return true; > } > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c > index 9fdcb6bff403..42cae0ba10e2 100644 > --- a/drivers/firmware/psci/psci.c > +++ b/drivers/firmware/psci/psci.c > @@ -164,6 +164,8 @@ int psci_set_osi_mode(bool enable) > PSCI_1_0_SUSPEND_MODE_PC; > > err = invoke_psci_fn(PSCI_1_0_FN_SET_SUSPEND_MODE, suspend_mode, 0, 0); > + if (err < 0) > + pr_warn("failed to set %s mode: %d\n", enable ? "OSI" : "PC", err); > return psci_to_linux_errno(err); > } When booting 6.1-rc1 I now see: [ 0.000000] psci: OSI mode supported. [ 0.000000] psci: failed to set PC mode: -3 on every boot with sc8280xp, while later enabling OSI mode still works: [ 0.227358] CPUidle PSCI: psci_pd_try_set_osi_mode - success [ 0.227599] CPUidle PSCI: Initialized CPU PM domain topology Judging from Sudeep's comment on v1: The platform must boot in PC mode, so even if it fails we ignore so not sure if the logging is of much help here IMO. perhaps logging this as an error is not a good idea? Johan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel