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 EEB6EC636D3 for ; Mon, 6 Feb 2023 20:53:46 +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:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bMBpMziac+/rp18MVEW1w/Ogg8Ypx7AMyBU7BQVsdpA=; b=m5ZExjiZybp8N9 qP/pB9J7qzCw8rmhCr1g4gzm5+8t8j28mRdok0AGhEL7D2+pnKROeVsVvfvZV0lRMgx+pa1/7Nhqd 8HGvJfvpuiEDspVxrXiaCQwVHUWuM0ig6IIklpi6GwZao2vY9RYBTQEJwOc2kUsr3i1Batk0qkH99 O1LW1g/1/qNXhGSMZGhaBVI85+l7HLDf4Vxg080cQyU+geeCMKHrFyz5NbMUex+D7DnWohQgtZJ8w Vqna0qQmM7lndxtPLVa9OBRUghVJf2nU8b2dg94KRXA8tib3trNk+5/hXNAXtm6pKpP9YzDsU0wlO kK071n360AMyw3pXeldw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pP8To-009uXf-Dg; Mon, 06 Feb 2023 20:52:48 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pP8Tj-009uVU-8W for linux-arm-kernel@lists.infradead.org; Mon, 06 Feb 2023 20:52:45 +0000 Received: from booty (unknown [77.244.183.192]) (Authenticated sender: luca.ceresoli@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 19C2AC0003; Mon, 6 Feb 2023 20:52:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1675716758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=prmY1sdOw0bhFLGxGD8Ft2qaDqoVwbMTn9dC7Z/uNN0=; b=VgVszzRmFCbNGirdnGdgX55toIvftKb+rLOsJAfRgzbD1rQ2dh9INwn9i3pxeo75g9LKjr tVm52onfwHwvTogom4B65Meus8OMWa62J16N6HYRiL/OZprm6+JDMObnbVnod0GSRdUPHk i4shuI7sSGY3z936nKr52uN9zOhJg20y93hzbZOBWAmcLLeBHdDlowgIX3ovU1oMmWVirQ 7aFy5ZyVpUuhpu05B8ts/iYFtCDnL+1o6KiRsdtir9KV3caAEhLzvnaUZmdx1bMFTCDEB2 v/Fgon/OKnVbO3AXK9dq3hBruFUhQK++0RjrK90xecxwXax7JaFkQpK1vQx0IQ== Date: Mon, 6 Feb 2023 21:52:33 +0100 From: Luca Ceresoli To: Johan Hovold Cc: Johan Hovold , Georgi Djakov , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Andy Gross , Bjorn Andersson , Konrad Dybcio , Sylwester Nawrocki , Artur =?UTF-8?Q?=C5=9Awigo=C5=84?= , Krzysztof Kozlowski , Alim Akhtar , Thierry Reding , Jonathan Hunter , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Leonard Crestez , Alexandre Bailon Subject: Re: [PATCH 04/23] interconnect: imx: fix registration race Message-ID: <20230206215233.66433c1a@booty> In-Reply-To: References: <20230201101559.15529-1-johan+linaro@kernel.org> <20230201101559.15529-5-johan+linaro@kernel.org> <20230203170121.187108bd@booty> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230206_125243_877132_3CAB6CA7 X-CRM114-Status: GOOD ( 26.71 ) 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 Hello Johan, On Mon, 6 Feb 2023 09:09:50 +0100 Johan Hovold wrote: > On Fri, Feb 03, 2023 at 05:01:21PM +0100, Luca Ceresoli wrote: > > Hello Johan, > > > > On Wed, 1 Feb 2023 11:15:40 +0100 > > Johan Hovold wrote: > > > > > The current interconnect provider registration interface is inherently > > > racy as nodes are not added until the after adding the provider. This > > > can specifically cause racing DT lookups to fail. > > > > > > Switch to using the new API where the provider is not registered until > > > after it has been fully initialised. > > > > > > Fixes: f0d8048525d7 ("interconnect: Add imx core driver") > > > Cc: stable@vger.kernel.org # 5.8 > > > Cc: Leonard Crestez > > > Cc: Alexandre Bailon > > > Signed-off-by: Johan Hovold > > > > Georgi pointed me to this series after I reported a bug yesterday [0], > > that I found on iMX8MP. So I ran some tests with my original, failing > > tree, minus one patch with my debugging code to hunt for the bug, plus > > patches 1-4 of this series. > > > > The original code was failing approx 5~10% of the times. With your 4 > > patches applied it ran 139 times with zero errors, which looks great! I > > won't be able to do more testing until next Monday to be extra sure. > > Thanks for testing. > > It indeed looks like you're hitting the same race, and as the imx > interconnect driver also initialises the provider data num_nodes count > before adding the nodes it results in that NULL-deref (where the qcom > driver failed a bit more gracefully). My v6.2-rc5 tree with patches 1 to 4 added has booted 590 times with 0 errors, which add to the 139 times on Friday. This definitely deserves my: Tested-by: Luca Ceresoli -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel