[RFC v2 11/20] dm: add event notification

AKASHI Takahiro takahiro.akashi at linaro.org
Tue Dec 14 08:07:45 CET 2021


On Mon, Dec 13, 2021 at 05:51:46AM -0700, Simon Glass wrote:
> Hi Takahiro,
> 
> On Fri, 10 Dec 2021 at 00:00, AKASHI Takahiro
> <takahiro.akashi at linaro.org> wrote:
> >
> > From: Simon Glass <sjg at chromium.org>
> >
> > This is a draft implementation of event notification mechanism from Simon.
> > Under this scheme, any U-Boot subsystem can register some kind of callback
> > function to a particular event (more event types will be added later) and
> > that function will be invoked once the event is fired.
> >
> > As a first user, UEFI subsystem makes use of PROBE and REMOVE events so
> > that we will be able to automatically create/remove efi_disk objects
> > relying on associated block devices (UCLASS_BLK).
> >
> > To run the test:
> > ./u-boot -T -c "ut common test_event_probe"
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > [add REMOVE event; fix checkpatch warnings]
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
> > ---
> >  common/Kconfig                    |  11 ++++
> >  common/Makefile                   |   2 +
> >  common/board_f.c                  |   2 +
> >  common/event.c                    | 103 +++++++++++++++++++++++++++++
> >  common/log.c                      |   1 +
> >  drivers/core/device-remove.c      |   9 +++
> >  drivers/core/device.c             |   9 +++
> >  include/asm-generic/global_data.h |   3 +
> >  include/dm/device-internal.h      |  10 +++
> >  include/event.h                   | 105 ++++++++++++++++++++++++++++++
> >  include/event_internal.h          |  34 ++++++++++
> >  include/log.h                     |   2 +
> >  test/common/Makefile              |   1 +
> >  test/common/event.c               |  87 +++++++++++++++++++++++++
> >  test/test-main.c                  |   5 ++
> >  15 files changed, 384 insertions(+)
> >  create mode 100644 common/event.c
> >  create mode 100644 include/event.h
> >  create mode 100644 include/event_internal.h
> >  create mode 100644 test/common/event.c
> 
> Should we split this into a few patches for submission? Also needs docs.

I assumed that you were going to maintain this specific patch.

-Takahiro Akashi

> Regards,
> Simon


More information about the U-Boot mailing list