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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EA5DC433EF for ; Mon, 11 Oct 2021 06:43:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6B3C960E90 for ; Mon, 11 Oct 2021 06:43:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6B3C960E90 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EFB68831C9; Mon, 11 Oct 2021 08:43:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SzEMri9a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 843C583328; Mon, 11 Oct 2021 08:43:48 +0200 (CEST) Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (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 D30A682BC7 for ; Mon, 11 Oct 2021 08:43:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pg1-x536.google.com with SMTP id 133so9931703pgb.1 for ; Sun, 10 Oct 2021 23:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=I6Q1M5NCgMG1Aw/25SINGS1nknM+aqJFO6vC1AZAuv4=; b=SzEMri9asAzaDxVDx9Y3nRspd0ICUVNlArZbhl7uZ1YAgvHBWJwnwIQ2RueiU9KLEx PPmdt/XlbvIFJzXBNE99B9ZRzW0uzhsptE3wLVAELPZiWY3ppJ/pF+byMm+RSQfbmzyf qnAySayjSvktFmD2IG/U/FVVaXUBtORiZ5ErOvnLjcuq+19j16KYv0aUNcxcKAc962xE iAyzTB+tMLtF6pZdj30IC/dq1bKMIfcZZvzxQi6b1Mmg5+ovugAiUCCXw3Oq4vLKh51b vgIRJ9wy7+1PDnUvcWNQytftMx9vFwsDnRJaeg4wroCn2BpJFq4iqpeCTBQYPhNFO85q zdFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=I6Q1M5NCgMG1Aw/25SINGS1nknM+aqJFO6vC1AZAuv4=; b=m81pQXFhlIZhv2WpCcaJ3JyZliSv4Gsfu/8VC+WaYbsu7V33+Jbq4EbicXaU2Dybou nPn6aM7lqis43IFJ12ItksoSWLjGgQ8sokJV+Ro2gPiAVsZkMNfxiU5okEh0oDgTTMwW hEdyEMXCCocU56j5fO+Dl/s1SNCy/yTniCqRPwytZLe+tKN8dK8qYiO5wKchG7n5y/mR 86qQPh9Wfp/OHRoqwQi4tuAMc0roEUZT20TzFIgT8PAdyJBNFc6c4ny1AIjRus6HCfnx BihFD2Ye0cnB8CMtGaba752aN/OeUn0a8DtaC4QAl337POO2QILS5ftdee2ImsiucRGt dLmg== X-Gm-Message-State: AOAM533/UJjO+I+UGs/QHwcfyDVRw64bCWTqrYNYCqGDU4NQPG5+A/zg 8heSwiQUl+VWDpDWy/PiYaBOwQ== X-Google-Smtp-Source: ABdhPJzE+p90oH+iBTVC+O89HtEw2TdNWtwI1B0tN7zYyz1ILctOHNhc1RJYE9hwUQNeKTkQiF1MiA== X-Received: by 2002:a05:6a00:1248:b0:44c:84cd:f795 with SMTP id u8-20020a056a00124800b0044c84cdf795mr24256152pfi.79.1633934622622; Sun, 10 Oct 2021 23:43:42 -0700 (PDT) Received: from laputa (122-100-26-39m5.mineo.jp. [122.100.26.39]) by smtp.gmail.com with ESMTPSA id f30sm2154369pfq.142.2021.10.10.23.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Oct 2021 23:43:42 -0700 (PDT) Date: Mon, 11 Oct 2021 15:43:36 +0900 From: AKASHI Takahiro To: Simon Glass Cc: Heinrich Schuchardt , Alex Graf , Ilias Apalodimas , U-Boot Mailing List Subject: Re: [RFC 12/22] dm: add a hidden link to efi object Message-ID: <20211011064336.GH44356@laputa> Mail-Followup-To: AKASHI Takahiro , Simon Glass , Heinrich Schuchardt , Alex Graf , Ilias Apalodimas , U-Boot Mailing List References: <20211001050228.55183-1-takahiro.akashi@linaro.org> <20211001050228.55183-24-takahiro.akashi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 Simon, On Sun, Oct 10, 2021 at 08:14:18AM -0600, Simon Glass wrote: > Hi Takahiro, > > On Thu, 30 Sept 2021 at 23:04, AKASHI Takahiro > wrote: > > > > This member field in udevice will be used to dereference from udevice > > to efi_object (or efi_handle). > > > > Signed-off-by: AKASHI Takahiro > > --- > > include/dm/device.h | 4 ++++ > > 1 file changed, 4 insertions(+) > > I think this should be generalised. > > Can we add a simple API for attaching things to devices? Something like: Ok. > config DM_TAG > bool "Support tags attached to devices" > > enum dm_tag_t { > DM_TAG_EFI = 0, > > DM_TAG_COUNT, > }; > > ret = dev_tag_set_ptr(dev, DM_TAG_EFI, ptr); > > void *ptr = dev_tag_get_ptr(dev, DM_TAG_EFI); > > ulong val = dev_tag_get_val(dev, DM_TAG_EFI); > > Under the hood I think for now we could have a simple list of tags for > all of DM: > > struct dmtag_node { > struct list_head sibling; > struct udevice *dev; > enum dm_tag_t tag; > union { > void *ptr; > ulong val; > }; > }; Just let me make sure; Do you intend that we have a *single* list of tags in the system instead of maintaining a list *per udevice*? -Takahiro Akashi > This can be useful in other situations, for example I think we need to > be able to send an event when a device is probed so that other devices > (with tags attached) can take action. But in any case, it makes the > API separate from the data structure, so aids refactoring later. > > If we find that this is slow we can change the impl, but I doubt it > will matter fornow. > > > > > diff --git a/include/dm/device.h b/include/dm/device.h > > index 0a9718a5b81a..33b09a836f06 100644 > > --- a/include/dm/device.h > > +++ b/include/dm/device.h > > @@ -190,6 +190,10 @@ struct udevice { > > #if CONFIG_IS_ENABLED(DM_DMA) > > ulong dma_offset; > > #endif > > +#if CONFIG_IS_ENABLED(EFI_LOADER) > > + /* link to efi_object */ > > + void *efi_obj; > > +#endif > > }; > > > > /** > > -- > > 2.33.0 > > > > Regards, > Simon