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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29CE0C61D9D for ; Wed, 25 Jan 2023 07:43:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234937AbjAYHnH (ORCPT ); Wed, 25 Jan 2023 02:43:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbjAYHnF (ORCPT ); Wed, 25 Jan 2023 02:43:05 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B57D5B45E for ; Tue, 24 Jan 2023 23:43:03 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id y1so11626761wru.2 for ; Tue, 24 Jan 2023 23:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=muf/zGy7zrsCMgmkKGOZ9RAmuniRIs8c0Xd0aflWQ38=; b=jNX0/NkH6hZfgYCdnz9BCQYtQPrh32i6DY87qckF8MY2LT1y61b2YHTZr72e/lPDo8 x/2SkxmN8KLA7IbUIFrdMkQmLxzXwu4JBiI0+duaA2eSbnu7LlhiFrzh3YMv5y8ngWft JFqQIpTu+kdEkXqCogFRb+BvOneNBarLE5GooEFBaFyGPPF0G3+6cBS1YZ41Xh2dHP0R oVqlGG/XmJk3ddxP0QpCQkWFkT9v9augtrtUk8Nw3B/AkoUmPotuSFhg5d7IwfuMEmX4 ab6lYheHKcyYctGon6MdCLHhvMceliG0ZiG/LEzHnnZhfpatPe2eJ5tTJ13UqycpzlCT PgIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=muf/zGy7zrsCMgmkKGOZ9RAmuniRIs8c0Xd0aflWQ38=; b=x4i19MGqRRvjfRIUvWB+2Py95KvMdTsTq94EODBP0zqhizUeufBR2dKS1E8FYXY5fR MESO/HHeP2BMjV4QJZ4URvwjnixvTPIYk+PDXC5vOhYlIH9lkEERvwbp/Ul0aBJfZTiG t1rWgyx8gG+yYEypP3BoIMFNWkquQ2zblN5XSfJyF7F/lm9UHR65XUMsMtkguFzKNk3U mHmheLPOr51BHZTXj/mUFx/HILbVmgiLWUvOWnlXiM4h5EMZkUM4hHj1qp9ttqj+JdET lUWeNMFqvfgT+K4/SCdl9SGVQL6hRzT1uny3xPU6nHmGLtox2rJIHSIVKYbhNlWncAMc Y80A== X-Gm-Message-State: AFqh2kp/MBSCDM49Rwh0X5bxWWH6wrqgVAu/myZma9qxXwrzhEpM/BGM /MIDfJkDn+QspWPsdq1COEYO9g== X-Google-Smtp-Source: AMrXdXvKSkwmMo6myk0f8HJh2ddDrbZC58zRqOXu6kIgMq+6CNWDJAqwj9wiFLx7d/lVZnDlpJ7vSg== X-Received: by 2002:adf:f0c1:0:b0:2bc:67d:c018 with SMTP id x1-20020adff0c1000000b002bc067dc018mr28555562wro.48.1674632582224; Tue, 24 Jan 2023 23:43:02 -0800 (PST) Received: from [192.168.1.109] ([178.197.216.144]) by smtp.gmail.com with ESMTPSA id i9-20020a5d5849000000b002bddac15b3dsm3291815wrf.33.2023.01.24.23.43.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Jan 2023 23:43:01 -0800 (PST) Message-ID: Date: Wed, 25 Jan 2023 08:42:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0 Subject: Re: [PATCH v3] cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT Content-Language: en-US To: Sudeep Holla Cc: "Rafael J. Wysocki" , Daniel Lezcano , Lorenzo Pieralisi , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sebastian Andrzej Siewior , Ulf Hansson , Adrien Thierry , Brian Masney , linux-rt-users@vger.kernel.org References: <20230119184228.683892-1-krzysztof.kozlowski@linaro.org> <20230124153411.nwkbjgoqgkua2icm@bogus> From: Krzysztof Kozlowski In-Reply-To: <20230124153411.nwkbjgoqgkua2icm@bogus> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/01/2023 16:34, Sudeep Holla wrote: > On Thu, Jan 19, 2023 at 07:42:28PM +0100, Krzysztof Kozlowski wrote: >> The runtime Power Management of CPU topology is not compatible with >> PREEMPT_RT: >> 1. Core cpuidle path disables IRQs. >> 2. Core cpuidle calls cpuidle-psci. >> 3. cpuidle-psci in __psci_enter_domain_idle_state() calls >> pm_runtime_put_sync_suspend() and pm_runtime_get_sync() which use >> spinlocks (which are sleeping on PREEMPT_RT). >> >> Deep sleep modes are not a priority of Realtime kernels because the >> latencies might become unpredictable. On the other hand the PSCI CPU >> idle power domain is a parent of other devices and power domain >> controllers, thus it cannot be simply skipped (e.g. on Qualcomm SM8250). >> >> Disable the runtime PM calls from cpuidle-psci, which effectively stops >> suspending the cpuidle PSCI domain. This is a trade-off between making >> PREEMPT_RT working and still having a proper power domain hierarchy in >> the system. >> >> Cc: Adrien Thierry >> Cc: Brian Masney >> Cc: linux-rt-users@vger.kernel.org >> Signed-off-by: Krzysztof Kozlowski >> >> --- >> >> Changes since v1: >> 1. Re-work commit msg. >> 2. Add note to Kconfig. >> >> Several other patches were dropped, as this is the only one actually >> needed. It effectively stops PSCI cpuidle power domains from suspending >> thus solving all other issues I experienced. >> --- >> drivers/cpuidle/Kconfig.arm | 3 +++ >> drivers/cpuidle/cpuidle-psci.c | 4 ++-- >> 2 files changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm >> index 747aa537389b..24429b5bfd1c 100644 >> --- a/drivers/cpuidle/Kconfig.arm >> +++ b/drivers/cpuidle/Kconfig.arm >> @@ -24,6 +24,9 @@ config ARM_PSCI_CPUIDLE >> It provides an idle driver that is capable of detecting and >> managing idle states through the PSCI firmware interface. >> >> + The driver is not yet compatible with PREEMPT_RT: no idle states will >> + be entered by CPUs on such kernel. >> + > > Any particular reason for even compiling this file in or allowing the > ARM_PSCI_CPUIDLE when PREEMPT_RT=y ? If we can't enter idle states, we > can as well compile this file out ? It's the power domain sued for other devices, so we need it. Otherwise other devices will keep waiting for this missing power domain provider. Best regards, Krzysztof 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 7DEFFC54E94 for ; Wed, 25 Jan 2023 07:44:36 +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:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Hrllf06zHilQ7fNLGE/deWX4OvIwWK3clqeS8RaONKc=; b=HJ+KgqpVvE+fu/ sLTIsZkw9PHscSrhSqeW44LSrrIFyoX8/JTOCepRygWWys2FD3c9lkbk+UZ7U8UTYs29SzYjKm9kf u9sd6Tmmg3oEvLaXHj/PusN7Y3u/dVGAxWX9ll/GuZyfQuWos74+oT+gZ6z2f0ZvmD9RzDAZ+rDXf cCTBsr6VhSBIA8m28tEzTz6Po8kbAYp6WKutiPeGSxvXcz50aeEPJ3aKg4pUetU3IZS4DQb92j98q WEBS/SxSAjO9ykfbUw/3piwNUwUX8Uj2Vk3fpq5VEup4g8Y4a9FvPm8sUfeIpakb+nY1AX1jA24mE h2Yi84Kpx3ERWFjWN4tA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKaR2-006HKq-W2; Wed, 25 Jan 2023 07:43:09 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKaQy-006HK3-SS for linux-arm-kernel@lists.infradead.org; Wed, 25 Jan 2023 07:43:06 +0000 Received: by mail-wr1-x431.google.com with SMTP id r9so16106673wrw.4 for ; Tue, 24 Jan 2023 23:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=muf/zGy7zrsCMgmkKGOZ9RAmuniRIs8c0Xd0aflWQ38=; b=jNX0/NkH6hZfgYCdnz9BCQYtQPrh32i6DY87qckF8MY2LT1y61b2YHTZr72e/lPDo8 x/2SkxmN8KLA7IbUIFrdMkQmLxzXwu4JBiI0+duaA2eSbnu7LlhiFrzh3YMv5y8ngWft JFqQIpTu+kdEkXqCogFRb+BvOneNBarLE5GooEFBaFyGPPF0G3+6cBS1YZ41Xh2dHP0R oVqlGG/XmJk3ddxP0QpCQkWFkT9v9augtrtUk8Nw3B/AkoUmPotuSFhg5d7IwfuMEmX4 ab6lYheHKcyYctGon6MdCLHhvMceliG0ZiG/LEzHnnZhfpatPe2eJ5tTJ13UqycpzlCT PgIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=muf/zGy7zrsCMgmkKGOZ9RAmuniRIs8c0Xd0aflWQ38=; b=e5QGqzdP5MI27arRG63dVxvhfupujlnXRJ/LIGlc4MSadDASDXCVXxob1lDTW1YrNz hEJuVjanXlv66lyInekfH7Q9Se/udGMBAqOjOfcYGbCoGIkPKkcIwMu87yQMclMz8ie0 i+tfMm8mU46jGEB+DExlheerIa2d6YDg+hvqIC/otLdGD4D/BlaVgQ6vvZxre7LQgJdY 0ieqaLa0Rgw1Q6AG7aXMkgsmgqZgCKsfrU6ZQ/pouHn7cKTWiyJMOxEFSMth5qUhBZPd q+fPzeJxkJYsomC6suFzp6rLLPA3P2Fjhl3h5C4egN4G4YHK1txI/WC/CKkBl4/ThnwM 8F+w== X-Gm-Message-State: AFqh2kq+dn6jiUyIFU9l0IOseidS4dyqiXMMZgFVxmEwVNgJWMZ1DH0+ PsHBTHvdLOH5pQHcJoeDewea/A== X-Google-Smtp-Source: AMrXdXvKSkwmMo6myk0f8HJh2ddDrbZC58zRqOXu6kIgMq+6CNWDJAqwj9wiFLx7d/lVZnDlpJ7vSg== X-Received: by 2002:adf:f0c1:0:b0:2bc:67d:c018 with SMTP id x1-20020adff0c1000000b002bc067dc018mr28555562wro.48.1674632582224; Tue, 24 Jan 2023 23:43:02 -0800 (PST) Received: from [192.168.1.109] ([178.197.216.144]) by smtp.gmail.com with ESMTPSA id i9-20020a5d5849000000b002bddac15b3dsm3291815wrf.33.2023.01.24.23.43.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Jan 2023 23:43:01 -0800 (PST) Message-ID: Date: Wed, 25 Jan 2023 08:42:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0 Subject: Re: [PATCH v3] cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT Content-Language: en-US To: Sudeep Holla Cc: "Rafael J. Wysocki" , Daniel Lezcano , Lorenzo Pieralisi , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sebastian Andrzej Siewior , Ulf Hansson , Adrien Thierry , Brian Masney , linux-rt-users@vger.kernel.org References: <20230119184228.683892-1-krzysztof.kozlowski@linaro.org> <20230124153411.nwkbjgoqgkua2icm@bogus> From: Krzysztof Kozlowski In-Reply-To: <20230124153411.nwkbjgoqgkua2icm@bogus> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230124_234304_973504_29755E5C X-CRM114-Status: GOOD ( 20.38 ) 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 24/01/2023 16:34, Sudeep Holla wrote: > On Thu, Jan 19, 2023 at 07:42:28PM +0100, Krzysztof Kozlowski wrote: >> The runtime Power Management of CPU topology is not compatible with >> PREEMPT_RT: >> 1. Core cpuidle path disables IRQs. >> 2. Core cpuidle calls cpuidle-psci. >> 3. cpuidle-psci in __psci_enter_domain_idle_state() calls >> pm_runtime_put_sync_suspend() and pm_runtime_get_sync() which use >> spinlocks (which are sleeping on PREEMPT_RT). >> >> Deep sleep modes are not a priority of Realtime kernels because the >> latencies might become unpredictable. On the other hand the PSCI CPU >> idle power domain is a parent of other devices and power domain >> controllers, thus it cannot be simply skipped (e.g. on Qualcomm SM8250). >> >> Disable the runtime PM calls from cpuidle-psci, which effectively stops >> suspending the cpuidle PSCI domain. This is a trade-off between making >> PREEMPT_RT working and still having a proper power domain hierarchy in >> the system. >> >> Cc: Adrien Thierry >> Cc: Brian Masney >> Cc: linux-rt-users@vger.kernel.org >> Signed-off-by: Krzysztof Kozlowski >> >> --- >> >> Changes since v1: >> 1. Re-work commit msg. >> 2. Add note to Kconfig. >> >> Several other patches were dropped, as this is the only one actually >> needed. It effectively stops PSCI cpuidle power domains from suspending >> thus solving all other issues I experienced. >> --- >> drivers/cpuidle/Kconfig.arm | 3 +++ >> drivers/cpuidle/cpuidle-psci.c | 4 ++-- >> 2 files changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm >> index 747aa537389b..24429b5bfd1c 100644 >> --- a/drivers/cpuidle/Kconfig.arm >> +++ b/drivers/cpuidle/Kconfig.arm >> @@ -24,6 +24,9 @@ config ARM_PSCI_CPUIDLE >> It provides an idle driver that is capable of detecting and >> managing idle states through the PSCI firmware interface. >> >> + The driver is not yet compatible with PREEMPT_RT: no idle states will >> + be entered by CPUs on such kernel. >> + > > Any particular reason for even compiling this file in or allowing the > ARM_PSCI_CPUIDLE when PREEMPT_RT=y ? If we can't enter idle states, we > can as well compile this file out ? It's the power domain sued for other devices, so we need it. Otherwise other devices will keep waiting for this missing power domain provider. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel