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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2220DEB64DD for ; Tue, 8 Aug 2023 01:03:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229990AbjHHBDn (ORCPT ); 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: Precedence: bulk List-ID: X-Mailing-List: linux-block@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