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 AE39EC46467 for ; Tue, 3 Jan 2023 14:01:55 +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:In-Reply-To:MIME-Version:References: 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=EJrXHQrRXJNgR+j840zLfOrZsYZmqswVzZXTSoOMfSQ=; b=cfdx5GvzN7Xkp3 HOFMEpj+485eKAAIi5ulAxM8G+weZffqLdugCilO949qMCPUDYgUsgEKmC+apJq+TX3h5FJGStR+J Sz6T6YEm0USV3/kGO4JFIEkujPoTdTcvGjuOPI0a6IA/5FTZ7uFqSNq7P8to75rwwkAfmmfYK7ueo qIvMO0FZQ+9T1dKFuwH1ZWwwLv31DLIuu2Cyf+RBX1zxaG/yH217l12qMwxgaEGaCAmRDrT30VmGl wBXaHom0aIRqk/n2CZ0SUCDolewa03gEQMEvu1DIC1056LmDLD6o4oTn3Mu+fADVQqbMCWOGohRMZ WvZU5cghZsy95TuiPIwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pChpp-001kcL-7Y; Tue, 03 Jan 2023 14:00:10 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCfkL-0012f5-TT for linux-arm-kernel@lists.infradead.org; Tue, 03 Jan 2023 11:46:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zbzYgDF4K+r+TpM4DRrnLWpGsS46VZmZwN2Hl2Ix+Gk=; b=HeVwX6+PGa+Ddj1+IYOEjcaQYg ytPGw7kbv7HCjYSjqtlGJQAdxwjiQsCTzxaocv0mx122FyLuABGQNVAlERzXj1AQgIdEjIg1MCItn KdiyyHoUml1hQnDgiwCNsm8PLED0JmZDNKqm1SuxAMrqrZkSYS2LIKba1jKnIiTV1dI1lhsHM6d+1 MjBXI8EhuIuhDx35MJVYJRYlKKGdZ6aDN7c04Qm5gxEAU66cvb8W9wHNJDvUk/YyTX2aDxfjf19+T 6nspgoPOgpBRU86Fl8pyd/Rwo0x05UWJ1TFgIdmcLfVoQxRj9BOGznnACGeMgEaxdmlA6giwah/UQ 9mzouETw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35924) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pCfkH-0005GS-Sg; Tue, 03 Jan 2023 11:46:17 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pCfkF-00022U-Qd; Tue, 03 Jan 2023 11:46:15 +0000 Date: Tue, 3 Jan 2023 11:46:15 +0000 From: "Russell King (Oracle)" To: Srinivas Kandagatla Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Hector Martin Subject: Re: [PATCH] nvmem: fix registration vs use race Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230103_034622_085195_6A528B55 X-CRM114-Status: GOOD ( 17.55 ) 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, Jan 03, 2023 at 11:30:36AM +0000, Srinivas Kandagatla wrote: > > > On 03/01/2023 09:42, Russell King (Oracle) wrote: > > The i.MX6 CPU frequency driver sometimes fails to register at boot time > > due to nvmem_cell_read_u32() sporadically returning -ENOENT. > > > > This happens because there is a window where __nvmem_device_get() in > > of_nvmem_cell_get() is able to return the nvmem device, but as cells > > have been setup, nvmem_find_cell_entry_by_node() returns NULL. > > > > The occurs because the nvmem core registration code violates one of the > > fundamental principles of kernel programming: do not publish data > > structures before their setup is complete. > > > > Fix this by making nvmem core code conform with this principle. > > > how about a Fixes tag and Cc stable? Which commit do you suggest? This error goes all the way back to the inception of nvmem, commit eace75cfdcf7 ("nvmem: Add a simple NVMEM framework for nvmem providers") but clearly its going to be a lot of effort to backport it all the way due to all the changes. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel