From patchwork Wed Feb 2 01:08:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 539319 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp1193176imr; Tue, 1 Feb 2022 17:14:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+qlVaiKLJ132y0czeVv1Yd47GOVRrhZgKYreFWKdtfBpedef1qQRV56A7vgi8KtTVeOS5 X-Received: by 2002:a17:907:6283:: with SMTP id nd3mr23096695ejc.2.1643764454821; Tue, 01 Feb 2022 17:14:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643764454; cv=none; d=google.com; s=arc-20160816; b=vPMDGWkMiYfgKGzpxo9eXXEwkeq93e8QoyoLYXw9rjvau6CXJn3T+tfC0LPhWPNFg7 ggBboUI9vW8uby1LB2EnzbbX3+McTIWgiYFcky/SLHP9TEjodmaGXUR8TO4cE6iSROVQ lAv3Olg5Bp7likoDpHUOp6cj1sYs39kbOUjw+fBZzn35ypo4Ym1Vm1AWppYOQ43sMWCS Ag72SDWBxTNULLVZrr7J09fMQoN3MFdOHYWLTlD46LPp1rLL9AIilJs9GO7AL5YXFdsf bkCDNdxTElHKXxuUn1RqZMbSQLhfSbdBUBZKP+yo5igNun7fsl+imssRtFPBsIITk9YQ Bdmg== 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=nSVakcOOVxcYvYRWhJQeASw1EkYEJNRyGPdnfnm5GvfrimcY1FD1OLmsrbmQ/6lFoD FCIh3MVa+ZZZmq1VZAGs4o6Vx9Whxgc6cHhkDT3A33b5JAYGGuisDhEnLqWKKYSs0BUt HnUPKXQktX5QZrrvuf+r/kfo9o/SJxgnnSUBP3MQgLLWjwSqcr+aCBCKmJ9dLmw6FEPV eIxcJen613NoTIXN0oLh478A2jCFARoEQjxERseO8bKPDfLzq2G0QnV66C2r6WRvMeNG 3cmIqoumVVJp0My3S+olvnJAy3p936la3R3dhEq20xl/CzXIqvVsO5+Ibf9aeOqcUDWF 1vaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MZtQjPgT; 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 h7si8337350ede.573.2022.02.01.17.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 17:14:14 -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=MZtQjPgT; 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 C1657838D4; Wed, 2 Feb 2022 02:10:53 +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="MZtQjPgT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 08E0782FA5; Wed, 2 Feb 2022 02:10:53 +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, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 49DB983900 for ; Wed, 2 Feb 2022 02:10:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x62d.google.com with SMTP id l13so8192740plg.9 for ; Tue, 01 Feb 2022 17:10:37 -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=MZtQjPgTd3L0g3WEFZxOtJZWDeOuIAOmI598v64TGrOxyUouMkDAFTns6t98kW+ejn lmBnV4Wo4H5di3idx42ce3JhnVLcJgrYMHDiRtMtq3sX5uIWpybsP9XLMsFx545cS8zI SBMJm+3RVWfZeRqB/5Jz5LhJ6Oq/1sW+hPFTA1hlTV5sCiuKUgn/iH3H1uUf/u3gBqnc pag2KHO8ecIbix4lJHscNzhqBYPIB5xHDM/RrTvZ5R5G8GJpFP/9/k3+dxA1xRlLQ7YX 4lphMIMqeEPIRl2eY+3v5P57bmqKmBbAryLBMQJF9CHmUQitvUchYSsyipsGsBuLcF8A wwhA== 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=5gsRBzvS7vizOC/qRGsDZaZwFTURa7G8yKV+RJBISdhqVfFWrkhM02BUGy3vMzY/A7 60cTPwLGulyz9a+v+NDJEPX/zVa3FYgv3it3zx4DueAY4yWFWBRLTxRI+WzXbkaGvBgn XU1X7CqZOzDEC0cmhz4YRKZaHcDV2eRFOza6Loqzz+qm1sYTXNU5OGQOzDbF/bCG1DEX 5uR5YUHOPNvpJx1Xj5ZzpNshCsN4uzFwnY0HQMltNzNSu0bgdzdgRUpID+GBtvyeu1/A H5+jczRGDL2Rcwqe38SkqJGW5BV8UjlVgk5xtEUv195LGXJiFuXi4gf62lQhndeqDjuf juSw== X-Gm-Message-State: AOAM530PW4HTlp2FDcNfdaRMKPDyvMTMML/yC3ZNS/hnaA7nUKt+JYxd q2qD41Bs171/DUwMgyVwN6imTw== X-Received: by 2002:a17:90b:1d06:: with SMTP id on6mr5508846pjb.6.1643764235099; Tue, 01 Feb 2022 17:10:35 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:314e:b83b:fa90:7f2e]) by smtp.gmail.com with ESMTPSA id f5sm10761429pfc.0.2022.02.01.17.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 17:10:34 -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 19/19] efi_driver: align with efi_disk-dm integration Date: Wed, 2 Feb 2022 10:08:53 +0900 Message-Id: <20220202010853.40405-20-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220202010853.40405-1-takahiro.akashi@linaro.org> References: <20220202010853.40405-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; }