stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] nvmem: layouts: fix automatic module loading
@ 2025-08-19 11:21 Michael Walle
  2025-08-24 16:10 ` Miquel Raynal
  2025-09-04  7:47 ` Srinivas Kandagatla
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Walle @ 2025-08-19 11:21 UTC (permalink / raw)
  To: Srinivas Kandagatla, Miquel Raynal, Greg Kroah-Hartman
  Cc: linux-kernel, Michael Walle, stable

To support loading of a layout module automatically the MODALIAS
variable in the uevent is needed. Add it.

Fixes: fc29fd821d9a ("nvmem: core: Rework layouts to become regular devices")
Cc: stable@vger.kernel.org
Signed-off-by: Michael Walle <mwalle@kernel.org>
---
I'm still not sure if the sysfs modalias file is required or not. It
seems to work without it. I could't find any documentation about it.

v2:
 - add Cc: stable
---
 drivers/nvmem/layouts.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/nvmem/layouts.c b/drivers/nvmem/layouts.c
index 65d39e19f6ec..f381ce1e84bd 100644
--- a/drivers/nvmem/layouts.c
+++ b/drivers/nvmem/layouts.c
@@ -45,11 +45,24 @@ static void nvmem_layout_bus_remove(struct device *dev)
 	return drv->remove(layout);
 }
 
+static int nvmem_layout_bus_uevent(const struct device *dev,
+				   struct kobj_uevent_env *env)
+{
+	int ret;
+
+	ret = of_device_uevent_modalias(dev, env);
+	if (ret != ENODEV)
+		return ret;
+
+	return 0;
+}
+
 static const struct bus_type nvmem_layout_bus_type = {
 	.name		= "nvmem-layout",
 	.match		= nvmem_layout_bus_match,
 	.probe		= nvmem_layout_bus_probe,
 	.remove		= nvmem_layout_bus_remove,
+	.uevent		= nvmem_layout_bus_uevent,
 };
 
 int __nvmem_layout_driver_register(struct nvmem_layout_driver *drv,
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] nvmem: layouts: fix automatic module loading
  2025-08-19 11:21 [PATCH v2] nvmem: layouts: fix automatic module loading Michael Walle
@ 2025-08-24 16:10 ` Miquel Raynal
  2025-09-04  7:47 ` Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2025-08-24 16:10 UTC (permalink / raw)
  To: Michael Walle
  Cc: Srinivas Kandagatla, Greg Kroah-Hartman, linux-kernel, stable

Hello,

On 19/08/2025 at 13:21:03 +02, Michael Walle <mwalle@kernel.org> wrote:

> To support loading of a layout module automatically the MODALIAS
> variable in the uevent is needed. Add it.
>
> Fixes: fc29fd821d9a ("nvmem: core: Rework layouts to become regular devices")
> Cc: stable@vger.kernel.org
> Signed-off-by: Michael Walle <mwalle@kernel.org>
> ---
> I'm still not sure if the sysfs modalias file is required or not. It
> seems to work without it. I could't find any documentation about it.

I do not recall how this worked on my side, nor if it actually did with
the latest version (there's been a version where module loading was
requested in kernel code, and this was working well with an initamfs
IIRC), but that change sound reasonable.

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] nvmem: layouts: fix automatic module loading
  2025-08-19 11:21 [PATCH v2] nvmem: layouts: fix automatic module loading Michael Walle
  2025-08-24 16:10 ` Miquel Raynal
@ 2025-09-04  7:47 ` Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2025-09-04  7:47 UTC (permalink / raw)
  To: Miquel Raynal, Greg Kroah-Hartman, Michael Walle; +Cc: linux-kernel, stable


On Tue, 19 Aug 2025 13:21:03 +0200, Michael Walle wrote:
> To support loading of a layout module automatically the MODALIAS
> variable in the uevent is needed. Add it.
> 
> 

Applied, thanks!

[1/1] nvmem: layouts: fix automatic module loading
      commit: cc6f2b728cd06402127fb24df3c1c0e6f48c80c4

Best regards,
-- 
Srinivas Kandagatla <srini@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-04  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 11:21 [PATCH v2] nvmem: layouts: fix automatic module loading Michael Walle
2025-08-24 16:10 ` Miquel Raynal
2025-09-04  7:47 ` Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).