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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1448DC433EF for ; Fri, 29 Oct 2021 12:39:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E720061177 for ; Fri, 29 Oct 2021 12:39:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231569AbhJ2Ml6 (ORCPT ); Fri, 29 Oct 2021 08:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230134AbhJ2Ml5 (ORCPT ); Fri, 29 Oct 2021 08:41:57 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7539AC061570 for ; Fri, 29 Oct 2021 05:39:28 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id bq11so20785956lfb.10 for ; Fri, 29 Oct 2021 05:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=B2T3v4jXO25JT49qo2reiE0rneUAVuElVzG5JppoEM8=; b=jxD6biwTfe3xu6SqBzLET7VGwK1z+O5kXXr9D9ld+3oXexNknMqaFCW9F2LVUIXD+G ucuVD7vOA4sZwbtUVVm7VzO3veKFGjRJHKI0vsCgqedXMckkcCuS5RX2luse2sdk1Twa WBDj6uMCqZkJ/KYciN73SIqRqEBtCSDSF63zmsvalZsfnmh4tgcEAgjPi9ilrgDdWMVb ZEJT/Qe6glvFD7+mxzhPkUnG56DeqPTqZIJn0EwzCL6fb0mJg+J37Y3J8rVtha2bb88g FhnpS+0RzDdrfPrw09Zk0fIpd8IvICd3VoueJ91jfIvaJiW7UN68emvVY/bbOQyolIXI WutQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=B2T3v4jXO25JT49qo2reiE0rneUAVuElVzG5JppoEM8=; b=pFLwj50qTgRaklnauRXjh6ddOWlZO5HKG0yW5EdD74tSQMcqETwuC3Zlg+souvbQI/ FA0DC91xKhsedqBnnBoW0GUtPrKhJ9wjMUZc2IxiaKQJKNbJztDfJ07vLW8ChHcf2b4a JPtLKpOeSf46g7iAnThd+TnepNDuqNTAZE758F4o8VhOZBAes37DYVGsPm8gF+pQd1Cc zw44tdYYld1vDZ1eZsOMnpHdKZsumr/3Y5F0dMeRGhXv64oxmOLxKs7sViRxjaaEIEf5 CTqs/cFLOk26LDpoDD6PGuKkRB+2hyBwyRWkm5jb3bqLn9g+4XSSByIaCHD5Na9LyRZF OZBg== X-Gm-Message-State: AOAM532UqsGgLuJ394naQRsSM2XPwtm6RAd31D5DOWKb2IRPJ2mcWqqA 7m/hwXeytZ/Bc6fwrrbZXwymZw== X-Google-Smtp-Source: ABdhPJyTjynt3OjUbfPQGjnjOlAGOKmxPdHzyoRf35p2/vo3MySu4coNCsQpIc9on1MRDnXuPapytw== X-Received: by 2002:a05:6512:2309:: with SMTP id o9mr10050460lfu.124.1635511166794; Fri, 29 Oct 2021 05:39:26 -0700 (PDT) Received: from localhost.localdomain (h-155-4-129-146.NA.cust.bahnhof.se. [155.4.129.146]) by smtp.gmail.com with ESMTPSA id y35sm602528lfa.16.2021.10.29.05.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 05:39:25 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org Cc: Maulik Shah , Anup Patel , Len Brown , Bjorn Andersson , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] PM: sleep: Fix runtime PM based cpuidle support Date: Fri, 29 Oct 2021 14:38:55 +0200 Message-Id: <20211029123855.80344-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the cpuidle-psci case, runtime PM in combination with the generic PM domain (genpd), may be used when entering/exiting a shared idlestate. More precisely, genpd relies on runtime PM to be enabled for the attached device (in this case it belongs to a CPU), to properly manage the reference counting of its PM domain. This works fine most of the time, but during system suspend in dpm_suspend_late(), the PM core disables runtime PM for all devices. Beyond this point, calls to pm_runtime_get_sync() to runtime resume a device may fail and therefore it could also mess up the reference counting in genpd. To fix this problem, let's call wake_up_all_idle_cpus() in dpm_suspend_late(), prior to disabling runtime PM. In this way a device that belongs to a CPU, becomes runtime resumed through cpuidle-psci and stays like that, because the runtime PM usage count has been bumped in device_prepare(). Diagnosed-by: Maulik Shah Suggested-by: Rafael J. Wysocki Signed-off-by: Ulf Hansson --- Changes in v2: - Moved away from using cpuidle_pause|resume() to solve the problem, but instead just waking up idle CPUs is suffient, due to other recent merged changes. --- drivers/base/power/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index ac4dde8fdb8b..2fb08d4f1aca 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -1463,6 +1463,7 @@ int dpm_suspend_late(pm_message_t state) int error = 0; trace_suspend_resume(TPS("dpm_suspend_late"), state.event, true); + wake_up_all_idle_cpus(); mutex_lock(&dpm_list_mtx); pm_transition = state; async_error = 0; -- 2.25.1 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3618EC433EF for ; Fri, 29 Oct 2021 12:39:51 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EB4466113E for ; Fri, 29 Oct 2021 12:39:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EB4466113E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=YlS1kL3xVjQ5wCcjwJIW1GmqtFYuEpMcU2nS1ZBTBI8=; b=OCoCeQGpA3X1B9 wvxKOD3nc6IJbtPGI28fON3i8wFYAOPlGduvDmG5EitsbF20laLcgYzzYe6KpUVfwm5wtQHbLv2Df qIPzOKFP/9ddvWL6UtxjnJoeY745cWoXmXPhIgbowDK+60PaCCOPIh9DCMmYXL/TiJC6/aMMuedNY 49yyLvqiebwiO0FQXkyVBz6pudiLRdGQLgLCx2y6YC064LyUJyKBiZeblvtt257LYXRPICr+AsXQt u/J86nzJBIM07qypzSaqtzfLww4/rUwpdT23wRfswzzWzrUHazitrljREEJuRx/xj7h3jBqypoXfF FGgYAVnTDYlizAe+NCnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgRAe-00AwW9-2c; Fri, 29 Oct 2021 12:39:44 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgRAP-00AwQH-JW for linux-riscv@lists.infradead.org; Fri, 29 Oct 2021 12:39:32 +0000 Received: by mail-lf1-x129.google.com with SMTP id c28so20714437lfv.13 for ; Fri, 29 Oct 2021 05:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=B2T3v4jXO25JT49qo2reiE0rneUAVuElVzG5JppoEM8=; b=jxD6biwTfe3xu6SqBzLET7VGwK1z+O5kXXr9D9ld+3oXexNknMqaFCW9F2LVUIXD+G ucuVD7vOA4sZwbtUVVm7VzO3veKFGjRJHKI0vsCgqedXMckkcCuS5RX2luse2sdk1Twa WBDj6uMCqZkJ/KYciN73SIqRqEBtCSDSF63zmsvalZsfnmh4tgcEAgjPi9ilrgDdWMVb ZEJT/Qe6glvFD7+mxzhPkUnG56DeqPTqZIJn0EwzCL6fb0mJg+J37Y3J8rVtha2bb88g FhnpS+0RzDdrfPrw09Zk0fIpd8IvICd3VoueJ91jfIvaJiW7UN68emvVY/bbOQyolIXI WutQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=B2T3v4jXO25JT49qo2reiE0rneUAVuElVzG5JppoEM8=; b=EPQ/t54WdsLl59Y8/srJO9MVgqvveOxJNitwgHHKxwSItUBrl1zdSW/nQuqUObywog vV6bwK+t3t+ywepV58LQCOw3v3cR/5Ztal+/gJ8aGaulbfayU0jL55YuQ6PoJDYF0diw 86cCCfQmZQbvYDIy1XfzRK+p1iYp/x39mW5eDY1IW2ryjhSpX1eBS6crWP8p1QKb2zAQ Ypi9Tc7J63TowzyM2D+jVVvmCgeqOQ23Cv99IDZuhmqoJAz4CTQLnxehjrMbLcSbNsbT WAmH3RLPG3xsC1ZR//LJQzYc8ucFJ7bTDOtYAh741CenDawbjRT7nzbYlZvPvEdqgSRr zflg== X-Gm-Message-State: AOAM530bOl1gky55NlNWT2BS+iPGEwGHFmOYU7w+gwR5XnzD+kh6J7Ri O7jojo7N8en+2Lj+lrq1iTF7dw== X-Google-Smtp-Source: ABdhPJyTjynt3OjUbfPQGjnjOlAGOKmxPdHzyoRf35p2/vo3MySu4coNCsQpIc9on1MRDnXuPapytw== X-Received: by 2002:a05:6512:2309:: with SMTP id o9mr10050460lfu.124.1635511166794; Fri, 29 Oct 2021 05:39:26 -0700 (PDT) Received: from localhost.localdomain (h-155-4-129-146.NA.cust.bahnhof.se. [155.4.129.146]) by smtp.gmail.com with ESMTPSA id y35sm602528lfa.16.2021.10.29.05.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 05:39:25 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org Cc: Maulik Shah , Anup Patel , Len Brown , Bjorn Andersson , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] PM: sleep: Fix runtime PM based cpuidle support Date: Fri, 29 Oct 2021 14:38:55 +0200 Message-Id: <20211029123855.80344-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211029_053929_675145_9E3CF666 X-CRM114-Status: GOOD ( 12.60 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org In the cpuidle-psci case, runtime PM in combination with the generic PM domain (genpd), may be used when entering/exiting a shared idlestate. More precisely, genpd relies on runtime PM to be enabled for the attached device (in this case it belongs to a CPU), to properly manage the reference counting of its PM domain. This works fine most of the time, but during system suspend in dpm_suspend_late(), the PM core disables runtime PM for all devices. Beyond this point, calls to pm_runtime_get_sync() to runtime resume a device may fail and therefore it could also mess up the reference counting in genpd. To fix this problem, let's call wake_up_all_idle_cpus() in dpm_suspend_late(), prior to disabling runtime PM. In this way a device that belongs to a CPU, becomes runtime resumed through cpuidle-psci and stays like that, because the runtime PM usage count has been bumped in device_prepare(). Diagnosed-by: Maulik Shah Suggested-by: Rafael J. Wysocki Signed-off-by: Ulf Hansson --- Changes in v2: - Moved away from using cpuidle_pause|resume() to solve the problem, but instead just waking up idle CPUs is suffient, due to other recent merged changes. --- drivers/base/power/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index ac4dde8fdb8b..2fb08d4f1aca 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -1463,6 +1463,7 @@ int dpm_suspend_late(pm_message_t state) int error = 0; trace_suspend_resume(TPS("dpm_suspend_late"), state.event, true); + wake_up_all_idle_cpus(); mutex_lock(&dpm_list_mtx); pm_transition = state; async_error = 0; -- 2.25.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7422EC433F5 for ; Fri, 29 Oct 2021 12:40:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3642161167 for ; Fri, 29 Oct 2021 12:40:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3642161167 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=UJK7nW1x0oHJIxaLlgwz5+Wsbv6QXI6csiMo+75fBjE=; b=aA0F+thJt0Ddvy 1i41e46UwH67nGYEoffFDir92NqW7uzFfy29lU2H1+iXe69F4PwfqNTFjIkGbH0qx8G3oDy+8ClQj NeA1MQez8ycHxDDMqHk91BpZaPOscARa76SddffT8EodFK+GzDS6sqFqVNHgak8ZBGXVtVyvgHN8A NrzR8iP1c7Y6panOWCzvPJSk+d7s3ZDnD5LIvssygRoPWMmHkt4IOFCuTWq+Qa187RZNS7QImBwpL h2VXOC6deFpbFN2vsZoV78ya03srLRBhKTbbbuSJOzf8AEAF2ygaGvtyqJVPm2UhbImm3eXbguchf VBjhk64B9F00jj/adeQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgRAU-00AwT2-99; Fri, 29 Oct 2021 12:39:34 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgRAP-00AwQG-J7 for linux-arm-kernel@lists.infradead.org; Fri, 29 Oct 2021 12:39:31 +0000 Received: by mail-lf1-x130.google.com with SMTP id j2so20826971lfg.3 for ; Fri, 29 Oct 2021 05:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=B2T3v4jXO25JT49qo2reiE0rneUAVuElVzG5JppoEM8=; b=jxD6biwTfe3xu6SqBzLET7VGwK1z+O5kXXr9D9ld+3oXexNknMqaFCW9F2LVUIXD+G ucuVD7vOA4sZwbtUVVm7VzO3veKFGjRJHKI0vsCgqedXMckkcCuS5RX2luse2sdk1Twa WBDj6uMCqZkJ/KYciN73SIqRqEBtCSDSF63zmsvalZsfnmh4tgcEAgjPi9ilrgDdWMVb ZEJT/Qe6glvFD7+mxzhPkUnG56DeqPTqZIJn0EwzCL6fb0mJg+J37Y3J8rVtha2bb88g FhnpS+0RzDdrfPrw09Zk0fIpd8IvICd3VoueJ91jfIvaJiW7UN68emvVY/bbOQyolIXI WutQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=B2T3v4jXO25JT49qo2reiE0rneUAVuElVzG5JppoEM8=; b=s9eRn9C+YbODWgvW+R6sjAQBUgBKAZxC8jmoeyd42bzhq3Hj4xkw+whFvRIEKSbMV+ 131H2U+ir8YHHOxorSsorC2TSw83VJcUFDLlSh9vYVbCwspefG/X27f39TNaNJksjLwo UpF5MhMVY9/eUnRd+WiaWkVnrIHz6/pJjTLspmNeAJZc6uZ71ED/NNju2W0CCUiZqxnY mTgHZlDnH8ZbNGR0dh2Jx0u2uMci2HIXuDHNcxR70vG9sahiBpY1pfJEtddmD4QC1vzL JNfuKnu/U/jjUAVWoHCuApuX/tbynGu8KrOB+3c5KqJZwFpx62gXeZ/FL3rIvKT8TyJ2 g9yg== X-Gm-Message-State: AOAM533yfJx+JRFM115h2srNvEgF7sPpZI2YklGJJY8Nf1gnpneKYKi4 /mNUg9cVthYJKxJDqKO9IwAPlQ== X-Google-Smtp-Source: ABdhPJyTjynt3OjUbfPQGjnjOlAGOKmxPdHzyoRf35p2/vo3MySu4coNCsQpIc9on1MRDnXuPapytw== X-Received: by 2002:a05:6512:2309:: with SMTP id o9mr10050460lfu.124.1635511166794; Fri, 29 Oct 2021 05:39:26 -0700 (PDT) Received: from localhost.localdomain (h-155-4-129-146.NA.cust.bahnhof.se. [155.4.129.146]) by smtp.gmail.com with ESMTPSA id y35sm602528lfa.16.2021.10.29.05.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 05:39:25 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org Cc: Maulik Shah , Anup Patel , Len Brown , Bjorn Andersson , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] PM: sleep: Fix runtime PM based cpuidle support Date: Fri, 29 Oct 2021 14:38:55 +0200 Message-Id: <20211029123855.80344-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211029_053929_663080_0C29353F X-CRM114-Status: GOOD ( 14.00 ) 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 In the cpuidle-psci case, runtime PM in combination with the generic PM domain (genpd), may be used when entering/exiting a shared idlestate. More precisely, genpd relies on runtime PM to be enabled for the attached device (in this case it belongs to a CPU), to properly manage the reference counting of its PM domain. This works fine most of the time, but during system suspend in dpm_suspend_late(), the PM core disables runtime PM for all devices. Beyond this point, calls to pm_runtime_get_sync() to runtime resume a device may fail and therefore it could also mess up the reference counting in genpd. To fix this problem, let's call wake_up_all_idle_cpus() in dpm_suspend_late(), prior to disabling runtime PM. In this way a device that belongs to a CPU, becomes runtime resumed through cpuidle-psci and stays like that, because the runtime PM usage count has been bumped in device_prepare(). Diagnosed-by: Maulik Shah Suggested-by: Rafael J. Wysocki Signed-off-by: Ulf Hansson --- Changes in v2: - Moved away from using cpuidle_pause|resume() to solve the problem, but instead just waking up idle CPUs is suffient, due to other recent merged changes. --- drivers/base/power/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index ac4dde8fdb8b..2fb08d4f1aca 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -1463,6 +1463,7 @@ int dpm_suspend_late(pm_message_t state) int error = 0; trace_suspend_resume(TPS("dpm_suspend_late"), state.event, true); + wake_up_all_idle_cpus(); mutex_lock(&dpm_list_mtx); pm_transition = state; async_error = 0; -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel