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 45D53C636D3 for ; Thu, 2 Feb 2023 12:20:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231947AbjBBMUR (ORCPT ); Thu, 2 Feb 2023 07:20:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbjBBMUO (ORCPT ); Thu, 2 Feb 2023 07:20:14 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05B42712EB; Thu, 2 Feb 2023 04:20:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 900AA61ACE; Thu, 2 Feb 2023 12:20:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E94DCC433EF; Thu, 2 Feb 2023 12:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675340413; bh=Iu4SRBv/XGBIyCipvjboRwtueCLMzab7wCfd98i5Txw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LfydaXq5cTREFVyWdPGhp365lC24c+1mbbJdDa6tHNvIdiydx/tnFOjOXhxmdRdM4 348TA97WB/KW8+RcgskKxVf4g63JOinuhzrY/nRwpIPOkmdSRYlsbom8f1PSjdH5Xu UTlKALBcubrbaAlD5dAUVmTCowTupZHlTaeeNPlgHJKkmHQQsNqKUndaQXQx5Fr2To YeGNjz3j1b6kgQ+4Xsrwa+B/+Tvslsjn4PGvNO3Z8Dwibckk56CIKrGJNpS6rAPyES abOjDid9ozHxrZpcsL1KWaJPGWzC7FvVcnwc1QauXfSQfD6HCqZPVyAYkmuR1vWKfj EoA3vXrmlI4pQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pNYZw-0001Ve-ST; Thu, 02 Feb 2023 13:20:36 +0100 Date: Thu, 2 Feb 2023 13:20:36 +0100 From: Johan Hovold To: Krzysztof Kozlowski 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?B?xZp3aWdvxYQ=?= , 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 Subject: Re: [PATCH 00/23] interconnect: fix racy provider registration Message-ID: References: <20230201101559.15529-1-johan+linaro@kernel.org> <57dbcbc6-b497-53db-5a45-abce0e4dcf37@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57dbcbc6-b497-53db-5a45-abce0e4dcf37@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 02, 2023 at 12:13:33PM +0100, Krzysztof Kozlowski wrote: > On 01/02/2023 11:15, Johan Hovold wrote: > > The current interconnect provider interface is inherently racy as > > providers are expected to be registered before being fully initialised. > > > > This can specifically cause racing DT lookups to fail as I recently > > noticed when the Qualcomm cpufreq driver failed to probe: > > > > of_icc_xlate_onecell: invalid index 0 > > cpu cpu0: error -EINVAL: error finding src node > > cpu cpu0: dev_pm_opp_of_find_icc_paths: Unable to get path0: -22 > > qcom-cpufreq-hw: probe of 18591000.cpufreq failed with error -22 > > > > This only happens very rarely, but the bug is easily reproduced by > > increasing the race window by adding an msleep() after registering > > osm-l3 interconnect provider. > > > > Note that the Qualcomm cpufreq driver is especially susceptible to this > > race as the interconnect path is looked up from the CPU nodes so that > > driver core does not guarantee the probe order even when device links > > are enabled (which they not always are). > > > > This series adds a new interconnect provider registration API which is > > used to fix up the interconnect drivers before removing the old racy > > API. > > > > So is there a dependency or not? Can you make it clear that I shouldn't > take memory controller bits? As the fixes depend on the new API it is best if these could all go through Georgi's tree. Johan