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: 12988614 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 8C4FEC6FA83 for ; Mon, 26 Sep 2022 11:02:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) id 49C6AC433B5; Mon, 26 Sep 2022 11:02:54 +0000 (UTC) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 54A97C433C1 for ; Mon, 26 Sep 2022 11:02:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.kernel.org 54A97C433C1 Authentication-Results: smtp.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f52.google.com with SMTP id s6so10218360lfo.7 for ; Mon, 26 Sep 2022 04:02:53 -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=RKaxUTCBkdD/t56XEYPgJ50ORM8oeDFqbJAYYw8NWUIb9cZjAajxOPu50kKx+8tayQ bnqotRn0GMTQF5ettS5P05/RZRFuv1S5+I8mnN3wW+8mmUYamxa2VR+SYn4Lpm/Mseai 6/j3EoPBUFIBF3a1ephImH3Vbw/lJpSVTeBxL8f+XDVSL0BcC4P+/qFvaSSVuq0G9lJr 5mXxKYhKE4toaxgN9wtJQ57fmylCw6cZ0mwVp7J8XAHexmhHN2F9faFodthHjkTtfG0W VcMLwj/xo51z3KirJ+/9MiPU0eRXbyw8afkdIqwFv0lybjRp9jftnhxUBV2fK+M1U9NQ X/cg== X-Gm-Message-State: ACrzQf15igglSHP0MkrBLLW00CZwj5iiNJY3nMl91gz9mqNTYqZk4JeI SoPVhxqWtQugfK98iRzTEwNBPg== 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 List-Id: 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 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); }