From patchwork Fri Oct 1 05:02:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515006 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp453787jaf; Thu, 30 Sep 2021 22:08:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYR2zEr4qtAlIZCoD889C9jASw0N2zSNg+x7MmvYM29pIiclHT2K0uzbnenD7Qn0wssvXw X-Received: by 2002:aa7:d5c7:: with SMTP id d7mr12163879eds.187.1633064907919; Thu, 30 Sep 2021 22:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064907; cv=none; d=google.com; s=arc-20160816; b=UDKgEsaEn0kjJs+KQsemdD88U0AEAxPquFSHFohUW7pFkZ06GS9uiGfS/db1xhAVJ1 CK4AJj4g36+RCj/Lw3Fwtg/uzA2iv2vo9fZfEmtMrTc1CxaozkE5GclbuQP3SfPTamQW ZAitZh0Gry1GD4zWZCQZWHszrKjVcuQ1NlwYNDF54Z8ZN+qgvAJXChz8rFtVE6ki/PQH sSb68Q881zsHoUDULafMI52fwLk7kP4DLJlSGfI+eBqwwEY/21rFCY65GkJsM7tsUJrP A1ror7M/3oQibOiTgtv8toQoTvik3MtIakGOzwnY/+Adec5Hg+N+pCJXxXF63pdwt13v 2RSQ== 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=1KN72NoGjlEkpoJgBNOOXSodnWMJtK5H03f7jve4wWYNYAnNMxozesm9IRN0I9bjGh rkozr5HCh+JF/ZL32hBGbd9KZiuMVSSa+1i6cWFHSSgE0REqh3JFqHHpYxuE5Hm2mfqu seZWAjojEoTUhNoIZ62D1hduCUuMlK2giDVWLwE3KG+Hr4qkSZXblmQt1jxBXFRh00R6 3o2XpepgchiQHkToISIQuSiL5oMv1UCL+SyBCicFbzqf/SPcDy4IWdtRIhMPDMosi0al HrJTrEYqIyZx8Df+byOO49gkzIZnXNQlHL97bjla8Sj0HBA1x8lKDLYf8/npvHyto0y1 RVgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ph2hkugF; 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 q1si5541883ejr.43.2021.09.30.22.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:08:27 -0700 (PDT) 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=ph2hkugF; 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 AEF1B83238; Fri, 1 Oct 2021 07:05:12 +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="ph2hkugF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C6B3783426; Fri, 1 Oct 2021 07:04:36 +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-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (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 ABDA28316B for ; Fri, 1 Oct 2021 07:04:29 +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-pf1-x42f.google.com with SMTP id w14so6923795pfu.2 for ; Thu, 30 Sep 2021 22:04:29 -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=ph2hkugFaq1k6s6HY6XaVQSu13YGEKEJA9ZnhMajL42bect1wILS2B3uG17FpK2+g1 lI63p9aS1t9qs1rZUkAFG25h6RbZiot6vp9WFNA8FqJwFmYz4wgv7kree3MFkZUx8CUf eyJADwFSRkKTzcffdlWILw9dRM4Z4mKUwRSyB6wZJjOvvK9JYkV0mp3YjJVbvj8NeDnW Jp/xRZ7BODYMGQC3FNw2WsG07FSzSzkDy0FU1nAPfNvDhCeiV2/5mLviKnTY/E7UWy1v YYdWe1xjN09aPRgwZMe0uevdgz7FYoK2iw9aSzWRXo3a/qaNrjQD2tW2ol9ggRnTnlSj rq5g== 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=oB5idWSkiX1MXx/ammyPtAkmLCKcYgo0dOezuCuSekNki7JIEF/QvcoRRaS/pxInca eSjhq4jykCPAuKq5go+p/Ik4YKWoOZe/RU/6wHBwKFjmE7B2nTJ3ZTQVeARhyrSxT5Yu JYGAPB8rKqK7Mi13gpIFwXsDsDwpNQHBn2mtaBqnjZqfnvcgSpjjou6ZnZGRQ+TMz0xH YaZJbuT/f2iMOHQ1dVHuar5C0WJA5yQ+UFX8o948OwIMlp6fpDFXqsV0lWvzsUwTOwGu bFvxAgA5UOfavbTXyoiBmM+3Ko5iPc5ut5vz74KGp9OiG9P8Jwyooi1euGDGhZLck8Gm E+ow== X-Gm-Message-State: AOAM530c9AI1UK1Nb8m81ngpv3pgB9QBCWf7HJ9M1DsDUcePDczfG6yN oFE+Dx8LFs6zDadq2OIa7cjiYw== X-Received: by 2002:aa7:9561:0:b0:44b:45ea:806b with SMTP id x1-20020aa79561000000b0044b45ea806bmr8147473pfq.57.1633064667924; Thu, 30 Sep 2021 22:04:27 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:27 -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 15/22] dm: blk: call efi's device-probe hook Date: Fri, 1 Oct 2021 14:02:13 +0900 Message-Id: <20211001050228.55183-30-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