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 B736CC4332F for ; Wed, 4 Jan 2023 15:15:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235114AbjADPPy (ORCPT ); Wed, 4 Jan 2023 10:15:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbjADPPn (ORCPT ); Wed, 4 Jan 2023 10:15:43 -0500 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 822AF1AA2C for ; Wed, 4 Jan 2023 07:15:42 -0800 (PST) Received: by mail-pf1-x42b.google.com with SMTP id a30so7422995pfr.6 for ; Wed, 04 Jan 2023 07:15:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NcHEJMiIJ2CTsxxcy2YLVjiMLnHtyJJbhyDHZkGM4Oc=; b=F9bpsh37Sd0YglgZi0WpS89CpHqfv0diullW3FFmTO9bOi7hfscSE/OjGPxPEPQkEN 30dLoca9DbFdO0h28yq/V0+zKhhwP7if4KzONvm0C5e4ZGN7RR/mJV/dX+GglLwSPMpc Gck5P/9AM6XxWAH5yODKBjx04KGJHJrt3cUGzkNpLz7TtkHshqQEQMmgpRlw05G6wUeV 5W4gvQ8VVwwjaGsE/rtTb24nlbbWIKIJVIXrbhMZpYUq/nPtkr3qwhzF10vZuWlV1+AP 2/8yaiwVmq1nGEh+/72E1SVue5OHi7WQ+fmXOrDqBI08/KLZ3ui1bKaArAvMh6A4NakM rQ1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NcHEJMiIJ2CTsxxcy2YLVjiMLnHtyJJbhyDHZkGM4Oc=; b=xIaVDtK/NargfbEcRy5aRwUiOJjAyXEfUVF4deiOBIMJR4ukkSwekctD9Z+aqTnO5S SBp18GMKg+KTHL+ScvimpvvHPe3OizAYaPLcspYZSmk7jn2X/OXZ9S5RL6bqwqmSBKxl qmaHgDBUJKyCfdWD49+F3fM7LZgL7oqBXK8HyyqKhBBKC6fYkOHZXCFJyZLcjFyIxy1i zFNW8h73ut/5Do9mB6Bxk+PCW+XTTvqlfK/ASr4WfoqbIijAsDkkqnQLA+8xJNAgYF4P t02EAPHvRnr/T1Pgihv1EBI2yXEjM4+gdUKL7+gET2sZwfMfcDOtG7Vrv9L+85hlGPCK TOsg== X-Gm-Message-State: AFqh2kpOPMLhFumyjn5NUrxbKivyTOQw/8KCr0afxAjDrTW90TVFhiSy gTpvBvvyFTYIzfVifeN65fODIoWQpMk00ZoWD02wBA== X-Google-Smtp-Source: AMrXdXt93Kj3tA2/Y9cGuM6OLuxk7FuAuBumQ9h/vxk1VLQQewgTolksdOkOGf5EMaiCJCDrv92isJrfu7ZsSe9hYkE= X-Received: by 2002:a63:ba09:0:b0:479:2227:3aa1 with SMTP id k9-20020a63ba09000000b0047922273aa1mr2127830pgf.595.1672845341858; Wed, 04 Jan 2023 07:15:41 -0800 (PST) MIME-Version: 1.0 References: <20221219151503.385816-1-krzysztof.kozlowski@linaro.org> In-Reply-To: From: Ulf Hansson Date: Wed, 4 Jan 2023 16:15:05 +0100 Message-ID: Subject: Re: [PATCH v2 0/5] PM: Fixes for Realtime systems To: Adrien Thierry Cc: Krzysztof Kozlowski , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Kevin Hilman , Daniel Lezcano , Lorenzo Pieralisi , Sudeep Holla , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Brian Masney , linux-rt-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Dec 2022 at 22:36, Adrien Thierry wrote: > > Hi Krzysztof, > Thanks for looking into this! > > I tested your patchset on the QDrive3 on a CentOS Stream 9 RT kernel (I > couldn't test it on mainline because the latest RT patchset only supports > 6.1 which is missing some bits needed to boot QDrive3). > > It fixes the PSCI cpuidle issue I was encountering in [1]. However, I may > have found another code path that triggers a similar issue: > > BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46 > in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 113, name: kworker/4:2 > preempt_count: 1, expected: 0 > RCU nest depth: 0, expected: 0 > 4 locks held by kworker/4:2/113: > #0: ffff09b0c2376928 ((wq_completion)pm){+.+.}-{0:0}, at: process_one_work+0x1f4/0x7c0 > #1: ffff800008bf3dd0 ((work_completion)(&genpd->power_off_work)){+.+.}-{0:0}, at: process_one_work+0x1f4/0x7c0 > #2: ffff09b0c2e44860 (&genpd->rslock){....}-{2:2}, at: genpd_lock_rawspin+0x20/0x30 > #3: ffff09b0c6696a20 (&dev->power.lock){+.+.}-{2:2}, at: dev_pm_qos_flags+0x2c/0x60 > irq event stamp: 170 > hardirqs last enabled at (169): [] _raw_spin_unlock_irq+0x48/0xc4 > hardirqs last disabled at (170): [] _raw_spin_lock_irqsave+0xb0/0xfc > softirqs last enabled at (0): [] copy_process+0x68c/0x1500 > softirqs last disabled at (0): [<0000000000000000>] 0x0 > Preemption disabled at: > [] genpd_lock_rawspin+0x20/0x30 > CPU: 4 PID: 113 Comm: kworker/4:2 Tainted: G X --------- --- 5.14.0-rt14+ #2 > Hardware name: Qualcomm SA8540 ADP (DT) > Workqueue: pm genpd_power_off_work_fn > Call trace: > dump_backtrace+0xb4/0x12c > show_stack+0x1c/0x70 > dump_stack_lvl+0x98/0xd0 > dump_stack+0x14/0x2c > __might_resched+0x180/0x220 > rt_spin_lock+0x74/0x11c > dev_pm_qos_flags+0x2c/0x60 > genpd_power_off.part.0.isra.0+0xac/0x2d0 > genpd_power_off_work_fn+0x68/0x8c > process_one_work+0x2b8/0x7c0 > worker_thread+0x15c/0x44c > kthread+0xf8/0x104 > ret_from_fork+0x10/0x20 > > This happens consistently during boot. But on the mainline kernel, this > code path has changed: genpd_power_off no longer calls dev_pm_qos_flags. > So it might not happen on mainline. I hope to be able to test your > patchset again soon on mainline with the next version of the RT patchset > (which should be able to boot the QDrive3). You are right, since commit 3f9ee7da724a ("PM: domains: Don't check PM_QOS_FLAG_NO_POWER_OFF in genpd") dev_pm_qos_flags() doesn't get called in genpd_power_off() anymore. That patch was introduced in v5.19. > > Best, > Adrien > > [1] https://lore.kernel.org/all/20220615203605.1068453-1-athierry@redhat.com/ > Kind regards Uffe 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 9DC3AC46467 for ; Wed, 4 Jan 2023 15:23:15 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yUP64h/fM3hwcb8tqHRA925iLJVunCcLqheaayMG7KI=; b=v/1gMeMBqjI6hZ 7ABYJeSitzRtmDyWoPz/7z4yWHgDZnB+GXB420YlK7l55HDDicarAbrqiCexk1ZJ2U3os/57WZKBL 61easDlPBwRyV1eMAcD59s1Fq8lIQkR5CcG54e/H53xC4J45ZWegySLO/kNJpiMz3rkKeNfJXb9Oz Z2mUDl4VNPvttZf/jTloyBuc+Yph2QkQZhq8xbGl7CZ3Q/09nfnQclCPXYZ71CJvwuutP7nEVr9w7 EbasRu+KDLEhTaLktrtfrLuPm+RVVoZHsxvyZuQCGO0Jc51dwySLIm9ncsI5BzmtvmVVfhIiVYmkl f3VTTWo4EUVSiuCvdEXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pD5aV-00A4O6-Kc; Wed, 04 Jan 2023 15:21:56 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pD5UW-00A1CW-Ni for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2023 15:15:46 +0000 Received: by mail-pg1-x529.google.com with SMTP id e10so8510209pgc.9 for ; Wed, 04 Jan 2023 07:15:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NcHEJMiIJ2CTsxxcy2YLVjiMLnHtyJJbhyDHZkGM4Oc=; b=F9bpsh37Sd0YglgZi0WpS89CpHqfv0diullW3FFmTO9bOi7hfscSE/OjGPxPEPQkEN 30dLoca9DbFdO0h28yq/V0+zKhhwP7if4KzONvm0C5e4ZGN7RR/mJV/dX+GglLwSPMpc Gck5P/9AM6XxWAH5yODKBjx04KGJHJrt3cUGzkNpLz7TtkHshqQEQMmgpRlw05G6wUeV 5W4gvQ8VVwwjaGsE/rtTb24nlbbWIKIJVIXrbhMZpYUq/nPtkr3qwhzF10vZuWlV1+AP 2/8yaiwVmq1nGEh+/72E1SVue5OHi7WQ+fmXOrDqBI08/KLZ3ui1bKaArAvMh6A4NakM rQ1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NcHEJMiIJ2CTsxxcy2YLVjiMLnHtyJJbhyDHZkGM4Oc=; b=PKRtErwDZ7MoInzUjLla9QIM1YuXGUGzKJPGr0MMKEeRtqI/GofBnB6pUHGm+1Mhmf 4l4ipEaZkK+WOwazgGyKkjjw5bHNNx52z9P/PoLz4N9X1aq8d6OUXQzsrTK91EfcrCd1 V/ZKypmycpjbueXVeAmRrX3p3fD2nqUy4VbHNKvNJuZflPE6J1AFr+G2/+/ck/kP/pK+ swGKK8/DLtJYctwfr84ZMP3DcXhx92q5R7nFuIrUQiXCq7LCasMw2BQn1Q6aFotbse+S rr7HAkaEztB1OdcqPTTyrv3ZlTE0i/rLrnGfkGaC6VpyYFA71G65r5dMilHjbFuFkXGJ 0yRA== X-Gm-Message-State: AFqh2koC1XsrCtMBlZCzK484ybKq8s1RyLMo6E658vPk3vD5ivtpuzkj 6FNQFbLBfMLWJJX0z9p+o+n6XWqo+pybGQP/z9RQ0g== X-Google-Smtp-Source: AMrXdXt93Kj3tA2/Y9cGuM6OLuxk7FuAuBumQ9h/vxk1VLQQewgTolksdOkOGf5EMaiCJCDrv92isJrfu7ZsSe9hYkE= X-Received: by 2002:a63:ba09:0:b0:479:2227:3aa1 with SMTP id k9-20020a63ba09000000b0047922273aa1mr2127830pgf.595.1672845341858; Wed, 04 Jan 2023 07:15:41 -0800 (PST) MIME-Version: 1.0 References: <20221219151503.385816-1-krzysztof.kozlowski@linaro.org> In-Reply-To: From: Ulf Hansson Date: Wed, 4 Jan 2023 16:15:05 +0100 Message-ID: Subject: Re: [PATCH v2 0/5] PM: Fixes for Realtime systems To: Adrien Thierry Cc: Krzysztof Kozlowski , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Kevin Hilman , Daniel Lezcano , Lorenzo Pieralisi , Sudeep Holla , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Brian Masney , linux-rt-users@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230104_071544_820257_9BDAF5FC X-CRM114-Status: GOOD ( 18.42 ) 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 Tue, 20 Dec 2022 at 22:36, Adrien Thierry wrote: > > Hi Krzysztof, > Thanks for looking into this! > > I tested your patchset on the QDrive3 on a CentOS Stream 9 RT kernel (I > couldn't test it on mainline because the latest RT patchset only supports > 6.1 which is missing some bits needed to boot QDrive3). > > It fixes the PSCI cpuidle issue I was encountering in [1]. However, I may > have found another code path that triggers a similar issue: > > BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46 > in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 113, name: kworker/4:2 > preempt_count: 1, expected: 0 > RCU nest depth: 0, expected: 0 > 4 locks held by kworker/4:2/113: > #0: ffff09b0c2376928 ((wq_completion)pm){+.+.}-{0:0}, at: process_one_work+0x1f4/0x7c0 > #1: ffff800008bf3dd0 ((work_completion)(&genpd->power_off_work)){+.+.}-{0:0}, at: process_one_work+0x1f4/0x7c0 > #2: ffff09b0c2e44860 (&genpd->rslock){....}-{2:2}, at: genpd_lock_rawspin+0x20/0x30 > #3: ffff09b0c6696a20 (&dev->power.lock){+.+.}-{2:2}, at: dev_pm_qos_flags+0x2c/0x60 > irq event stamp: 170 > hardirqs last enabled at (169): [] _raw_spin_unlock_irq+0x48/0xc4 > hardirqs last disabled at (170): [] _raw_spin_lock_irqsave+0xb0/0xfc > softirqs last enabled at (0): [] copy_process+0x68c/0x1500 > softirqs last disabled at (0): [<0000000000000000>] 0x0 > Preemption disabled at: > [] genpd_lock_rawspin+0x20/0x30 > CPU: 4 PID: 113 Comm: kworker/4:2 Tainted: G X --------- --- 5.14.0-rt14+ #2 > Hardware name: Qualcomm SA8540 ADP (DT) > Workqueue: pm genpd_power_off_work_fn > Call trace: > dump_backtrace+0xb4/0x12c > show_stack+0x1c/0x70 > dump_stack_lvl+0x98/0xd0 > dump_stack+0x14/0x2c > __might_resched+0x180/0x220 > rt_spin_lock+0x74/0x11c > dev_pm_qos_flags+0x2c/0x60 > genpd_power_off.part.0.isra.0+0xac/0x2d0 > genpd_power_off_work_fn+0x68/0x8c > process_one_work+0x2b8/0x7c0 > worker_thread+0x15c/0x44c > kthread+0xf8/0x104 > ret_from_fork+0x10/0x20 > > This happens consistently during boot. But on the mainline kernel, this > code path has changed: genpd_power_off no longer calls dev_pm_qos_flags. > So it might not happen on mainline. I hope to be able to test your > patchset again soon on mainline with the next version of the RT patchset > (which should be able to boot the QDrive3). You are right, since commit 3f9ee7da724a ("PM: domains: Don't check PM_QOS_FLAG_NO_POWER_OFF in genpd") dev_pm_qos_flags() doesn't get called in genpd_power_off() anymore. That patch was introduced in v5.19. > > Best, > Adrien > > [1] https://lore.kernel.org/all/20220615203605.1068453-1-athierry@redhat.com/ > Kind regards Uffe _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel