[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zn6rU-mCYQcyCkGT@makrotopia.org>
Date: Fri, 28 Jun 2024 13:23:47 +0100
From: Daniel Golle <daniel@...rotopia.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>, Jens Axboe <axboe@...nel.dk>,
Hauke Mehrtens <hauke@...ke-m.de>, Felix Fietkau <nbd@....name>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Dave Chinner <dchinner@...hat.com>, Jan Kara <jack@...e.cz>,
Christian Brauner <brauner@...nel.org>,
Thomas Weißschuh <linux@...ssschuh.net>,
Al Viro <viro@...iv.linux.org.uk>,
Li Lingfeng <lilingfeng3@...wei.com>,
Christian Heusel <christian@...sel.eu>,
Min Li <min15.li@...sung.com>, Avri Altman <avri.altman@....com>,
Adrian Hunter <adrian.hunter@...el.com>,
Hannes Reinecke <hare@...e.de>,
Mikko Rapeli <mikko.rapeli@...aro.org>, Yeqi Fu <asuk4.q@...il.com>,
Victor Shih <victor.shih@...esyslogic.com.tw>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Li Zhijian <lizhijian@...itsu.com>,
"Ricardo B. Marliere" <ricardo@...liere.net>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mmc@...r.kernel.org, linux-block@...r.kernel.org
Subject: Re: [PATCH v4 3/4] block: add support for notifications
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
Powered by blists - more mailing lists