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 2B5E2C433F5 for ; Mon, 13 Dec 2021 12:53:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6656A83769; Mon, 13 Dec 2021 13:52:43 +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="Qimzm50d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CE6A782F5E; Mon, 13 Dec 2021 13:52:09 +0100 (CET) Received: from mail-ua1-x929.google.com (mail-ua1-x929.google.com [IPv6:2607:f8b0:4864:20::929]) (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 B753982F8E for ; Mon, 13 Dec 2021 13:51:59 +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-x929.google.com with SMTP id r15so28979261uao.3 for ; Mon, 13 Dec 2021 04:51:59 -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 :cc; bh=F3c2F/8vLME3hBjl4dJPJQXaceNwA9MNIViVHnSw9Dg=; b=Qimzm50dU4b96mHbQWyDdy/hVjyrbDYauq6ExrzyaqGTBmkuWahUikkvJWMCp7iuHm vIH8e7cYm3t42/VpVlF3YNbqmzLIfS7E27+ClvyKIzpndwZkrUMacNG5xtxo1LXFelGa rqi0BKQy/rc3ADcUqE2Qm/qo+G5hSFZS9D+v8= 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:cc; bh=F3c2F/8vLME3hBjl4dJPJQXaceNwA9MNIViVHnSw9Dg=; b=3tko/nSul3Zk/vwjY+7t8kKXX7f3oYOE19zIEaDYoSjnUjh5hd30MmjePNcxoegCnK h9S+m1qAHY4FZ2ONHLKC1m/1Q0mU4dgW3BOECMCwbbqR2eezZNZPT8Y9Rqr9aWTffVsT HKuLDmpXM2uDuc/+pFL09kR8rekl0boICqjsC1B0wXkjUcwE6tdfUm9bdiR6Kna3v5qU BpmltniNv6rwyDGP5LGgQmb7nTFwo9rPJGykla1BHTkWVuCf0nbob3IT6+4loc+XRtsU rMB1Utu8eqkoHBeqTLk+IverjxvdarLLIeEOZKAeuJjDPPXcH0ANrc45rZWXYRemLukH qpnw== X-Gm-Message-State: AOAM533IjR61pC/92IcjcrwmiumM2viP/IhmK/JiRhM4I50S+y51h/Eq ITEFNBbEYKyw0nc/RTp5HD2/wjZvmB2ncRLMn+Tm8g== X-Google-Smtp-Source: ABdhPJzZhvNezxbBWkCV88lLHx+xGBK0NlFQicIVdFPLPaswM+wmO6CkEi3hNv3mJjyLmU40qzu94FGYSmz2FV8pPT4= X-Received: by 2002:a67:e109:: with SMTP id d9mr26922054vsl.19.1639399918170; Mon, 13 Dec 2021 04:51:58 -0800 (PST) MIME-Version: 1.0 References: <20211210064947.73361-1-takahiro.akashi@linaro.org> <20211210064947.73361-12-takahiro.akashi@linaro.org> In-Reply-To: <20211210064947.73361-12-takahiro.akashi@linaro.org> From: Simon Glass Date: Mon, 13 Dec 2021 05:51:46 -0700 Message-ID: Subject: Re: [RFC v2 11/20] dm: add event notification To: AKASHI Takahiro Cc: 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 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. Regards, Simon