From patchwork Mon Oct 4 03:44:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515142 Delivered-To: patch@linaro.org Received: by 2002:ac0:890a:0:0:0:0:0 with SMTP id 10csp1062524imy; Sun, 3 Oct 2021 20:47:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrrh3/xVsdgeA/9fDyJNloN5XppJjg2RCQPCdgEWd93Po8VMSum4X/mY9oUn6C2ydSd1Ug X-Received: by 2002:a17:906:1fc1:: with SMTP id e1mr14465411ejt.515.1633319266215; Sun, 03 Oct 2021 20:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633319266; cv=none; d=google.com; s=arc-20160816; b=c7qDMWs7xVh09ePACogPHwE1FxkR5nQyubu+uBm4dtVqL71GiJGAbw/P0T62whA8H1 YFwxGDP7RdrVx+8HDntlpak5SOFH5LTe+/cQWyRorM+XBbUMb84X1nEEjL9YBB/kEhi/ rY4H10CMSXKdzwEwMzAK4UDDx31sDjYlQFhY1tQW5lWXKSBrBjdwPx5LQX1kALu/zga2 SERcnQ3uvAZ1IN4br1h50teB6hAgwkgzW9lBXXGEcJ6Ue6+uv/RUk4sRoloCO0cDmGBx kc3QFUR2+pLpKDaYfwtg8gx6eGm7HMlwxao/xZWco//WMzkZrFz4i8+D1Lw1RqZ2KHSQ NsiA== 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=coOvnAk/rbk+/ncR0sxWujqYftnu93HGs2aH4UoEgn4=; b=lzSAAq1WQPzkPE5tUnxKE7TyHp8OrA96D3L5Nbek9B0yiJZ6mRwXKo4MUZDxIf8UVi +23pVigPymyYUxhRDH49ZoUNNK10UVtB/X+0Wxz9JfkqRl/mqp5eBL3j5npYf7XyEPDC E9Sz67mICBN6nefh4weMObiyKqOKbEyk1E72HZ96/rDrous2paUJP407ltRXHOR00sD6 kK/jyiIyfOLLQ/PW+HCwQ/MU4taTkWI6HocLQF8lNfikms/Tp/saQI9ItT3Bn10kC7SZ hrcMd3F9JD7KBWxV6fjtw1Xz/mQSyesiEiUOrVkd/a27vezkDTrUwlJCeFphoCHSCKUv y1wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zbyL7GOr; 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 au8si12867036ejc.494.2021.10.03.20.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 20:47:46 -0700 (PDT) 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=zbyL7GOr; 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 21A5F83597; Mon, 4 Oct 2021 05:46:35 +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="zbyL7GOr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4726D83571; Mon, 4 Oct 2021 05:46:22 +0200 (CEST) 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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (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 0369283550 for ; Mon, 4 Oct 2021 05:46:14 +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-x102d.google.com with SMTP id rj12-20020a17090b3e8c00b0019f88e44d85so4641648pjb.4 for ; Sun, 03 Oct 2021 20:46:13 -0700 (PDT) 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=coOvnAk/rbk+/ncR0sxWujqYftnu93HGs2aH4UoEgn4=; b=zbyL7GOrP+inGQRuKbuy+yat7Hdqf5MABFZkuRZTaKGUW0alrq/NT6ywxMQEysHZxc W0Yy7Qmd925MOxHXvDGSA207q/4QFLZ4MdkytjT0Z5d5MSrK9HdraGqrt/+Cwyq3qhnw pFAEHksG8TP9X/Q0lVCbvmvXI9wINTz7zEKLyYIb1tmXGNCMSvuAs2NozhBcVPQMKqoS 2eS+X+Anfj592xXplluxnQvJ/4u/w3+dhep7i3QbajNt84fdSLKDvf80fGWBa3WEF5YR rqN3ydgYARDIqzEguaHswTfqi1k4S3ZvSinTTJ1QX3mEmkfskg4KsipcCq217MBP1T2x oTFA== 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=coOvnAk/rbk+/ncR0sxWujqYftnu93HGs2aH4UoEgn4=; b=h6IEHBbD68+PZBk78S3Pr5G2FDQMOYWOk+Bd9sO16MQuDMlost73h3t3nCXWnCieBu 3dtVf6JWwCV5SVPP4rvVRDeMghxqpP51obOb0+pnkifv8p9MQG5sd/gaADcqii/ytOBL 5rW3leCj4+Lmk0iH+BuLdtufPeUoSobzMoPaTB0FtSMacVc2LGsPlCuTMATXPQyPGPcI USdshdK3/a9kTp/3ZgLrWk2jZao9yRVq1g0g3GBuqaCpdJyuTeJ/LTSlCZOMv4Qz0D0V dk1qEGxpWMkEodkfQJD+7Gifl83xkyu66I+ryubOzf7NVTJYN4rFPye6epFfubQa258n 8wFg== X-Gm-Message-State: AOAM533tHS56KS9Rugv9XgpziPMvi1u4F+L6Zo1mYnf76vsfTEDxbULc THvrwuefIxcJhVFFqJm4bNo67w== X-Received: by 2002:a17:90b:14cd:: with SMTP id jz13mr15761663pjb.192.1633319172391; Sun, 03 Oct 2021 20:46:12 -0700 (PDT) Received: from localhost.localdomain (61-205-96-147m5.grp4.mineo.jp. [61.205.96.147]) by smtp.gmail.com with ESMTPSA id a11sm11863515pgj.75.2021.10.03.20.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 20:46:11 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [resent RFC 15/22] dm: blk: call efi's device-probe hook Date: Mon, 4 Oct 2021 12:44:23 +0900 Message-Id: <20211004034430.41355-16-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004034430.41355-1-takahiro.akashi@linaro.org> References: <20211004034430.41355-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 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 Adding this callback function, efi_disk_create() in block devices's post_probe hook will allows for automatically creating efi_disk objects per block device. This will end up not only eliminating efi_disk_register() called in UEFI initialization, but also enabling detections of new block devices even after the initialization. Signed-off-by: AKASHI Takahiro --- drivers/block/blk-uclass.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.33.0 diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index 8fbec8779e1e..ce45cf0a8768 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -827,6 +828,11 @@ int blk_create_partitions(struct udevice *parent) static int blk_post_probe(struct udevice *dev) { + if (CONFIG_IS_ENABLED(EFI_LOADER)) { + if (efi_disk_create(dev)) + debug("*** efi_post_probe_device failed\n"); + } + if (IS_ENABLED(CONFIG_PARTITIONS) && IS_ENABLED(CONFIG_HAVE_BLOCK_DEVICE)) { struct blk_desc *desc = dev_get_uclass_plat(dev); @@ -843,6 +849,10 @@ static int blk_post_probe(struct udevice *dev) static int blk_part_post_probe(struct udevice *dev) { + if (CONFIG_IS_ENABLED(EFI_LOADER)) { + if (efi_disk_create(dev)) + debug("*** efi_post_probe_device failed\n"); + } /* * TODO: * If we call blk_creat_partitions() here, it would allow for