From patchwork Fri Oct 1 05:02:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515004 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp453578jaf; Thu, 30 Sep 2021 22:08:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyutlz+3I4rAvkNBImnW+aIpSF3Ep7ut/p9Oszsi4XKh0ekX5BgxQ9GOW2MJvAdnTrVg4Ml X-Received: by 2002:a17:906:2890:: with SMTP id o16mr3972663ejd.161.1633064887979; Thu, 30 Sep 2021 22:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064887; cv=none; d=google.com; s=arc-20160816; b=yqbK4QZA4p5rvaegf2ak8VRigctWK9Ld0Fz/11C7Me6ZR8nEBbmRr0E6YRyMlxQ1rT IluXwc4+XjPreWmwgyrEMxY7anzlNOjOGhH41J4jexgLyLJ5CCnF9POGakSHX/r6lmeL qHizDbmWG2c5h/ocFQAvZz4/0de2IDwjiQcqSfWzgr0rFfrXvTcfcLD37kI1cxoLXZn7 f1nRZZiJSq53yCbGVs78iLHmW3vxi+26kKxGorwexcYYJuN3PXQ4t+/zdK10JNkpKqVX PRKLSl/sMtzBVZ/H3RKw9IbfV46+OSYDKAZdBYRgFs1roBDGmbv+3VWSIgfwIVgHCT5U BM6w== 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=fsZjtBaEIWRvm6v795rQBKqfwYOah4Pd3V7hQANCSD+Vf1mhA4q4corP7kNJ+1kDNv oCiHOSePxMT4wK7aOgpjk56CbmMdv1beMmSRY+l2jQA6m1iKgf6kI9q9jXjlRj5recXY xnHHYv3fABo1yNjEdePt7+SVeoWqQaXsHbtytnazN40T9HqgBtEUFV4WY4p7MSbO2M94 ERaX4trbXNGDuEbjLYDsFQeo1CH9FZsacv8HO/ClL61SXVuKhSgd6rsPFBoz1YDDfZg9 K9utLS/7TJv43E9jsbUhtZMLdZnBPL6nrdzyPzbZBpEDPh5vi58spqSnmduboH8bLVmX RNcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Tt/GatTj"; 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 h17si8930851ede.473.2021.09.30.22.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:08:07 -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="Tt/GatTj"; 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 3D8D783433; Fri, 1 Oct 2021 07:04:55 +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="Tt/GatTj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 28D1B81FAD; Fri, 1 Oct 2021 07:04:33 +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-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 14C4183426 for ; Fri, 1 Oct 2021 07:04:23 +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-x102b.google.com with SMTP id om12-20020a17090b3a8c00b0019eff43daf5so6384028pjb.4 for ; Thu, 30 Sep 2021 22:04:22 -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=Tt/GatTjhbOemtHrBGbKTN6aA+oyyd+51P3cDZJ1zJxq9QhW4M/2eKDF2B1OIj3Qop dFnGt1JSmyHPl9CvLxgSSjpehQURv/aEEJbd8QCLEou/Doy59stigamRh8FzkIKcQovf nLYC79vmLMkuuOA+s6ZuWtR2HiJA2UJcx49ByNmfNEqu4cul7yjIqalZBKzKPxCXB+0A OOk2YVITgUF3k/XzupelAiMDssNVTR82xoKhfvcb3p80G0DiSkzN38OfxyVXO74m/o32 qx5Qjgpt5cE0TeVxfHjCcOT0KhEpuAXC1wNkkb33Xwg3wNEvgWCEH4cIt8f/XXSG4S4i 0uTw== 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=54nH18k18Y8o1inNCqUTfdIhIWFkB413BicdmXos/BEic1pDuUGubnCxb/OOWaq4tb wsYFJOQ4uA+x7j0archc6TD5sjo/0GAnQN/jEhKmDs5cR/eJ6V8onC1Y00HA0P+OtVxB z/dgz8SNv160qwYUg//WAERP2EV1mtjvGRofzMwbY9ORxJQCHUbJ0cQlNFPQRmLaNW5A g4vyQJcDBSChmH3uJNEGcI3x/crSKsjmgzZRqmWgyGwZ2ZjpGx37oiWodm3iRsrlWUTF Tec9bbgrMaPOXGdDwTfeNq9BgtTi/GW1YQQwjHeuvpY9qfU1MVbO5NDfQBs+o3HaRqMw 0F9w== X-Gm-Message-State: AOAM533UhR+eR4kAqVGpYgA+LCKLqMX/QeEdj/vyXZ1gYHgfGbWDMdO1 cNJOR45LlWsmoWrPtJ1pCfoowT3FYTLuMA== X-Received: by 2002:a17:902:e8c2:b029:123:25ba:e443 with SMTP id v2-20020a170902e8c2b029012325bae443mr7912745plg.29.1633064661347; Thu, 30 Sep 2021 22:04:21 -0700 (PDT) Received: from localhost.localdomain (122-100-26-52m5.mineo.jp. [122.100.26.52]) by smtp.gmail.com with ESMTPSA id z8sm4615113pgc.53.2021.09.30.22.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:20 -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: [RFC 14/22] dm: blk: call efi's device-probe hook Date: Fri, 1 Oct 2021 14:02:11 +0900 Message-Id: <20211001050228.55183-28-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001050228.55183-1-takahiro.akashi@linaro.org> References: <20211001050228.55183-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