diff mbox series

[v3,1/4] firmware: coreboot: Generate modalias uevent for devices

Message ID 20240117-coreboot-mod-defconfig-v3-1-049565a27bba@collabora.com (mailing list archive)
State Superseded
Headers show
Series Allow coreboot modules to autoload and enable cbmem in the arm64 defconfig | expand

Commit Message

Nícolas F. R. A. Prado Jan. 17, 2024, 7:03 p.m. UTC
Generate a modalias uevent for devices in the coreboot bus to allow
userspace to automatically load the corresponding modules.

Acked-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
 drivers/firmware/google/coreboot_table.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Tzung-Bi Shih Feb. 5, 2024, 1:37 a.m. UTC | #1
On Wed, Jan 17, 2024 at 04:03:22PM -0300, Nícolas F. R. A. Prado wrote:
> Generate a modalias uevent for devices in the coreboot bus to allow
> userspace to automatically load the corresponding modules.
>
> [...]

Applied, thanks!

[1/4] firmware: coreboot: Generate modalias uevent for devices
      commit: c6b0a4ceb7c9d8bb014d2967c97c8c7cbf60b006
Nícolas F. R. A. Prado Feb. 5, 2024, 2:13 p.m. UTC | #2
On Mon, Feb 05, 2024 at 09:37:29AM +0800, Tzung-Bi Shih wrote:
> On Wed, Jan 17, 2024 at 04:03:22PM -0300, Nícolas F. R. A. Prado wrote:
> > Generate a modalias uevent for devices in the coreboot bus to allow
> > userspace to automatically load the corresponding modules.
> >
> > [...]
> 
> Applied, thanks!
> 
> [1/4] firmware: coreboot: Generate modalias uevent for devices
>       commit: c6b0a4ceb7c9d8bb014d2967c97c8c7cbf60b006

Hi Tzung-Bi,

I was going to send a v4 with tag changed into 64 bit long as suggested by Greg:
https://lore.kernel.org/all/2024020105-dash-antiquity-a56b@gregkh

And that includes this commit, as the modalias field would need to be 16 hex
long.

But since you already merged this, would you prefer a change on top of this
making it 64 bit long, or do you want to keep it 32 bits?

Thanks,
Nícolas
Tzung-Bi Shih Feb. 6, 2024, 3:54 a.m. UTC | #3
On Mon, Feb 05, 2024 at 09:13:51AM -0500, Nícolas F. R. A. Prado wrote:
> On Mon, Feb 05, 2024 at 09:37:29AM +0800, Tzung-Bi Shih wrote:
> > On Wed, Jan 17, 2024 at 04:03:22PM -0300, Nícolas F. R. A. Prado wrote:
> > > Generate a modalias uevent for devices in the coreboot bus to allow
> > > userspace to automatically load the corresponding modules.
> > >
> > > [...]
> > 
> > Applied, thanks!
> > 
> > [1/4] firmware: coreboot: Generate modalias uevent for devices
> >       commit: c6b0a4ceb7c9d8bb014d2967c97c8c7cbf60b006
> 
> Hi Tzung-Bi,
> 
> I was going to send a v4 with tag changed into 64 bit long as suggested by Greg:
> https://lore.kernel.org/all/2024020105-dash-antiquity-a56b@gregkh
> 
> And that includes this commit, as the modalias field would need to be 16 hex
> long.
> 
> But since you already merged this, would you prefer a change on top of this
> making it 64 bit long, or do you want to keep it 32 bits?

Oops, I overlooked `u32` in the patch thus I thought the patch is indepedent.
Please go ahead to send v4 with 64 bit long tag.  I will drop
c6b0a4ceb7c9d8bb014d2967c97c8c7cbf60b006 from the queue.
diff mbox series

Patch

diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c
index 2a4469bf1b81..c1b9a9e8e8ed 100644
--- a/drivers/firmware/google/coreboot_table.c
+++ b/drivers/firmware/google/coreboot_table.c
@@ -53,11 +53,20 @@  static void coreboot_bus_remove(struct device *dev)
 		driver->remove(device);
 }
 
+static int coreboot_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
+{
+	struct coreboot_device *device = CB_DEV(dev);
+	u32 tag = device->entry.tag;
+
+	return add_uevent_var(env, "MODALIAS=coreboot:t%08X", tag);
+}
+
 static struct bus_type coreboot_bus_type = {
 	.name		= "coreboot",
 	.match		= coreboot_bus_match,
 	.probe		= coreboot_bus_probe,
 	.remove		= coreboot_bus_remove,
+	.uevent		= coreboot_bus_uevent,
 };
 
 static void coreboot_device_release(struct device *dev)