From patchwork Mon Sep 26 11:02:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12988613 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 43EE7C32771 for ; Mon, 26 Sep 2022 11:04:16 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ILq9XeA1G7aMm1eUCLdz2TySGg4rLRcXV9oaPT0LJcg=; b=zm2QVzKFiakDrq cmFYz7ZXSequMTnxuOMr8ihtX4VzBJyoN5kNEGIMR7GW4ai+KbVtVg2zYF98mDfw63mst9Py34ni4 91AETcv7y2FLKSJlubxI5+uoxuqZ3Njsh9HGLXOncRy0V2L5WRY/Tpe+S1gtb25Jiw819b0zfUWJj 5pFVXimQBMnYGbPGNXg7qWb1VJhxQiJk99U4SUGARiryM11r9aTU9wIIjnc84UCOXwPafc3XS2aZI s+uByCP8SQcM4ZA8feJ1hP69iqGIBC02Q2PJ4+gA3+723MZqqr1EblNa14fcyZX6npu23tab8W1T+ NOe1T5So81hyPhq6DDmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oclt4-004Qjs-N0; Mon, 26 Sep 2022 11:02:58 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oclt0-004Qfm-M9 for linux-arm-kernel@lists.infradead.org; Mon, 26 Sep 2022 11:02:56 +0000 Received: by mail-lf1-x132.google.com with SMTP id a8so10186653lff.13 for ; Mon, 26 Sep 2022 04:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=SzZdZTQ9yg2AYbF63Q9RIKM+cK8iwb2vn6Xllzfi3yo=; b=BZ4NJ8aK1BgwIAhIVdY8A/zCCyu7QbeE9dWRBMGaIkGg+ELHSmCe4byrX8+PBAYnm7 K5uFMloJ+xJstiZ+k1GYZBhUQPj4v60kjYBBowRJn3q2lmPKcCi8LUdjWrkL83G5MWxu AytppXnTlAO+KUO5lfrr6Ap3OLyxWhN0Q+atmwRJodwXTx5akWYQbqBnS6sH3bQmKBrD Z+AkpzyAwkIdytl7Xf4JlSJzwrwJMSZoPPprlUyzF3jOqDSUpY4URezpp728CRRV0aF2 mfwetJKV23rNE2XQCRNRUYz1WXWAdt7IkLTWhVcxKkgvfv/C/tObii+iT3KWfBQnmo2A uY1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=SzZdZTQ9yg2AYbF63Q9RIKM+cK8iwb2vn6Xllzfi3yo=; b=Hm6bPdY6ATr/VAtUB6/iq9AkI7pNqYcrVAFi8YWvXccJ2oIJ8KOP8mkkbXcDI7uBU7 ekEOarnwHwt6kIywbMa0wW7ha2zGgX7r3ugjeszGQRmNdaAq2gZMgMK3eFkGvxPD7HHe 9U8CkWUVvS2o7m37tpGtwWu6rQEAtKo636YnHFduigDWk5JNUOjNUk7lgnLFhJvtidnB YGPIRQ6FoWZtqfX3jl9O2vr3l5X+BqVxhZAJcGCgMVgrqNB11/A58IyzhZfjBjiNFT58 +lA+R5jCPXcAEhevhyE52eUWoCqZcjYhJvcgjGmOOVcyp59nmUlT0Yw/S+iBh6hW0twB ugRw== X-Gm-Message-State: ACrzQf1dD51JKjwfkact1xD3Mld7l5wCKMcJl3KaJ8o+VRlbW0BQuyLO MVzZlRn+TZFlskNmUXscnU5IJw== X-Google-Smtp-Source: AMsMyM5W3WeYQ1XboE++c1vd8Cjn+/5cGjGtRWycEk85pI6L0lEjCrPisCtUyVfjBs9CX+6uOkYJqg== X-Received: by 2002:ac2:4e16:0:b0:49a:d15c:c3e1 with SMTP id e22-20020ac24e16000000b0049ad15cc3e1mr9154341lfr.648.1664190171290; Mon, 26 Sep 2022 04:02:51 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id 1-20020ac25f01000000b0049f5358062dsm2497955lfq.98.2022.09.26.04.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 04:02:50 -0700 (PDT) From: Dmitry Baryshkov To: Mark Rutland , Lorenzo Pieralisi , Ulf Hansson , "Rafael J. Wysocki" , Daniel Lezcano Cc: linux-arm-kernel@lists.infradead.org, soc@kernel.org, linux-pm@vger.kernel.org, Sudeep Holla Subject: [RESEND PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Date: Mon, 26 Sep 2022 14:02:49 +0300 Message-Id: <20220926110249.666813-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220926_040254_786990_C796CD36 X-CRM114-Status: GOOD ( 12.22 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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); }