mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Jens Axboe" <axboe@kernel.dk>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Dave Chinner" <dchinner@redhat.com>,
	"Matthew Wilcox" <willy@infradead.org>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Jan Kara" <jack@suse.cz>, "Damien Le Moal" <dlemoal@kernel.org>,
	"Ming Lei" <ming.lei@redhat.com>, "Min Li" <min15.li@samsung.com>,
	"Christian Loehle" <CLoehle@hyperstone.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Hannes Reinecke" <hare@suse.de>,
	"Jack Wang" <jinpu.wang@ionos.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Yeqi Fu" <asuk4.q@gmail.com>,
	"Avri Altman" <avri.altman@wdc.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Ye Bin" <yebin10@huawei.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	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
Date: Tue, 8 Aug 2023 02:02:36 +0100	[thread overview]
Message-ID: <ZNGULFxXpLT7zn35@makrotopia.org> (raw)
In-Reply-To: <CAPDyKFqhZtCHVmCNnm_Qm7X+=GtJY8uNJOWOgZXuTTVEw0msNA@mail.gmail.com>

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 <daniel@makrotopia.org> 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 <daniel@makrotopia.org>
> > ---
> >  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

  reply	other threads:[~2023-08-08  1:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 22:01 [RFC PATCH 0/6] nvmem: add block device NVMEM provider Daniel Golle
2023-07-19 22:02 ` [RFC PATCH 1/6] mmc: core: set card fwnode_handle Daniel Golle
2023-07-19 22:02 ` [RFC PATCH 2/6] mmc: block: set fwnode of disk devices Daniel Golle
2023-08-07 13:48   ` Ulf Hansson
2023-08-08  1:02     ` Daniel Golle [this message]
2023-08-08 10:59       ` Ulf Hansson
2023-07-19 22:03 ` [RFC PATCH 3/6] block: add new genhd flag GENHD_FL_NO_NVMEM Daniel Golle
2023-07-20  8:24   ` Hannes Reinecke
2023-07-20 13:47     ` Daniel Golle
2023-07-20 14:03       ` Hannes Reinecke
2023-07-20 14:28         ` Daniel Golle
2023-07-20 14:34           ` Hannes Reinecke
2023-07-19 22:03 ` [RFC PATCH 4/6] mtd: blkdevs: set GENHD_FL_NO_NVMEM Daniel Golle
2023-07-20  6:04   ` Miquel Raynal
2023-07-19 22:03 ` [RFC PATCH 5/6] mtd: ubi: block: " Daniel Golle
2023-07-19 22:04 ` [RFC PATCH 6/6] block: implement NVMEM provider Daniel Golle
2023-07-19 23:04   ` Damien Le Moal
2023-07-20  0:14     ` Daniel Golle
2023-07-20  7:04   ` Christoph Hellwig
2023-07-20 16:02     ` Daniel Golle
2023-07-21  6:31       ` Christoph Hellwig
2023-07-21 10:40         ` Daniel Golle
2023-07-21 11:11           ` Greg Kroah-Hartman
2023-07-21 11:30             ` Daniel Golle
2023-07-21 11:39               ` Greg Kroah-Hartman
2023-07-21 13:03                 ` Daniel Golle
2023-07-21  6:35   ` Christoph Hellwig
2023-07-21 13:31     ` Daniel Golle
2023-07-20  7:09 ` [RFC PATCH 0/6] nvmem: add block device " Christoph Hellwig
2023-07-20 15:30 ` Bart Van Assche
2023-07-20 18:03   ` Daniel Golle
2023-07-21  8:32 ` Ming Lei
2023-07-21 11:08   ` Daniel Golle
2023-07-21 11:10   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZNGULFxXpLT7zn35@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=CLoehle@hyperstone.com \
    --cc=adrian.hunter@intel.com \
    --cc=asuk4.q@gmail.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=dchinner@redhat.com \
    --cc=dlemoal@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.de \
    --cc=hdegoede@redhat.com \
    --cc=jack@suse.cz \
    --cc=jinpu.wang@ionos.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux@weissschuh.net \
    --cc=min15.li@samsung.com \
    --cc=ming.lei@redhat.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=ulf.hansson@linaro.org \
    --cc=vigneshr@ti.com \
    --cc=willy@infradead.org \
    --cc=yebin10@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome