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 C8132C433F5 for ; Mon, 11 Oct 2021 07:41:48 +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 BFF3760EC0 for ; Mon, 11 Oct 2021 07:41:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BFF3760EC0 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 3BA4C83124; Mon, 11 Oct 2021 09:41:45 +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="MTC99OQy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 22C5D83172; Mon, 11 Oct 2021 09:41:43 +0200 (CEST) Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (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 F243882D85 for ; Mon, 11 Oct 2021 09:41:38 +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-pj1-x1029.google.com with SMTP id ls18-20020a17090b351200b001a00250584aso13608423pjb.4 for ; Mon, 11 Oct 2021 00:41:38 -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=VMZI28YNdaUuB+MiT9GRNCba8gYAirlkZ4o82XtO6TQ=; b=MTC99OQyOcYylJrUMGEL4toJRgvPLSDfgkm7apvTjdHCv5TAhwef+Kd1iAQCc1ZSi7 U6zLL/cpJro8Rz7QTHZax2bqtUyPAqnl5hfpbdJ3LqAS8lVB9pLUVUMdSNJ2m0pqzPdf U5r2JAzwYe5F1j6IA68JGaMH43xpPq9qPudOnvW5WMZG9dIOqkRai31mKt8qUXGJWZBM F2s443FD8BoWy9GhQTnBwv/e7VXXeLT470RxY1t1Y5MJcVg8qwlcaOBg4uuu2Et5365J QPPyJ59oxvjTRHhWx57+LB9vbRd9ugMPxekEoQFIqXRFvgH18lLFfkNZ7yFQIWNa6Udd 3YjA== 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=VMZI28YNdaUuB+MiT9GRNCba8gYAirlkZ4o82XtO6TQ=; b=IW7IzGFu8MWD/GV644XoGlcsOCvuQji8lurxzCNb5LS7DbyOpW8qkIO1qtfGIf8xlI OOLttlqFsxNw/wokDtAIcTGHmzXByfk+XgwwNbWEI/ZbAgcbNAKWFA1DW8jeAA2ZJQcp +LWiE0uCIgspoM62T+yTO0Z8N+LqpSjHsvFos+EycFefcJmx9b/JnVe5Xhjoql60gnBQ W0lLUTf8sTS0Q7eLGcm2172SA1BZgb12hmWfrp2VNz9UvlNtWAQQUfqVx9awPv/Dxh+z lcVjoI7XEV8Rbiq8BXCvCjgWdsWnWEbIc1k+8BBBz4D4UcGP8hfukv0ycVzXrqoQtpeT 2vxw== X-Gm-Message-State: AOAM531iCwQELUivEkV7VWukiMfx/6kBji2DAM95vcCYLuLsgrUbjzhf OdiQUNFDOkOYY6u4jCd3GaOeSA== X-Google-Smtp-Source: ABdhPJx3GLvGwG6Q93lDPPjPmgpU4a3SmCuTXUmq4mzsJXwcLeT6efRK48GHicJJMT0oezWqyLYGBQ== X-Received: by 2002:a17:90a:9912:: with SMTP id b18mr29454368pjp.46.1633938097058; Mon, 11 Oct 2021 00:41:37 -0700 (PDT) Received: from laputa (122-100-26-39m5.mineo.jp. [122.100.26.39]) by smtp.gmail.com with ESMTPSA id t3sm6719629pfb.100.2021.10.11.00.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 00:41:36 -0700 (PDT) Date: Mon, 11 Oct 2021 16:41:31 +0900 From: AKASHI Takahiro To: Simon Glass Cc: Heinrich Schuchardt , Alex Graf , Ilias Apalodimas , U-Boot Mailing List Subject: Re: [RFC 20/22] efi_driver: align with efi_disk-dm integration Message-ID: <20211011074131.GJ44356@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-40-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 On Sun, Oct 10, 2021 at 08:14:30AM -0600, Simon Glass wrote: > Hi Takahiro, > > On Thu, 30 Sept 2021 at 23:05, AKASHI Takahiro > wrote: > > > > Can you please add a commit message as I am not sure what this patch is doing. Sure. > > Signed-off-by: AKASHI Takahiro > > --- > > lib/efi_driver/efi_block_device.c | 6 ++++++ > > lib/efi_loader/efi_device_path.c | 29 +++++++++++++++++++++++++++++ > > lib/efi_loader/efi_disk.c | 12 +++++++++++- > > 3 files changed, 46 insertions(+), 1 deletion(-) > > > > diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c > > index 0937e3595a43..b6afa939e1d1 100644 > > --- a/lib/efi_driver/efi_block_device.c > > +++ b/lib/efi_driver/efi_block_device.c > > @@ -173,6 +173,12 @@ static int efi_bl_bind(efi_handle_t handle, void *interface) > > plat->handle = handle; > > plat->io = interface; > > > > + /* > > + * FIXME: necessary because we won't do almost nothing in > > + * efi_disk_create() when called from device_probe(). > > + */ > > + bdev->efi_obj = handle; > > + > > ret = device_probe(bdev); > > if (ret) > > return ret; > > diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c > > index cbdb466da41c..36c77bce9a05 100644 > > --- a/lib/efi_loader/efi_device_path.c > > +++ b/lib/efi_loader/efi_device_path.c > > @@ -628,6 +628,35 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev) > > return &dp->vendor_data[1]; > > } > > #endif > > +#ifdef CONFIG_EFI_LOADER > > + /* > > + * FIXME: conflicting with CONFIG_SANDBOX > > In what way? If it is just a test we should be able to update the test > to avoid the conflict. I will revisit the issue because this hack may be linked to one of my patches in my repository which is not posted yet. You can ignore it for now. -Takahiro Akashi > > + * This case is necessary to support efi_disk's created by > > + * efi_driver (and efi_driver_binding_protocol). > > + * TODO: > > + * The best way to work around here is to create efi_root as > > + * udevice and put all efi_driver objects under it. > > + */ > > + case UCLASS_ROOT: { > > + struct efi_device_path_vendor *dp; > > + struct blk_desc *desc = dev_get_uclass_plat(dev); > > + /* FIXME: guid_vendor used in selftest_block_device */ > > + static efi_guid_t guid_vendor = > > + EFI_GUID(0xdbca4c98, 0x6cb0, 0x694d, > > + 0x08, 0x72, 0x81, 0x9c, 0x65, 0x0c, 0xb7, 0xb8); > > + > > + > > + dp_fill(buf, dev->parent); > > + dp = buf; > > + ++dp; > > + dp->dp.type = DEVICE_PATH_TYPE_HARDWARE_DEVICE; > > + dp->dp.sub_type = DEVICE_PATH_SUB_TYPE_VENDOR; > > + dp->dp.length = sizeof(*dp) + 1; > > + memcpy(&dp->guid, &guid_vendor, sizeof(efi_guid_t)); > > + dp->vendor_data[0] = desc->devnum; > > + return &dp->vendor_data[1]; > > + } > > +#endif > > #ifdef CONFIG_VIRTIO_BLK > > case UCLASS_VIRTIO: { > > struct efi_device_path_vendor *dp; > > diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c > > index dfd06dd31e4a..e7cf1567929b 100644 > > --- a/lib/efi_loader/efi_disk.c > > +++ b/lib/efi_loader/efi_disk.c > > @@ -562,11 +562,21 @@ static int efi_disk_create_part(struct udevice *dev) > > int efi_disk_create(struct udevice *dev) > > { > > enum uclass_id id; > > + struct blk_desc *desc; > > > > id = device_get_uclass_id(dev); > > > > - if (id == UCLASS_BLK) > > + if (id == UCLASS_BLK) { > > + /* > > + * avoid creating duplicated objects now that efi_driver > > + * has already created an efi_disk at this moment. > > + */ > > + desc = dev_get_uclass_plat(dev); > > + if (desc->if_type == IF_TYPE_EFI) > > + return 0; > > + > > return efi_disk_create_raw(dev); > > + } > > > > if (id == UCLASS_PARTITION) > > return efi_disk_create_part(dev); > > -- > > 2.33.0 > > > > Regards, > Simon