Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11800960rwl; Tue, 3 Jan 2023 05:04:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXuB540m9sEWH3ZNmjbiUgbj2lXoJ6YJIndN/fWIwr/n1oTE5SbjsO1cC7VuzOm167nGAg3P X-Received: by 2002:a05:6402:1759:b0:46c:f631:c0dc with SMTP id v25-20020a056402175900b0046cf631c0dcmr32986899edx.12.1672751088130; Tue, 03 Jan 2023 05:04:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672751088; cv=none; d=google.com; s=arc-20160816; b=ni7k8LOqbh3ge7fNqwHSLbnOGqZ+U+YHM8KLLIZKPKXApsnr1t+BDMzw/Icgcy2KHy 9KVVdF5waPzSZacCH174NIm1UGLtbn8XhqvZTPZt7wrHZ0Rf8AN4M6KNMoIPUFCVzPLX 88+W1OUj/59Z3YuM/cp0DAyTfvhsyoOgML8Zc3G5mUNjBV7KsdyT9FtnpfUB2LNMoaGK FgmFlOaXqTWYmg4UTmkP0Wtkf0QnUqfnRrhKWBWHdfKOnYTvxXoRBX6tpmcqbB62EX41 tTx7e0WeU7/5ZGf+AKkz7kYOROcnlGqsU7VabB8E9EbBr5G/uBdCjpjh0puXxcg9Tg2w 5Evg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=plP8eaSv4p/j58ARogbeHs6r9oV97TP6BjSF7TScfhs=; b=T5r1RpVhf6dMNPh06uiC9s8+P8BmTR4al/Y9J4Gt5s8gdCb2nuN5WuyStx4O1MKah/ vPIslSgNQVchuYwaWVzDTAGsjEQY2NUq9I/vodyWFheNldW0H2FX5TOux5iBT51CW+WN 659Ui5oe3F6U+MPGAjlNT+RYvvyoEj6vtwSS2X680ON7Uqy4+7aMeuIbvZ3tjf6kCVA7 Al26Ez2BcLskEsZbvPM9iVwVU9ayYCxMefChXdRO2hAVrt+1xZhmGTUURghIZeb9Cj6H SgGWONEV55oN2xNkwDvxUMWH5+0Fl4l5FNZhqYwkb7g8vMODvs2dV6qBh/mYUyoYXOSS yuUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nVLZVn/p"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b8-20020aa7d488000000b00473d8c56c90si23824413edr.139.2023.01.03.05.04.33; Tue, 03 Jan 2023 05:04:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nVLZVn/p"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237308AbjACMmy (ORCPT + 60 others); Tue, 3 Jan 2023 07:42:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231296AbjACMmw (ORCPT ); Tue, 3 Jan 2023 07:42:52 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D039DE8F for ; Tue, 3 Jan 2023 04:42:52 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id bs20so27195488wrb.3 for ; Tue, 03 Jan 2023 04:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=plP8eaSv4p/j58ARogbeHs6r9oV97TP6BjSF7TScfhs=; b=nVLZVn/pHpfIFNkof47FKj8345x3SEuBJ0dDD2IVs8+YZOYhaQnhorOr52T0KwnbSy Nn88cQqeqzheb1OoKCicrDnTesC8lhGpkwO0IJdvAc9kotJTsI6/hkU38OkTpwMQgxxN umN1KL/stn/CD0DDQRSQQ7L9y61nmMVIZjF481R8Uh8emIko5edFUnENWP1IpsxgDwX9 sVh8e6y6RiaTC9FEtm3ecuK1PsWigLBgNtRWZ4aby2XIDMFWxGTNxmjrBL9s/a6h0yb4 4wkx+jOak2QwyUV/7EiN3hhe9lTe0ebHmuXQ9CcC5+FTgM5AwqHuf/boFS35Zk7vKcge i+rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=plP8eaSv4p/j58ARogbeHs6r9oV97TP6BjSF7TScfhs=; b=U6lfp0F4HInjynkxz9B+gSaTgkT7dXMfzCkOgjQ7S0VH1ENqYX4NzuAz3PIh9Zi8kB 4prReI99+sIIteECJdc+peTgceITwD9XsPPNyr1GiNstqNWWCtfc5OgeUIwfIOWcMnmD O0dKM9/bMqnu8UIScU6EP0LV9UYtr08JoJEbMFPw7RAIXoA7yGkDPvtAoNy0glIQQu6Y tGbiLYFsXgTTcQXX3uKAfByABfdGbq8OJhUuK2+31NsBt0REc+sV/qVACKa1pTeIKfM9 LLy98CYkEY78j5tji6ZLXnx22ZAKTECNxsPoz8w3/0xRTNNipCx5bez4nxcXwpVWpDBk /yJQ== X-Gm-Message-State: AFqh2kolgkRCoAbAmwBwldjpXYBKfV6NieFrOF2+fbYha3m+DmuzF7CI qvargv8NnHdLM5JuGl+4E7ID5Q== X-Received: by 2002:adf:fb91:0:b0:27c:88f3:8cb8 with SMTP id a17-20020adffb91000000b0027c88f38cb8mr16569697wrr.25.1672749770648; Tue, 03 Jan 2023 04:42:50 -0800 (PST) Received: from [192.168.1.195] ([5.133.47.210]) by smtp.googlemail.com with ESMTPSA id l17-20020a056000023100b00241fab5a296sm30914509wrz.40.2023.01.03.04.42.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Jan 2023 04:42:49 -0800 (PST) Message-ID: Date: Tue, 3 Jan 2023 12:42:49 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] nvmem: fix registration vs use race Content-Language: en-US To: "Russell King (Oracle)" Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Hector Martin References: From: Srinivas Kandagatla In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/01/2023 11:46, Russell King (Oracle) wrote: > 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. I understand the backport issue, On the other hand as this a real issue backporting to atleast stable kernels would be worth. --srini >