* [PATCH v3] coreboot_table: skip failing entries instead of aborting populate
@ 2026-05-01 9:43 Titouan Ameline de Cadeville
2026-05-01 20:54 ` Brian Norris
2026-05-03 1:42 ` Tzung-Bi Shih
0 siblings, 2 replies; 3+ messages in thread
From: Titouan Ameline de Cadeville @ 2026-05-01 9:43 UTC (permalink / raw)
To: jwerner
Cc: tzungbi, briannorris, chrome-platform, linux-kernel,
Titouan Ameline de Cadeville
coreboot_table_populate() registers devices one by one. If
device_register() fails for one entry, the current code returns
immediately, leaving previously registered devices orphaned on the
coreboot bus with no cleanup path.
Since coreboot table entries are independent of each other, a failure
on one entry should not prevent the others from being registered.
This mirrors the strategy used by of_platform_populate(), which skips
individual failures rather than aborting.
Move ptr_entry increment before device_register(), log a warning on
failure, and continue the loop rather than aborting.
Signed-off-by: Titouan Ameline de Cadeville <titouan.ameline@gmail.com>
---
v3: move ptr_entry increment before device_register() to avoid
re-processing the same entry on failure (reported by Brian Norris)
v2: continue the loop on failure instead of unregistering all devices
(suggested by Julius Werner, with reference to of_platform_populate()
from Brian Norris)
drivers/firmware/google/coreboot_table.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c
index c769631ea15d..a797ed1db161 100644
--- a/drivers/firmware/google/coreboot_table.c
+++ b/drivers/firmware/google/coreboot_table.c
@@ -148,13 +148,13 @@ static int coreboot_table_populate(struct device *dev, void *ptr)
break;
}
+ ptr_entry += entry->size;
+
ret = device_register(&device->dev);
if (ret) {
+ dev_warn(dev, "failed to register coreboot device: %d\n", ret);
put_device(&device->dev);
- return ret;
}
-
- ptr_entry += entry->size;
}
return 0;
--
2.44.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] coreboot_table: skip failing entries instead of aborting populate
2026-05-01 9:43 [PATCH v3] coreboot_table: skip failing entries instead of aborting populate Titouan Ameline de Cadeville
@ 2026-05-01 20:54 ` Brian Norris
2026-05-03 1:42 ` Tzung-Bi Shih
1 sibling, 0 replies; 3+ messages in thread
From: Brian Norris @ 2026-05-01 20:54 UTC (permalink / raw)
To: Titouan Ameline de Cadeville
Cc: jwerner, tzungbi, chrome-platform, linux-kernel
On Fri, May 01, 2026 at 11:43:22AM +0200, Titouan Ameline de Cadeville wrote:
> coreboot_table_populate() registers devices one by one. If
> device_register() fails for one entry, the current code returns
> immediately, leaving previously registered devices orphaned on the
> coreboot bus with no cleanup path.
>
> Since coreboot table entries are independent of each other, a failure
> on one entry should not prevent the others from being registered.
> This mirrors the strategy used by of_platform_populate(), which skips
> individual failures rather than aborting.
>
> Move ptr_entry increment before device_register(), log a warning on
> failure, and continue the loop rather than aborting.
>
> Signed-off-by: Titouan Ameline de Cadeville <titouan.ameline@gmail.com>
Acked-by: Brian Norris <briannorris@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] coreboot_table: skip failing entries instead of aborting populate
2026-05-01 9:43 [PATCH v3] coreboot_table: skip failing entries instead of aborting populate Titouan Ameline de Cadeville
2026-05-01 20:54 ` Brian Norris
@ 2026-05-03 1:42 ` Tzung-Bi Shih
1 sibling, 0 replies; 3+ messages in thread
From: Tzung-Bi Shih @ 2026-05-03 1:42 UTC (permalink / raw)
To: Titouan Ameline de Cadeville
Cc: jwerner, briannorris, chrome-platform, linux-kernel
On Fri, May 01, 2026 at 11:43:22AM +0200, Titouan Ameline de Cadeville wrote:
> coreboot_table_populate() registers devices one by one. If
> device_register() fails for one entry, the current code returns
> immediately, leaving previously registered devices orphaned on the
> coreboot bus with no cleanup path.
>
> Since coreboot table entries are independent of each other, a failure
> on one entry should not prevent the others from being registered.
> This mirrors the strategy used by of_platform_populate(), which skips
> individual failures rather than aborting.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-firmware-next
[1/1] coreboot_table: skip failing entries instead of aborting populate
commit: 86e3bbc716332600e9e087f8a4889f4d9714a99c
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-03 1:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-01 9:43 [PATCH v3] coreboot_table: skip failing entries instead of aborting populate Titouan Ameline de Cadeville
2026-05-01 20:54 ` Brian Norris
2026-05-03 1:42 ` Tzung-Bi Shih
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox