public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Jens Axboe" <axboe@kernel.dk>,
	"Hauke Mehrtens" <hauke@hauke-m.de>,
	"Felix Fietkau" <nbd@nbd.name>,
	"Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
	"Dave Chinner" <dchinner@redhat.com>, "Jan Kara" <jack@suse.cz>,
	"Christian Brauner" <brauner@kernel.org>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Al Viro" <viro@zeniv.linux.org.uk>,
	"Li Lingfeng" <lilingfeng3@huawei.com>,
	"Christian Heusel" <christian@heusel.eu>,
	"Min Li" <min15.li@samsung.com>,
	"Avri Altman" <avri.altman@wdc.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Hannes Reinecke" <hare@suse.de>,
	"Mikko Rapeli" <mikko.rapeli@linaro.org>,
	"Yeqi Fu" <asuk4.q@gmail.com>,
	"Victor Shih" <victor.shih@genesyslogic.com.tw>,
	"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
	"Li Zhijian" <lizhijian@fujitsu.com>,
	"Ricardo B. Marliere" <ricardo@marliere.net>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH v4 3/4] block: add support for notifications
Date: Fri, 28 Jun 2024 13:23:47 +0100	[thread overview]
Message-ID: <Zn6rU-mCYQcyCkGT@makrotopia.org> (raw)
In-Reply-To: <Zn4_-alKtxuZ6zNt@infradead.org>

On Thu, Jun 27, 2024 at 09:45:45PM -0700, Christoph Hellwig wrote:
> On Thu, Jun 27, 2024 at 09:50:50PM +0100, Daniel Golle wrote:
> > Add notifier block to notify other subsystems about the addition or
> > removal of block devices.
> 
> Notification for what?  I really hate the concept of random modular
> code being able to hook into device discovery / partition scanning.

Adding a dedicated notification interface (instead of using block
internals in the nvmem driver) has been requested in a previous review
by Bart Van Assche:

https://patchwork.kernel.org/comment/25771998/

Quote from that previous review comment:
>>> Why to add this functionality to the block layer instead of somewhere
>>> in the drivers/ directory?
>> 
>> Simply because we need notifications about appearing and disappearing
>> block devices, or a way to iterate over all block devices in a system.
>> For both there isn't currently any other interface than using a
>> class_interface for that, and that requires access to &block_class
>> which is considered a block subsystem internal.
>
> That's an argument for adding an interface to the block layer that
> implements this functionality but not for adding this code in the block
> layer.
---

So that's what I did consequently. Using the notification interface
the NVMEM driver can live in drivers/nvmem/ and doesn't need to be
using block internals.

> And not actually having a user for it is a complete no-go.
> 

The user will be the nvmem provider, you can see the code in earlier
versions of the patchset where I had included it:

https://patchwork.kernel.org/project/linux-block/patch/96554d6b4d9fa72f936c2c476eb0b023cdd60a64.1717031992.git.daniel@makrotopia.org/

Being another subsystem I thought it'd be better to deal with the
block related things first, and once that has been sorted out I will
move on to add the NVMEM driver and make the necessary changes for
using it on eMMC.


Thank you for taking a look at this. Let me know if anything else
is not clear or needs to be changed.


Cheers


Daniel

  reply	other threads:[~2024-06-28 12:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 20:49 [PATCH v4 0/4] block: preparations for NVMEM provider Daniel Golle
2024-06-27 20:50 ` [PATCH v4 1/4] dt-bindings: block: add basic bindings for block devices Daniel Golle
2024-06-27 20:50 ` [PATCH v4 2/4] block: partitions: populate fwnode Daniel Golle
2024-06-28  4:44   ` Christoph Hellwig
2024-06-28 12:16     ` Daniel Golle
2024-06-28 12:41       ` Christoph Hellwig
2024-06-27 20:50 ` [PATCH v4 3/4] block: add support for notifications Daniel Golle
2024-06-28  4:45   ` Christoph Hellwig
2024-06-28 12:23     ` Daniel Golle [this message]
2024-06-28 12:50       ` Christoph Hellwig
2024-06-28 14:00         ` Daniel Golle
2024-07-01  5:54           ` Christoph Hellwig
2024-06-27 20:51 ` [PATCH v4 4/4] block: add new genhd flag GENHD_FL_NVMEM Daniel Golle
2024-06-27 22:15 ` [PATCH v4 0/4] block: preparations for NVMEM provider Jens Axboe

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=Zn6rU-mCYQcyCkGT@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=adrian.hunter@intel.com \
    --cc=asuk4.q@gmail.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=christian@heusel.eu \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=conor+dt@kernel.org \
    --cc=dchinner@redhat.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hare@suse.de \
    --cc=hauke@hauke-m.de \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=krzk+dt@kernel.org \
    --cc=lilingfeng3@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=lizhijian@fujitsu.com \
    --cc=mikko.rapeli@linaro.org \
    --cc=min15.li@samsung.com \
    --cc=nbd@nbd.name \
    --cc=ricardo@marliere.net \
    --cc=robh@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=ulf.hansson@linaro.org \
    --cc=victor.shih@genesyslogic.com.tw \
    --cc=viro@zeniv.linux.org.uk \
    /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