From patchwork Thu Feb 10 08:11:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 541414 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp2044112imo; Thu, 10 Feb 2022 00:23:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzh8ChvqC7wymCh6N04n1qahpvKHC2Y4Rm2JNs4ngY5Hz6K8ZZLY4EWm7aQ5EnD/VprNyMp X-Received: by 2002:a05:6402:28a4:: with SMTP id eg36mr7187180edb.288.1644481413941; Thu, 10 Feb 2022 00:23:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644481413; cv=none; d=google.com; s=arc-20160816; b=uIsNIRAfDNK1sshyNlFzzsqkA276zSdYb8iKFHbeJ4BMNQxOBH6Z1JkZKhK4z0H6cp 0bWpKzBlo8Czk+ZTJ7awZf0mLpPlkvMlUmgJMjAmeiMYXhsquWIIFNQ0umwE+KVR1rz2 W7q+fM2qhaoSyEzQ/OpoK+7LC6jIy+8+Ajka+p+k/XSFNo+hLWehvdpQHgS+dXoGeJLs r4vr2lxdqcaaxl1bqO5RNj3TrTamw1i7XIELmpWrxKfNgGzlyyGpFHEoAQHocDZyxmOc sBOav52845lap90agJ9glqT7V2HrH+sX6PgxgGUJeavDu4EegLdlCxTPHwTQO0Vfu6gx Ifvw== 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=IklbeXDPfaPGcXZGSDgkJdE+Ty2i+lN5BUNTZKF20dPbVhyZBAdcTSaQDlAegZWIvk xitsM6gUJwK8EtTHKRry2rreizrGtyqydyPPgrm9T2y04y6a/u5ndUCVke+Zi/ppGdjY pxEE7KS4aS0UGh1Ux5ZJ5MNDrqdB2+bgzbt3pC5MhhIxyl1wbvD1DmOhSMAUKVsOsIlO ndpAda4mvjTpOdIlCGCr1zv80eyqapqp3Y0ouMtcfZNRihQE66AynZPOfIU0SU9upk/b kBb0z7Oci+/uvuJsEqiugBz/6Ls3g3LYg0WsTrLDd6uhEZceq+t5lLoWXYecV/ESEwAp cAQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Uv/Zos9P"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id t21si12415672edv.651.2022.02.10.00.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 00:23:33 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Uv/Zos9P"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 A1C16810F3; Thu, 10 Feb 2022 09:23:32 +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="Uv/Zos9P"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 27DD680F90; Thu, 10 Feb 2022 09:23:30 +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=unavailable autolearn_force=no version=3.4.2 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) (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 3B91F83559 for ; Thu, 10 Feb 2022 09:13:26 +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-pf1-x42e.google.com with SMTP id a39so8063296pfx.7 for ; Thu, 10 Feb 2022 00:13:26 -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=Uv/Zos9P9i8b9M55KQLDtbU8g8WJxsad4ivyH+2R8Kiep0wRXim1l1nBVNV2WquRfg 5Im9sRU4UJKXDaNwzl/VBWSBII1ymEH3HLKlba20ry4y5tioa8drAisLETup704JWKmT kRPjdo9mThM1fcrhOd50vZ/avOtUYzl2/fGy0Bdw55Pdzagk+yzauDyR6BAfaNG2qZdB oBKCFXGWZfTvC4HLUhRBqMp7nvBof1wcj8Jia678PX2HUa8gnDDEwg4bN4B/bsw5poi+ +Ct3d5JW8rx34yXHVsu2lTkCGfpTkBu/bDKPM/OpG/YGg+GagDIlR5NotOfSjwK2Hd7U v4HQ== 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=1XulT1zxP7NnbJ3iUl/HaOzcv0lMKEj6H8+0BVR0s43IQVH/OPpjqG3zwLl3CicN/X jEL1T3UzVi1QrxszxVc/J0s4idX5MO2j32MHAX48IB3m13b18vWClE5NbPChDFaes+Bo 8HipRyvNnNyPURcQLzoK/cyTr7PSKAzpKhyRdKeyJhG3EPD9jz+g15RKYF9gyNXkxefV LgxFQd3VsYAdDn50gklDQks4E/LTQki9f8CbN55PG6yCxpVWHHLv7h1vzUI3MGEX+1yQ ePRLhXavCNSXWnrPWYF+IZgmLZJVgSKGE3s4+vyVZecTb5oF4MIGUdEHlcKDTdyzKnC7 zhlg== X-Gm-Message-State: AOAM531hLOf4VkTDP5/y9BMLQNcwWaywBnpsHULig60L9gN6P59PpdJz Evf5QbykJNIREmU+/tZ6P5F1LQ== X-Received: by 2002:a63:d145:: with SMTP id c5mr5244868pgj.217.1644480804483; Thu, 10 Feb 2022 00:13:24 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:412e:384:fab9:f24]) by smtp.gmail.com with ESMTPSA id lk8sm1529208pjb.40.2022.02.10.00.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 00:13:24 -0800 (PST) From: AKASHI Takahiro To: lukma@denx.de, peng.fan@nxp.com, jh80.chung@samsung.com, bmeng.cn@gmail.com, peng.ma@nxp.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 v2 20/20] efi_driver: align with efi_disk-dm integration Date: Thu, 10 Feb 2022 17:11:24 +0900 Message-Id: <20220210081124.86612-21-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220210081124.86612-1-takahiro.akashi@linaro.org> References: <20220210081124.86612-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; }