From patchwork Thu Aug 4 13:07:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12936359 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 49084C19F2A for ; Thu, 4 Aug 2022 13:09:14 +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=e/UafcTLBo6cT0kY6AOli51EVeG9Zfz7u/SGh51SuA4=; b=Y0fDIQaEIJSmjV KZRCkcvZMNmUa3Gs7HNXKd3xB2gcmr63k/ETFG9J7U0PKpXp8Crs0nYTLzXy7lJsl6chb0YgP1zs1 OlLxG6lfKhso00F+Vjn9IUfRHDa6yWbjkHyTRudNiIiqPLGvgyyjXEm7pDA37x5P1WSq63h1pbfb6 NATcM7dZHv9RjxYBgk4byUYMkITzx2dRO96XJY8UcMNXhEf/0KMMsouInax+O9WAknY06qjt/Hmip fu8HkxGsjVQdyUTLeAiCnkWat5Ul/fDe9rpsrM6TOn7bBdQY26tG/4IdjtGYDKZVmf9Db0oGCrI1k ZNphz0XsKABf2qxaO3Sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJaa3-0069lW-28; Thu, 04 Aug 2022 13:08:03 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJaZw-0069h1-BD for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2022 13:08:00 +0000 Received: by mail-lj1-x234.google.com with SMTP id r14so22116416ljp.2 for ; Thu, 04 Aug 2022 06:07: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; bh=2mPVyeBFtaU3RdKAsQho6cTa5+HorQ2Exu3btIiOUzk=; b=HmvDXaTStmNuX98PFb429ubH/UBs4kLSFIFuBj8o7ihM5eWHZj1Wzke9jRa5+sSWSO ohjRd2oFwKCQGNrORfIoLK9v1wxT+5tIUex3QZokknCXn3hAJ9tYakOCAi7DFPRi87ZW wrUlHjNyySKG9BIyzCzFkx6HDpjo9vn28k8MHNkRlL6jqrh6IFckUw8CpMoUtJWorL88 qxX5DqKldk0EZkhaUhVZYgRG9oUEvn9420nNSDTkS0tsDHAfzinAvXH+UCeeMI4aw8kk GB5t1Q1Sb7Wu9QQQYeoFyUYivOkdad8UyZVb6PEy65Oswwhr5xxG5Q/R4Bmg9pHAyxD+ 6RZQ== 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; bh=2mPVyeBFtaU3RdKAsQho6cTa5+HorQ2Exu3btIiOUzk=; b=mRuR6AtSHZIC1NKlpVMxIe2faaFA7VgVy9zIlIfPXdG4NfSYahhQuBPvHR2Gh4G6hx 0erUrc0keV5Muk2WPsHB8g2d7gZCe4m0y/lk0hCwxF0CYk7qRJTUZob7XSmf3h5JJLV0 WtY0NmrmpsKbfZE/aqpwOHXCc0pXkJYqsNwXaOYJjHZ9S64TOdUPcTjHzll258Kh/2Bx +/+SjKP+NcH1uozZMnP9TAyLkbLAfkgSqC8Bx8dlrzWA40otxyMYTTBG4D6NpwNFGVtj jl+Rthl6RtYHpUf/7eq3Op0qNcjxt3ImlURZAvYrZPUhUa/lh5GELdJiI1by0dG0vDdi pB6A== X-Gm-Message-State: ACgBeo1toadBYC84bpCMNbfWPvrKSqBW2XU4sRuAMnJGblC6gEGINH7E 7Mljzcz5xEofCYAJj3cOBZyqwQ== X-Google-Smtp-Source: AA6agR4P3wAFSoGlT84eB+C6qr4BOR//C22QuoriJle9qYybcIXddWfc6ZqOhEJZc5bOFU9JechAYQ== X-Received: by 2002:a2e:82c5:0:b0:25d:83d8:41b with SMTP id n5-20020a2e82c5000000b0025d83d8041bmr548955ljh.140.1659618472301; Thu, 04 Aug 2022 06:07:52 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id o20-20020a2e9b54000000b0025e2c5a12b6sm115743ljj.129.2022.08.04.06.07.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 06:07:51 -0700 (PDT) From: Dmitry Baryshkov To: Ulf Hansson , "Rafael J. Wysocki" , Daniel Lezcano , Mark Rutland , Lorenzo Pieralisi Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v2] firmware/psci: Print a warning if PSCI doesn't accept PC mode Date: Thu, 4 Aug 2022 16:07:50 +0300 Message-Id: <20220804130750.3706897-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-20220804_060756_480930_45643A13 X-CRM114-Status: GOOD ( 12.27 ) 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. Signed-off-by: Dmitry Baryshkov Reviewed-by: Ulf Hansson Acked-by: Mark Rutland Reviewed-by: Sudeep Holla --- This is a replacement for [1], now moving the warning from psci_set_osi_mode() callers to the function iself. 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 cfb448eabdaa..1628f1edef4a 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -163,6 +163,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); }