Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1209761rdb; Mon, 2 Oct 2023 02:35:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwQCCqsLWAo0ubQE2CNpcJU/tLA1MkrzwTDcGOahnONrZCVEMjw5BHSJj1xyENYyPtTOqA X-Received: by 2002:a17:90a:5217:b0:274:9409:bbca with SMTP id v23-20020a17090a521700b002749409bbcamr8226086pjh.3.1696239321742; Mon, 02 Oct 2023 02:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696239321; cv=none; d=google.com; s=arc-20160816; b=ajsAS5FqeXJhambm4ZejJMmUM2EIP3bsEJg+wmFmZjHCbwOeuWMpiF3HC2DV55tz0M J1xR4TcwfFnC6CJbRjhffVoAtccKRwANFnR+4b2l6njJjPMNrt/SUNo0Bdz24MEmSOCE /I6Ta6fH/ZuYAI276KKNAHHc6i93OEaQJyTXKm2yXvICEiDXKKez7p8XrDC7Qzsbhd8w kjCUWoVu/Ze0zTV9DKSH8h7XRdB0j0SF8zPgDoS3nD3wNnM5OvvdX7vDRHLMT4FJsil9 05plLcczsj9RFNB+vmZ09wAB7Pfzw89HD/bVVOL4s730ZVe1NdInuNM4cnlymwD+mTHD o6Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qSYu/L9aRzMG608m7/YdM+c67CowJuA6ZWDEgC4jJ6I=; fh=6djUn4IC+6n0Ghby7peXAAsC4xiB+bCVVHbKX4cRRqE=; b=T+N5w4+zHvJ7OwL2s7FWslL4jHgbweP9M+2SMmZBW8VkYGNnKaSeOogdqCC08jIR17 bFRBMBHoE9By25wTiImGeoiSHA+Dr0ZUvotcmgLUs8fRUWCKOlPFbsAUUQnnGGREXgl3 h1uNkejRwvq2JEAWrmr+qZrXvUpGmo2Itnb8e26U7K3l4brVb2aJOzacH3OQ84cEihaC 12XnFAq40obkjmyPz4z3GMc6Y7EwG0I5Ny0J+b0X+FhvjkQpsJfggGsE33H4Wf23A2ef aBUtl1Pb8LyC693cYMAQxa6pvWEhtZ5fvJjmTsrrGtoekJcMIzvR1+1O+COATv7bsKcZ pnpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W2HtDzXu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id jb20-20020a17090b409400b002772f04f9bfsi7087470pjb.113.2023.10.02.02.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 02:35:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W2HtDzXu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id EF24F802FA70; Mon, 2 Oct 2023 02:35:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236092AbjJBJfK (ORCPT + 99 others); Mon, 2 Oct 2023 05:35:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230459AbjJBJfJ (ORCPT ); Mon, 2 Oct 2023 05:35:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82DC891 for ; Mon, 2 Oct 2023 02:35:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC250C433C7; Mon, 2 Oct 2023 09:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696239305; bh=dnFTdFOeagWaBjtPe10DLkl9Q4FvdlXBuptRNi7f1Co=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W2HtDzXu4yOZbQ2AFnAcl/zCHHLxln8B/vd/0FptfV1dKTGOdS0Edm4RggU+VF74U zE9POEtYaZ+J45iLWkBdchlSprJVOky94tjUrFD/FKXXVwDu+I5+RuqtyIh173wQ67 nMahuGSlY81z+9tHkhIVFGOv5LRccRcJFv1pGJCU= Date: Mon, 2 Oct 2023 11:35:02 +0200 From: Greg Kroah-Hartman To: Miquel Raynal Cc: Srinivas Kandagatla , Michael Walle , Thomas Petazzoni , Robert Marko , Luka Perkov , linux-kernel@vger.kernel.org, Randy Dunlap , Chen-Yu Tsai , Daniel Golle , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Subject: Re: [PATCH v10 1/3] nvmem: core: Rework layouts to become platform devices Message-ID: <2023100200-snowcap-arena-a548@gregkh> References: <20230922174854.611975-1-miquel.raynal@bootlin.com> <20230922174854.611975-2-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230922174854.611975-2-miquel.raynal@bootlin.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 02 Oct 2023 02:35:19 -0700 (PDT) On Fri, Sep 22, 2023 at 07:48:52PM +0200, Miquel Raynal wrote: > Current layout support was initially written without modules support in > mind. When the requirement for module support rose, the existing base > was improved to adopt modularization support, but kind of a design flaw > was introduced. With the existing implementation, when a storage device > registers into NVMEM, the core tries to hook a layout (if any) and > populates its cells immediately. This means, if the hardware description > expects a layout to be hooked up, but no driver was provided for that, > the storage medium will fail to probe and try later from > scratch. Technically, the layouts are more like a "plus" and, even we > consider that the hardware description shall be correct, we could still > probe the storage device (especially if it contains the rootfs). > > One way to overcome this situation is to consider the layouts as > devices, and leverage the existing notifier mechanism. When a new NVMEM > device is registered, we can: > - populate its nvmem-layout child, if any > - try to modprobe the relevant driver, if relevant > - try to hook the NVMEM device with a layout in the notifier > And when a new layout is registered: > - try to hook all the existing NVMEM devices which are not yet hooked to > a layout with the new layout > This way, there is no strong order to enforce, any NVMEM device creation > or NVMEM layout driver insertion will be observed as a new event which > may lead to the creation of additional cells, without disturbing the > probes with costly (and sometimes endless) deferrals. > > Signed-off-by: Miquel Raynal Did I miss why these were decided to be platform devices and not normal devices on their own "bus" that are attached to the parent device properly? Why platform for a dynamic thing? If I did agree with this, it should be documented here in the changelog why this is required to be this way so I don't ask the question again in the future :) thanks, greg k-h