From patchwork Tue Mar 8 11:36:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 549285 Delivered-To: patch@linaro.org Received: by 2002:adf:80eb:0:0:0:0:0 with SMTP id 98csp1663460wrl; Tue, 8 Mar 2022 03:43:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaexpWf87hPCzaALsPNlVicy82v93DlkxynPvZzmJbJ2iHlVry1GWMvvhbhdqKQjEShbVC X-Received: by 2002:aa7:d5d9:0:b0:416:1dd3:7714 with SMTP id d25-20020aa7d5d9000000b004161dd37714mr15403532eds.256.1646739785222; Tue, 08 Mar 2022 03:43:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646739785; cv=none; d=google.com; s=arc-20160816; b=V8gqAXrr5CUxXul/QY4F4HQTjHdcihYi4rkmyXh8th+XEOoVTEVtEvIiISqWHsEuEG cZHiHqW+e9GqQclm5O5a6s6XAQI9axOOkaXSH+2kC93b9He/FZkjdpOiB16cONL0fFA3 +R/TKeUQW9p0cLK0pCoIyDqdARfD1JQuRGNFJiE1scJQIQlCBqfUkx8EuTVg5L1WQriO fKzVWpVR507NP4AEwB8XGvaf2R76AjbB+K7hnWMgWLwXFwvvIx5zJeUXf39ZHyFlMUzP j6QZz7eB5PzznjDqdQwKoMz4weGd1TvqO3SvKpd5IgQxOkE9E/QnBi2vskx3pjbW0gZn HByA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eYHYzsO6Ya0KXfUNViqMWI46hl0I0il0h5rYfPH5f+o=; b=DsqmK37Scl0z4Khxulv9NjLRsSiHUpwFq00KiCB8BwkwjkDh2kvwIrS2uI3y4YzATK un9ZYhb+5laB7+qVaAyCdr1kZFg23ndrcJvswSNexVzyg5iTIUd3hOvKav8oKSvU2Mwe q+tnU5ptocxD3kMGGGAFFIh7Me6kOA2F82YtWOjrnLz0blwtiyab5jMlzH1R3YBVbi0Z 6TC29sC0uo4CCV/1KWPOgVeRqjuIURXS+2Uy1zsL5O3zFTGkBwZEe/1UyOk8a4xVykc9 x7lwU41SdIcik1NIK2GzPsiLrj8R3t4hwi5kEd5jsQdD3f1pxLeb5ZGUFduCAu0qmQCP gC+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="n3hF/6rL"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id i10-20020a170906698a00b006cee60bfc41si9609537ejr.119.2022.03.08.03.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 03:43:05 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="n3hF/6rL"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3EA2D839C4; Tue, 8 Mar 2022 12:42:20 +0100 (CET) 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="n3hF/6rL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B945C839DC; Tue, 8 Mar 2022 12:41:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (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 0F07B839B2 for ; Tue, 8 Mar 2022 12:38:51 +0100 (CET) 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-x102b.google.com with SMTP id mr24-20020a17090b239800b001bf0a375440so1939154pjb.4 for ; Tue, 08 Mar 2022 03:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eYHYzsO6Ya0KXfUNViqMWI46hl0I0il0h5rYfPH5f+o=; b=n3hF/6rLnIcSOKT8zZ2rPTWK/tR411CLbn4VsUPSNqQmQxsACRSq+386+YsBAVhF3b 9uJld2231z41y0mUvCVysRiaO/a3i4PqgVl5EvO4bfhNFdqUlQ8lwsG272AHapAxhi1q L+/RKUdXqlF1GvU7ndswCnI9uyPfuE4oAn1fw7OkNOo2C7k93zwNGI0OXK2yT5G/fpd8 XXCSMy3cqB7GZmD4a62evnMCI+8KTgAAn3hcM3MLQM6EgfqJam9SKtv+F2Bw6oULAxsr viITyQLXx9qdRSAr8znT2aN9QirgibfOq4sGGkLhEN+ulqSkP2oZGfkw+Pu/NEW76P8L mtQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eYHYzsO6Ya0KXfUNViqMWI46hl0I0il0h5rYfPH5f+o=; b=8P6d7idI3ok2hf0QVWJK/0E0GJ4kjDk/7x6MWZ3/LIivCRb8nBJBGI7lWHd0sVBFf4 kTqGzNcXi+UOFwXE1O9VsdXoAs04AsYI+2ezk3dntdtuKGgmOIRJJPFiuVoshZQ0SuwC IcRRtPrtN1L1HY5PqVD43PUPU3UTUiTE0PMn6w2DCisdMgvjtW0XDBXQCWr2BsaqkkP7 0zkGJW08d1v3qqD4H9tkvEXJrPOoPH8zzkkkFG2YBe+IAG02DBskHg0y0oCIWMUd6bBF rquq0nkjiqvkSSmxsl+67h4NwKxDZF3u5f6cYzV43dhFpyohqvqJXmegEH5TLUxaq3zj mZtA== X-Gm-Message-State: AOAM530vQz/Xj2OnIQ1TEA5dKnbxJ3KDRvcoHYUsPirROx0ZkQd/yMOX uZiPxmYc6+hdPup12zOMuBjELQ== X-Received: by 2002:a17:903:3094:b0:151:f5a7:ad72 with SMTP id u20-20020a170903309400b00151f5a7ad72mr6394993plc.135.1646739529390; Tue, 08 Mar 2022 03:38:49 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:b94a:f47a:3d51:185c]) by smtp.gmail.com with ESMTPSA id z2-20020a17090a170200b001bf2d530d64sm3434677pjd.2.2022.03.08.03.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 03:38:49 -0800 (PST) From: AKASHI Takahiro To: lukma@denx.de, peng.fan@nxp.com, jh80.chung@samsung.com, bmeng.cn@gmail.com, sr@denx.de, xypron.glpk@gmx.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: masami.hiramatsu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v3 19/19] efi_driver: align with efi_disk-dm integration Date: Tue, 8 Mar 2022 20:36:57 +0900 Message-Id: <20220308113657.221101-20-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220308113657.221101-1-takahiro.akashi@linaro.org> References: <20220308113657.221101-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean With DM-efi_disk integration, we don't need to explicitly call efi_disk_create_partitions(). The only thing to do is to associate an efi_disk object to the corresponding udevice as we skip most of processing in efi_disk_probe() by the previous commit ("efi_loader: disk: not create BLK device for BLK(IF_TYPE_EFI) devices"). Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass --- lib/efi_driver/efi_block_device.c | 34 +++++++++---------------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index 04cb3ef0d4e5..5baa6f87a375 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -35,6 +35,7 @@ #include #include #include +#include /* * EFI attributes of the udevice handled by this driver. @@ -106,25 +107,6 @@ static ulong efi_bl_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, return blkcnt; } -/** - * Create partions for the block device. - * - * @handle: EFI handle of the block device - * @dev: udevice of the block device - * Return: number of partitions created - */ -static int efi_bl_bind_partitions(efi_handle_t handle, struct udevice *dev) -{ - struct blk_desc *desc; - const char *if_typename; - - desc = dev_get_uclass_plat(dev); - if_typename = blk_get_if_type_name(desc->if_type); - - return efi_disk_create_partitions(handle, desc, if_typename, - desc->devnum, dev->name); -} - /** * Create a block device for a handle * @@ -139,7 +121,6 @@ static int efi_bl_bind(efi_handle_t handle, void *interface) char *name; struct efi_object *obj = efi_search_obj(handle); struct efi_block_io *io = interface; - int disks; struct efi_blk_plat *plat; EFI_PRINT("%s: handle %p, interface %p\n", __func__, handle, io); @@ -173,15 +154,20 @@ 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(). + */ + ret = dev_tag_set_ptr(bdev, DM_TAG_EFI, handle); + if (ret) + /* FIXME: cleanup for bdev */ + return ret; + ret = device_probe(bdev); if (ret) return ret; EFI_PRINT("%s: block device '%s' created\n", __func__, bdev->name); - /* Create handles for the partions of the block device */ - disks = efi_bl_bind_partitions(handle, bdev); - EFI_PRINT("Found %d partitions\n", disks); - return 0; }