From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4F44C433EF for ; Sun, 19 Dec 2021 22:17:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 722CB810F3; Sun, 19 Dec 2021 23:17:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="As+q3wzK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44C2C8307B; Sun, 19 Dec 2021 23:17:38 +0100 (CET) Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A0A96810ED for ; Sun, 19 Dec 2021 23:17:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ua1-x92d.google.com with SMTP id y22so14529425uap.2 for ; Sun, 19 Dec 2021 14:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=gsY2y2EcYcvXfudTEPi4nNodFKz0yWptGpYmiJK00xM=; b=As+q3wzKQH1yAFFzksUs04T6CQuWU+Rk2FXzu8vQGYrZgjQeANMO6JIgqo2T4BvkGa MUTaiEYWmlmEhs36t9hiNdQoXntOmqxgFH3EMbNkTjGhP9SX/9wLFRvz4wFeeW8lkYww 531HcKP3Uc/3gNaAmKVFkpIRDlYgFFsJqSeew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=gsY2y2EcYcvXfudTEPi4nNodFKz0yWptGpYmiJK00xM=; b=enTcopfEEHdhuyrXh5nzkXVak8dccpyEBzI+8Wy2Y9tTyOqz9ehwIaLEa4UFc5omkN dqro3ab/ByHmIpFlaloeIUUYB3cTKgjYW1A8ZF6U47oRetL8FtCXbZF/iCtS+RD1ds4A DyrQDKz6EadmiZ6fSe7HXVrch9Uc4zcvDsEmjd7Nf5AlmwU6DrsBsFpVep/mAuLEO2ME qqzgXRGSy1le98Pial/LJu/M3HSYP/dUHxVBwURwE+5fC5GQljF0GG7GKL9NfygSobLJ 4Z4CVgU0Ahy4+JS5+jeLFhbsc32czvg/YI6hP0leTCcGSbVzRN2RKOzCTYB5N6R1bl3Y KMqw== X-Gm-Message-State: AOAM532RoIoiLbm7G7LoylM4Y2BWmQo3b0gNCGRhdPMflbb1369AnKqx A3+gROM/b5vNaevLwcyBNoRPB4FMq035UOkL2Oo9Ig== X-Google-Smtp-Source: ABdhPJzS06BVOF+vBsPLV1p82DpRReBrNZmjklqv6IjA9LSIycQNhHHokmotTpRWn+XhHm1SoHsPuiGmwGtA5hh5VX8= X-Received: by 2002:a67:e897:: with SMTP id x23mr1077245vsn.19.1639952253026; Sun, 19 Dec 2021 14:17:33 -0800 (PST) MIME-Version: 1.0 References: <20211210064947.73361-1-takahiro.akashi@linaro.org> <20211210064947.73361-12-takahiro.akashi@linaro.org> <20211214070745.GC49357@laputa> In-Reply-To: <20211214070745.GC49357@laputa> From: Simon Glass Date: Sun, 19 Dec 2021 15:17:21 -0700 Message-ID: Subject: Re: [RFC v2 11/20] dm: add event notification To: AKASHI Takahiro , Simon Glass , xypron.glpk@gmx.de, agraf@csgraf.de, ilias.apalodimas@linaro.org, masami.hiramatsu@linaro.org, u-boot@lists.denx.de Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Takahiro, On Tue, 14 Dec 2021 at 00:07, AKASHI Takahiro wrote: > > 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 > > wrote: > > > > > > From: Simon Glass > > > > > > 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 > > > [add REMOVE event; fix checkpatch warnings] > > > Signed-off-by: AKASHI Takahiro > > > --- > > > 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. Ah yes, good point :-) I will give it a crack. Regards, Simon