Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3698937rwb; Mon, 7 Aug 2023 19:10:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUU/xdGf4cXaHMcS5eCZ63srRiWpipwML/mo5eLr8IWc4SiGDnzczCc4ON9N491ef2HEZP X-Received: by 2002:a05:6402:643:b0:522:595f:5a29 with SMTP id u3-20020a056402064300b00522595f5a29mr8980026edx.29.1691460612368; Mon, 07 Aug 2023 19:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691460612; cv=none; d=google.com; s=arc-20160816; b=xg9Eg9SnpR7u/U0mYelVCNrloA/jTT7qqKUo54Ku9jzdFu5ttwL4XWQksug/fu6+rx 2ic9E2+Jj2YTircMYhDZYQjkXWo28BCQ0qjtQIcpxl7oAlF+//+1dxQSu4GfEUMx2r7l z6NAVIeCoS43qOSKugHL216Pe2yXsOdnBlgOKya8PU0hU+XT7/1ZnDVt60vX2+iFehG0 HpDc9w8yDNnpgjCsjNFbLtdRQSKGtKGw1aPvo2y6DZTw6FZWvASPTXkaEPa53O3GmJvj 4OhvWsxtH/vDOpYzZpwkqz24fZxGMYOPEQoVsoe8O58QVSdlz0yncoBUBTMOeOwRrZKb s7tQ== 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; bh=lrUHGowuByusUiAlGo1vlOFmDohjXDBGNpzspTtVc3w=; fh=KyuDpWcAAV6aXvPbHYSSTSDQR3uruqsBL6lVsrVJAPA=; b=CkBHrTIr+tGSkkT+LsASLpyh+f/iVYmrMRERUb9q4aNMyikiM07ZHNJ/iQAbsmN4G+ Hlhb+mJ9RQuWnjE/q+4E1DLLz6evuNGk95LrvnqaNxDttwbumIIPyf7xa/PiNaabDPHk I7ZxjkelsNu9SEYOymGb+ocOBhivVcWYovbP03H15vYp03ErDfYPxhYThp49vTJ34jZp kLsYb/oPz51/YsUauFuoF6N/JGk/9ONkFw53XcZ/fbCuicOgVpGVnRXME+h8ktg/GFH7 boY4tVF3UGZLfFnVLAi53XJBwVo2ATdhlV1N8iIPh7va7xVZvzsIP9CZyzzrPRib7CHZ JLSA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c25-20020a056402121900b0052337f4212bsi2189147edw.108.2023.08.07.19.09.48; Mon, 07 Aug 2023 19:10:12 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230310AbjHHBDn (ORCPT + 99 others); Mon, 7 Aug 2023 21:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjHHBDm (ORCPT ); Mon, 7 Aug 2023 21:03:42 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF7A9E; Mon, 7 Aug 2023 18:03:37 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qTB7X-0002x3-0M; Tue, 08 Aug 2023 01:02:47 +0000 Date: Tue, 8 Aug 2023 02:02:36 +0100 From: Daniel Golle To: Ulf Hansson Cc: Jens Axboe , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dave Chinner , Matthew Wilcox , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Jan Kara , Damien Le Moal , Ming Lei , Min Li , Christian Loehle , Adrian Hunter , Hannes Reinecke , Jack Wang , Florian Fainelli , Yeqi Fu , Avri Altman , Hans de Goede , Ye Bin , Greg Kroah-Hartman , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org Subject: Re: [RFC PATCH 2/6] mmc: block: set fwnode of disk devices Message-ID: References: <1ce5f56df546cec25ef741f381286f1d7c33d000.1689802933.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 Hi Ulf, thank you for reviewing and suggesting ways to improve this series! On Mon, Aug 07, 2023 at 03:48:31PM +0200, Ulf Hansson wrote: > On Thu, 20 Jul 2023 at 00:02, Daniel Golle wrote: > > > > Set fwnode of disk devices to 'block', 'boot0' and 'boot1' subnodes of > > the mmc-card. This is done in preparation for having the eMMC act as > > NVMEM provider. > > Sorry, but I don't quite understand what you are trying to do here. > Maybe you should re-order the patches in the series so it becomes > clear why this is needed? > > Moreover, I don't see any DT docs being updated as a part of the > series, which looks like it is needed too. That would also help to > understand what you are proposing, I think. I've prepared a tree on Github which now also includes commits adding dt-bindings for block devices and partitions, so they can be referenced as nvmem-cells provider. The dt-schema addition supposedly explaining this specific patch: https://github.com/dangowrt/linux/commit/b399a758f0e1c444ae9443dc80902a30de54af09 The whole tree: https://github.com/dangowrt/linux/commits/for-nvmem-next Most comments have been addressed, however, I still depend on using either a class_interface *or* adding calls to add/remove the NVMEM representation of a block device to block/genhd.c as well as block/partitions/core.c, simply because afaik there isn't any better way for in-kernel users of block devices to be notified about the creation or removal of a block device. Cheers Daniel > > > > > Signed-off-by: Daniel Golle > > --- > > drivers/mmc/core/block.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c > > index f701efb1fa785..fc1a9f31bd253 100644 > > --- a/drivers/mmc/core/block.c > > +++ b/drivers/mmc/core/block.c > > @@ -2413,6 +2413,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, > > int area_type, > > unsigned int part_type) > > { > > + struct fwnode_handle *fwnode; > > + struct device *ddev; > > struct mmc_blk_data *md; > > int devidx, ret; > > char cap_str[10]; > > @@ -2509,6 +2511,12 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, > > > > blk_queue_write_cache(md->queue.queue, cache_enabled, fua_enabled); > > > > + ddev = disk_to_dev(md->disk); > > + fwnode = device_get_named_child_node(subname ? md->parent->parent : > > + md->parent, > > + subname ? subname : "block"); > > + ddev->fwnode = fwnode; > > + > > string_get_size((u64)size, 512, STRING_UNITS_2, > > cap_str, sizeof(cap_str)); > > pr_info("%s: %s %s %s%s\n", > > Kind regards > Uffe