Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp302720lqb; Thu, 14 Mar 2024 11:35:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuzfLhDxTZjVjt70EsXUYggVULTDV2hfbyVXp/13f5rZd4tpRHjnh/4zGx3GgoXr/h0F5E0ocKkgljhevm7XswKZygvNanczVi/mHpIQ== X-Google-Smtp-Source: AGHT+IG69gdg3IjvxecSmCvonZ/k08nXuuTwA0SoMO/2NualwshL2fMtrLLHMqJu0fQkWROd5Cuv X-Received: by 2002:a17:903:1211:b0:1db:b8f9:ea69 with SMTP id l17-20020a170903121100b001dbb8f9ea69mr3061692plh.34.1710441348577; Thu, 14 Mar 2024 11:35:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710441348; cv=pass; d=google.com; s=arc-20160816; b=pgMVhXX5pCfg3suJEH3JGq5enJhRVpD16w6tk53KUvVIkndqXfYBJoD1Y02SM0wlwQ wzrDX/xOg9pFlz9xlVyQqF+l/lsOWuWcgztk3nHXfFvpyUjL6LwL1lQhWSOTFiBi/Blf sHJqFdRKdZDtj+7U9Imkg6WlUz8nmdJMCtPKyjPITwHz2R4V0ssVIqKXu0UtxMXQwg9d yTKt1APXSVJQYsKQrj+yNxsBPvccKzqsrlFMGG18dXbEccoWubPUBF9A6eDD4SUGQHPu 37dzgMWN66tQfW1ctB7cbDgTXnSUSZWRZEmNfCQ5Shg453tXkluWiP+HYT/hDH77tVE5 VnjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=E7lSi385TiW3btX0NxkRwlF/HfafCFFm3tcK0+Lcqmg=; fh=q/R/07tE5BUgo7LIi0n2c7DN27YPlIyM7fdXnDVK++A=; b=cX5ZWzzFt3w9os+a+dbGkpZionft3A5TzHwyzL2RVySNuV0pyprg3fccoWLxXAzYHR 127M5em4L3XpwkCEukqAPCV1WKsrBkYHnRf/nRY3AoJrAk4tADmA9gMUf+lOO9LfeMLI TAaDWB5hzjiTkQD1EBxs61+IqpRWpp8UKFXOxQR5jGSHfUi8+qBS9peZRBwCBjXvOG2d q0oRlB/ftTOWrOwjhoMZTe/GCNs05SHmGBOnkxMEMzJx/sq8MkWYdnGMy9/7PCZu2D90 DtQYuWLXzJWKqu2NCOuqTYZO/+nzcfYIoU21ZYD5IdO5BvrHHmqj8zMBlDE0KSPs3t5z WZjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VVAuS0dh; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-103674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103674-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p1-20020a1709027ec100b001dc6699f553si1890746plb.360.2024.03.14.11.35.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 11:35:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VVAuS0dh; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-103674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103674-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9B6C0B2182C for ; Thu, 14 Mar 2024 18:35:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2A7674C1F; Thu, 14 Mar 2024 18:35:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VVAuS0dh" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A07B74BF6; Thu, 14 Mar 2024 18:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710441327; cv=none; b=Am99eDT/nTMSunjifbtQ/k2D0LJX+Tw8GghpuKc0jYj3PVpURMml6bUVMIvIKlg9t6RzQO4CwGyZ3o2uj1laF84NZppToV7UXwtsoUlYBlk8+3m+vwIEJl3DrhzDPl8FmBJmL9yKmT4Kv2HryZp1cjxJT2ihXFWXBfPEi1/iVLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710441327; c=relaxed/simple; bh=BZGLXb11/LNpk0fcg3oHiiE/njTiaKJLGdfDNc3pWJk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GQe98kMzU6L8VmRFmwPJhwrZMMxXYV1mQQukm/rm659zFFWVq2difLVBb4dMuJHuHPZ/Xi7Ln7rX1d524Td7nBCQN+eJmRQnKfyfb9gnFH5dvIQ4FCa/Hv0OXFdh52vri3WKN9wslfVesV0rqGZHJfNOiaCJzHdjZsiw514kZHU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VVAuS0dh; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1dddad37712so12442925ad.3; Thu, 14 Mar 2024 11:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710441325; x=1711046125; darn=vger.kernel.org; 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=E7lSi385TiW3btX0NxkRwlF/HfafCFFm3tcK0+Lcqmg=; b=VVAuS0dh4gEjvATIHxCgeWpfv7I0/rKFnMDGNu28OHO1WSHH0DVaeOqGGhU6tFsg7R j8lGA+SKfH5jrQxa5QmPK9p83IR9ZJw41xwc/cJUKdN1mP9y8bIAW0TDQn9GaMGbVy5v phZlIG44Bd+I4pz8j+6fNfE+LQ4D+rDhj6A7Qvn9mtWT2DBAPEanHZ7UtNzZfgN3xm7W Lh4uvOf5aU+I6wyh/MgVrbLNMLA7U3D7DjR5Cowcvm75qSytmwgdtX9AUNEHiIhjcgmK cObtCsrS9W9UXOdCV26F1sQklTliq2xyeR+cdnqwOLBbzXVzfMvpqzpLSpyq4/8K6jVk bK6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710441325; x=1711046125; 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=E7lSi385TiW3btX0NxkRwlF/HfafCFFm3tcK0+Lcqmg=; b=KieFkUI4l1h5Y7c795AB2K7hWno53gufTYD4WmJASBLyQlS6zVuGjRrbKn29nwK+UX /zJvfoJLT4U1wNZ1OeoGUTk9smH7bMjePguk6xEPeggbrRpbipY2n612d9SkePZq8UGa EVn0EtWi5c5Y3D9HqSzff0GgoGDLTUo+4qKxEOaTnMYi8A1E0I0ypA6qML8F5NS4JPi9 /Z8LNLumrrUNYtgX6ux+K9Biaj0pon/pXn1RDWEyn5DQ2Tji1hlUyk92qPpcDoflE1eI IZBghVkvWDFvBp/LCc8o0BIhO0fUOrWoDXaoyqzCAl27XqQHw8164sPpKIvRIGQzCkN+ TuPQ== X-Forwarded-Encrypted: i=1; AJvYcCUE51ljenLjpNMCXLOn9wNxgfEUf0OaVZam1GLJN2mGbvxrpPYLdSpfDz7yhAxQSVP4/pmvbhd7UTIRGHc1paj3ugiHQzpZ+NRZQFoDJ2zOxanQYEQ1KXEZ3YsL4T9BYSc0 X-Gm-Message-State: AOJu0Yxr0CZ8UT9N0cq/h9RoU0QMpGVDk7MQARDXrER8jQF+VGaf/G67 IoAeDVcUNj6iVRO/vfNETzBWON63isFt3R5/xoqB7TnSOlCYhQJy X-Received: by 2002:a17:902:d58d:b0:1de:e5aa:518a with SMTP id k13-20020a170902d58d00b001dee5aa518amr2150949plh.32.1710441325238; Thu, 14 Mar 2024 11:35:25 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id p15-20020a170902780f00b001dcc8c26393sm2084702pll.225.2024.03.14.11.35.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Mar 2024 11:35:24 -0700 (PDT) Message-ID: Date: Thu, 14 Mar 2024 11:35:23 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Unexplained long boot delays [Was Re: [GIT PULL] RCU changes for v6.9] Content-Language: en-US To: Frederic Weisbecker Cc: "Russell King (Oracle)" , Joel Fernandes , Boqun Feng , Anna-Maria Behnsen , Linus Torvalds , linux-kernel@vger.kernel.org, kernel-team@meta.com, paulmck@kernel.org, mingo@kernel.org, tglx@linutronix.de, rcu@vger.kernel.org, neeraj.upadhyay@amd.com, urezki@gmail.com, qiang.zhang1211@gmail.com, bigeasy@linutronix.de, chenzhongjin@huawei.com, yangjihong1@huawei.com, rostedt@goodmis.org, Justin Chen References: <2fb110ed-ba04-4320-9ef0-8766c9df5578@gmail.com> <533151c9-afb5-453b-8014-9fbe7c3b26c2@gmail.com> From: Florian Fainelli In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/14/24 03:41, Frederic Weisbecker wrote: > On Wed, Mar 13, 2024 at 08:44:07PM -0700, Florian Fainelli wrote: >> >> >> On 3/13/2024 3:52 PM, Frederic Weisbecker wrote: >>> On Wed, Mar 13, 2024 at 03:04:26PM -0700, Florian Fainelli wrote: >>>> On 3/13/24 14:59, Russell King (Oracle) wrote: >>>>> On Wed, Mar 13, 2024 at 02:30:43PM -0700, Florian Fainelli wrote: >>>>>> I will try to provide multiple answers for the sake of everyone having the >>>>>> same context. Responding to Linus' specifically and his suggestion to use >>>>>> "initcall_debug", this is what it gave me: >>>>>> >>>>>> [ 6.970669] ata1: SATA link down (SStatus 0 SControl 300) >>>>>> [ 166.136366] probe of unimac-mdio-0:01 returned 0 after 159216218 usecs >>>>>> [ 166.142931] unimac-mdio unimac-mdio.0: Broadcom UniMAC MDIO bus >>>>>> [ 166.148900] probe of unimac-mdio.0 returned 0 after 159243553 usecs >>>>>> [ 166.155820] probe of f0480000.ethernet returned 0 after 159258794 usecs >>>>>> [ 166.166427] ehci-brcm f0b00300.ehci_v2: EHCI Host Controller >>>>>> >>>>>> Also got another occurrence happening resuming from suspend to DRAM with: >>>>>> >>>>>> [ 22.570667] brcmstb-dpfe 9932000.dpfe-cpu: PM: calling >>>>>> platform_pm_resume+0x0/0x54 @ 1574, parent: rdb >>>>>> [ 181.643809] brcmstb-dpfe 9932000.dpfe-cpu: PM: >>>>>> platform_pm_resume+0x0/0x54 returned 0 after 159073134 usecs >>>>>> >>>>>> and also with the PCIe root complex driver: >>>>>> >>>>>> [ 18.266279] brcm-pcie f0460000.pcie: PM: calling >>>>>> brcm_pcie_resume_noirq+0x0/0x164 @ 1597, parent: platform >>>>>> [ 177.457219] brcm-pcie f0460000.pcie: clkreq-mode set to default >>>>>> [ 177.457225] brcm-pcie f0460000.pcie: link up, 2.5 GT/s PCIe x1 (!SSC) >>>>>> [ 177.457231] brcm-pcie f0460000.pcie: PM: brcm_pcie_resume_noirq+0x0/0x164 >>>>>> returned 0 after 159190939 usecs >>>>>> [ 177.457257] pcieport 0000:00:00.0: PM: calling >>>>>> pci_pm_resume_noirq+0x0/0x160 @ 33, parent: pci0000:00 >>>>>> >>>>>> Surprisingly those drivers are consistently reproducing the failures I am >>>>>> seeing so at least this gave me a clue as to where the problem is. >>>>>> >>>>>> There were no changes to drivers/net/ethernet/broadcom/genet/, the two >>>>>> changes done to drivers/net/mdio/mdio-bcm-unimac.c are correct, especially >>>>>> the read_poll_timeout() conversion is correct, we properly break out of the >>>>>> loop. The initial delay looked like a good culprit for a little while, but >>>>>> it is not used on the affected platforms because instead we provide a >>>>>> callback and we have an interrupt to signal the completion of a MDIO >>>>>> operation, therefore unimac_mdio_poll() is not used at all. Finally >>>>>> drivers/memory/brcmstb_dpfe.c also received a single change which is not >>>>>> functional here (.remove function change do return void). >>>>>> >>>>>> I went back to a manual bisection and this time I believe that I have a more >>>>>> plausible candidate with: >>>>>> >>>>>> 7ee988770326fca440472200c3eb58935fe712f6 ("timers: Implement the >>>>>> hierarchical pull model") >>>>> >>>>> I haven't understood the code there yet, and how it would interact with >>>>> arch code, but one thing that immediately jumps out to me is this: >>>>> >>>>> " As long as a CPU is busy it expires both local and global timers. When a >>>>> CPU goes idle it arms for the first expiring local timer." >>>>> >>>>> So are local timers "armed" when they are enqueued while the cpu is >>>>> "busy" during initialisation, and will they expire, and will that >>>>> expiry be delivered in a timely manner? >>>>> >>>>> If not, this commit is basically broken, and would be the cause of the >>>>> issue you are seeing. For the mdio case, we're talking about 2ms >>>>> polling. For the dpfe case, it looks like we're talking about 1ms >>>>> sleeps. I'm guessing that these end up being local timers. >>>>> >>>>> Looking at pcie-brcmstb, there's a 100ms msleep(), and then a polling >>>>> for link up every 5ms - if the link was down and we msleep(5) I wonder >>>>> if that's triggering the same issue. >>>>> >>>>> Why that would manifest itself on 32-bit but not 64-bit Arm, I can't >>>>> say. I would imagine that the same hardware timer driver is being used >>>>> (may be worth checking DT.) The same should be true for the interrupt >>>>> driver as well. There's been no changes in that code. >>>> >>>> I just had it happen with ARM64 I was plagued by: >>>> >>>> https://lore.kernel.org/lkml/87wmqrjg8n.fsf@somnus/T/ >>>> >>>> and my earlier bisections somehow did not have ARM64 fail, so I thought it >>>> was immune but it fails with about the same failure rate as ARM 32-bit. >>> >>> Can you please boot with: >>> >>> trace_event=timer_migration,timer_start,timer_expire_entry,timer_cancel >>> >>> And add the following and give us the resulting output in dmesg? >> >> Here are two logs from two different systems that exposed the problem on >> boot: >> >> https://gist.github.com/ffainelli/f0834c52ef6320c9216d879ca29a4b81 >> https://gist.github.com/ffainelli/dc838883edb925a77d8eb34c0fe95be0 > > Thanks! Unfortunately like Thomas pointed out, I'm missing the timer_migration > events. My fault, can you retry with this syntax? > > trace_event=timer_migration:*,timer_start,timer_expire_entry,timer_cancel > > Though it's fairly possible that timer migration is not enabled at this point > as it's a late initcall. But we better not miss its traces otherwise. Here is another log with timer_migration: https://gist.github.com/ffainelli/237a5f9928850d6d8900d1f36da45aee -- Florian