From patchwork Fri Oct 1 05:01:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514978 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp450596jaf; Thu, 30 Sep 2021 22:03:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMyNuojIBH/DHX7V4nT6+YV0xPwKh8HkVDoOzym5uHmPgXxvp8hDrGM6fnsa6FkEz4q7m5 X-Received: by 2002:a17:906:5051:: with SMTP id e17mr3834213ejk.481.1633064582061; Thu, 30 Sep 2021 22:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064582; cv=none; d=google.com; s=arc-20160816; b=sZeuSWafhqauLARjB0szetkH029y9wT5B9w7cji9CwPrH9pL+fpCq56cGEZb5AURmr iC8qW09E8+3jAx1E9kSzbgPF5XEuFdhs+v5owpnsR3KP2ppyZn571gyT0pNjdHW7YX99 8y6kRRD5SsyJ6GjEp1qXxk1wlq5qjND0R9HRotsUVa/zfnICJc+H/FDOU9y/APhrLRZ/ tRD/wfPEQ5WHI7bTDaAe8i0tJ3j572uU9eeOVU60Cr9cpC7uaY6LjWc/qNEaGXXoHBn6 0ZXLQYIHaVC4/GGlMAxgPno13ntgkIkUSn24Wrol/jS5kjRve6hum8EpVno94cn3PAh+ ugkw== 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=AnfPfV+cavYk3G8dtEDjlVGQ1nDZUEBohAoM7azohRM=; b=D5Y87lvvr+dQJNJt74OItpVToTFiH/P/8SurlGOW2unA9sUAEDGO4RFeWo3ICnDhEf zKLlT/PFNI0r79b2FsAsk134pWTJjL6S5Wh8yKq5xYcNju+EiFlrrJ3/2WbZSdokb88b iWoK0ubIkGnOT90+rHjb6wq9+MqHkIKz9Z9m6GJ+0+dD1RMAYv8SDBmER/k02bIwZzCR kkc2JAp4VkQQ1tuS2w0um7mcXX2z14hsvzCUAXH9ZADVRCBaR8II8uj0HwI11smwl+Ks KYlg75AETB5RLLZ9pj4Ab0BSoVChHvdGLpteMtIMSYnVHqf7pGfEf88JLLoJHiirF7Py YKAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sDAMdCNP; 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 v8si5370099ejv.188.2021.09.30.22.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:02 -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=sDAMdCNP; 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 95F89820ED; Fri, 1 Oct 2021 07:03:00 +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="sDAMdCNP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 348D182006; Fri, 1 Oct 2021 07:02:57 +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-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (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 548CD81E1C for ; Fri, 1 Oct 2021 07:02:52 +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-x102e.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so2601701pjb.0 for ; Thu, 30 Sep 2021 22:02:52 -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=AnfPfV+cavYk3G8dtEDjlVGQ1nDZUEBohAoM7azohRM=; b=sDAMdCNP8F679DlE+QmytiifOnQPkhr3OA/HmaAeyZAZQu63Oe+SGLaboc8aSbfChT FRac1F/6mA+1l5hlFv0oEY6le7ZiQ1XlXO90NHLHm4HLXJiwByV5yhoGHuVHTbXK3qxt kvsU3DjMipiGu3igf40rvkCRJCT8MYq8ijfFiUevAkzJZJoLDDhnCUBcI9l589s51IKz DWUMKJLmseTzXsNOz69EyokVeIFPl578E1n+gUOeNzMvC0ErsF/CEW6bOuImMVEspsyy 0uK36KEa3T1NfBQgN/vIE+ha+wR8/xnkDOBgR9tQgV9BBE+Gk5yDM+eyMi5oFYp3xwvW aOJA== 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=AnfPfV+cavYk3G8dtEDjlVGQ1nDZUEBohAoM7azohRM=; b=5r7SuAuIZnuyiRCEh+d6bfNB7i39imjM/TNIclPEl1n79qAo1rTsWBuAxxQZSbJtZj sYYU4eNKqqE9r2PWUIs5uoE5U/hDcfo3fX1V9QgmrDxFAUficRAJ1CKncXxBd2v6bkOQ fjNiNr9R7pk1L4HzUmRk0WBGcC2U0yYdcCQxTJ0Fhz4yi6mJsGv5ySh1K3Z4CxtU1TvW kitGs5gHBDuwuJgr69dxOoJevXBa2dPgJaIccR9RACRv0OpfrbwRVR+Lg5LPXWH0pw8s x+afwIQjCOALx+FlwGKV9CClhD1xLb5G5EidWysQUozhc58IWsCnwpYjOuy4NIVaIDSW ZIAQ== X-Gm-Message-State: AOAM532aoa/zvZ8RGp8IoWlTLEf3HU9dg8OHSzNK8A9j50h1vBjwoWes u2jcFQI/65lmkDXb+z7mOc+geQ== X-Received: by 2002:a17:90b:4c4d:: with SMTP id np13mr382014pjb.193.1633064570507; Thu, 30 Sep 2021 22:02:50 -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.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:02:50 -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 01/22] part: call part_init() in blk_get_device_by_str() only for MMC Date: Fri, 1 Oct 2021 14:01:45 +0900 Message-Id: <20211001050228.55183-2-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 In blk_get_device_by_str(), the comment says: "Updates the partition table for the specified hw partition." Since hw partition is supported only on MMC, it makes no sense to do so for other devices. Signed-off-by: AKASHI Takahiro --- disk/part.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.33.0 Reviewed-by: Simon Glass diff --git a/disk/part.c b/disk/part.c index a6a8f7052bd3..b330103a5bc0 100644 --- a/disk/part.c +++ b/disk/part.c @@ -427,7 +427,8 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str, * Always should be done, otherwise hw partition 0 will return stale * data after displaying a non-zero hw partition. */ - part_init(*dev_desc); + if ((*dev_desc)->if_type == IF_TYPE_MMC) + part_init(*dev_desc); #endif cleanup: From patchwork Fri Oct 1 05:01:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514979 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp450700jaf; Thu, 30 Sep 2021 22:03:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdQ6ItwIBWWhK4eVE3YBUhXsrh+JICjLUalI/v4m68sOmuSQlVMBSLjGKnbqR2ajiGPmsR X-Received: by 2002:a17:906:6943:: with SMTP id c3mr3935850ejs.550.1633064593274; Thu, 30 Sep 2021 22:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064593; cv=none; d=google.com; s=arc-20160816; b=DLyIQJsi/7us3S0Aqg0gUmlRgGM1wyUU/72q4kh69NaAJUMr/KujIoIQsE6JZ7cOiV 0BOGL91QDbakpSEZfEEv0YRN6FtpnjMf3bEM1IDIvqiMHlrPt8xzuMOHR+H75A/nXVmO JdBaIn1VTEWcUL+C91QOtpAX7590+d249fJuB4MPDWX3iajFiIc8H3x3lGBfrnrm/Kx9 5Bg9a5Sq6/TX3dCCmlP1GRiEgeVJxl0iflLBxtKL4AE3ohZUZptdSWOVq5lSDbr0UZVN TzDRCwPSfKKoNHLge7oIgPD8s7s5xIJDpQCuySEnYG+1R/3ZutpHKIhANwT8agSRczp+ KUNw== 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=6lrdVuf2bMn02/XrYkdZnAojTsvLmTg0lU2639BMch8=; b=FEq7ilmwHQWODUWAGWpd97qYF4WaBoAjwpFQbhDlPwYQx7536rsJxXC9N7BdwK5QTX NekFJY07U0metTmJZI7EWW1kKGvnIySAfO1G25y941fCCPUj/uwwrEEBxzIUtKLklffN Y0+3r2su70C91imimEYEzBIC7HzpkE961FPCkJE2ZJa8cd/mFEOpK7Ef8cN1sevu1IS3 uzQQicSZAgdJhYb8qLUN+PIyOCnHBDjqUAuktPWjk7ObV5S1L7Iyviu40odV2BQJ8JAy L2v97oeaT+s6Ddz7uc6U5y0/P9GsYX0LwF95dWoGz0YLPh1hS8Dk6pQ/m8d39C2HDnsX +dvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zxTCOoqb; 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 t2si6008628edt.298.2021.09.30.22.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:13 -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=zxTCOoqb; 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 8D55682B94; Fri, 1 Oct 2021 07:03:09 +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="zxTCOoqb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D34681FAD; Fri, 1 Oct 2021 07:03:04 +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-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (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 C530C820E3 for ; Fri, 1 Oct 2021 07:02:58 +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-x42b.google.com with SMTP id u7so6861629pfg.13 for ; Thu, 30 Sep 2021 22:02:58 -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=6lrdVuf2bMn02/XrYkdZnAojTsvLmTg0lU2639BMch8=; b=zxTCOoqbc7PeWVnnn5fPWOjfBRqMJ1/e3HPS4/C5Zwo4fMaYSEo7qR2b3MYAjd4CCo cXB9vqVb0nf1IUscpXt4t1cZ5AFKQoOuVrnlLhfw3MYuJ27K2bXsAyewRf798v00rYfE YrmpHnkZAHz7tMmaC1FvM7MBDYdKZyvKcLpFPaowSVg6RzRkvgwJZ2+Z0P2dNWatcYFt eSXt6h3GAcaeF9u5ja5cncen5WZvrAogtf/icQYgb7D5I6K7o77GehYYlnQJY3BwvJwF CkwPlZmOjDGtxHPcGkKbXIqfLLqF/c+Ry4xEJPmGU311UmLC+obYNwEq3Xgi7TtZq4+n Kfvw== 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=6lrdVuf2bMn02/XrYkdZnAojTsvLmTg0lU2639BMch8=; b=74Rw8i0olVX6wxJMOezjpHlcWbe209Kb++TQ80qt6PdR+3tS+x0IszcWAFegZsI2gc 0gMPgKqX5U7FLaMKFwZl7OH8Nvc+t8oePc680DWcOeeP91Nci69Apa3Dmm266vfkpLIS 1FZgWnI6wYCHhff9ejVB4gDWDe7PnXObGvngQ/5NGA4ANYGWwr6L8V0YyoDwWTh1kC0j BEAbkivWhJ4iP7J9/UYS2moYxKMmbBHXnDzI5UNWoiWUkMkZN3hcchG3AHoc9nGPNCsy mBHRIEhs3E2SKZtftUsAz113JXFJxni3Pqd+ZiAfZXkxS0OIF1AiU2GvbVf5wuE/5kmy /nMA== X-Gm-Message-State: AOAM53355dJs1R8VnJFwo3ZKyN1j7O/1h+nU3sVffnq/hc/9o1hIXVuF 6YGQVWPLcH9LlTV6DddjrBzy9Q== X-Received: by 2002:a63:338b:: with SMTP id z133mr7876547pgz.318.1633064576583; Thu, 30 Sep 2021 22:02:56 -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.02.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:02:56 -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 02/22] scsi: call device_probe() after scanning Date: Fri, 1 Oct 2021 14:01:47 +0900 Message-Id: <20211001050228.55183-4-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 Every time a scsi bus/port is scanned and a new block device is detected, we want to call device_probe() as it will give us a chance to run additional post-processings for some purposes. In particular, support for creating partitions on a device will be added. Signed-off-by: AKASHI Takahiro --- drivers/scsi/scsi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.33.0 diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index d93d24192853..4865b5a86fd5 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -595,6 +595,16 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose) ata_swap_buf_le16((u16 *)&bdesc->revision, sizeof(bd.revision) / 2); } + ret = device_probe(bdev); + if (ret < 0) { + debug("Can't probe\n"); + /* TODO: undo create */ + + ret = device_unbind(bdev); + + return ret; + } + if (verbose) { printf(" Device %d: ", bdesc->devnum); dev_print(bdesc); From patchwork Fri Oct 1 05:01:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514982 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp451063jaf; Thu, 30 Sep 2021 22:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvQpHtFTEPiXu/jd5xCAu/CBsl0i/TVeJSnXGdoZ/VQWKmgF4aOwE7T0x2EHzch2Z3b5KG X-Received: by 2002:a17:906:3157:: with SMTP id e23mr3998899eje.29.1633064628751; Thu, 30 Sep 2021 22:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064628; cv=none; d=google.com; s=arc-20160816; b=kGN3wZiaBBNdliL1uddFcLhUjSCTdJlfx6rnV0X7+h6LDRiDIdCo3BwMrwoqwfi0jH BtkKnFuECsL6DxU2qzvettxImBxdmcptwzmXxqz75wPm1mjh57j/rDdtKSJ9EXrNkkWg TKIh+Nqq9awwjSd8yBjmVixhJVqpHlj1l3xMg/+vXV9sB6pqQ5AlWVjmZeckU8m68j+4 FY0WnsOTQu00DlSIfZgkGytfI8cbjC2lsRQZG5EnNaRdlGXZOnuO6ygGfZd67zxbKvBN MCdvmw46HP3HedIZAypcC9ZzaZp5sreY/Ntqzua5sKJAdmjs1Y8y6SzqggSq7f3a/a6X Y5eg== 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=7OKUttBQihWNcWyMidD1s3fR2TfffMDvW/RIGoolU3A=; b=tI0m3A88Shet4b58vVtAigVS6luBt9HL1rvxmWJouLOJLXWRc33enu6DGjSrjeSeux U/iFbvQ2+iUay0rb1DFRz+jr+uIdoBtowoIiNRMMA+UDYjZiySDB43i6b8+XVLrmCMKX HaSgch90GcIF+XHSjdKn9XdfRrAMhosawrdrPpcl5iOHjW8BQWOqkevzvmTarNF9ac+5 2e5eHVplcoDVzHL+LirQKoJxwe5gXm6woyuX7GtD9CejYajLU2M+DvXQYoBbVHHH4Uu8 UTlxEbZ9glBHPXxMocYQrHjo/qTjINZg1bqlVCg8nDXWxO87oPOcKcgfDx/VHmLZfqc0 bnYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hQqDj1Vf; 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 qa19si6343974ejc.379.2021.09.30.22.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:48 -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=hQqDj1Vf; 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 732AA81FA9; Fri, 1 Oct 2021 07:03:22 +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="hQqDj1Vf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8DA2E82B9F; Fri, 1 Oct 2021 07:03:11 +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-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 E5C5382127 for ; Fri, 1 Oct 2021 07:03:04 +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-pl1-x62d.google.com with SMTP id c4so5536334pls.6 for ; Thu, 30 Sep 2021 22:03:04 -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=7OKUttBQihWNcWyMidD1s3fR2TfffMDvW/RIGoolU3A=; b=hQqDj1VfnZCqUjnRWdFP1qw/n2W3fe53/VhRz7HleaqhIGgKOi4ENEgApewaa+ji9C 1cgYXq4qDDPLIMu0FHmeIQzmGN540JkOp8CUSs13I/gulmoPLm1sEA6UT3Rq+A7WQVIK L0R64lIJh1SATHBbUn/GoDZuAGO1t0WacqeB/yLpayKZLDRUsYeFDGRUm/SQKe4Vla70 xyvt6/YlNg3shoUu6i7qrA8Yv4452faC6LCtQuAtyrjsJ8N+fAA6kFcLjmY+nvBjhp72 GoS/bMaumKstH8W6V0E2b8pr/jK2K/S7mt0DMSWbeUQsVBWPN7+6zf4f1U7Hfbyk/D9k Nk7A== 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=7OKUttBQihWNcWyMidD1s3fR2TfffMDvW/RIGoolU3A=; b=YjOY/XlqbV2GC0enSQ1ctrNLTfIS3pdWuYtCZCYaXEDF/pzmFEqhGpRPYikRJGseft Gx/Hd6bP+oR5vVqRpDbv/A/er48E7Fb48KhmHZH3xFm6t6eYpA2fACiSbWRRjxitQmrN fURJsTDdTHgZRW9b1RUeGf7Li/x/QwRO1ZVX5dOywiXAkDIRJU+hfMyrwXewPlIpgN2R Ygf/F7izpVJwMtIlf6Jw3UvqEtyKT7/3AlFC/Y5UJNkS+RtKRznT/bDbwRAVm0aNsbwD qZ8EF+OTBX3RIwk+BL+BLCSuL6SUG2A4/6PaM0yOYgGh54BU1ujccpGv3ZAJMwYaZDJj Dx+A== X-Gm-Message-State: AOAM530IkmO2NxL4eSvfl/CJlkoR8v662O+ShTeSOLyuveDh6XJ/w46Y V2l8f5syUJ8kn4++USqttnIPDw== X-Received: by 2002:a17:90a:1b2a:: with SMTP id q39mr10869371pjq.219.1633064583083; Thu, 30 Sep 2021 22:03:03 -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.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:02 -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 03/22] mmc: call device_probe() after scanning Date: Fri, 1 Oct 2021 14:01:49 +0900 Message-Id: <20211001050228.55183-6-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 Every time a mmc bus/port is scanned and a new device is detected, we want to call device_probe() as it will give us a chance to run additional post-processings for some purposes. In particular, support for creating partitions on a device will be added. Signed-off-by: AKASHI Takahiro --- drivers/mmc/mmc-uclass.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.33.0 diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index 3ee92d03ca23..07b5c1736439 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -418,6 +418,13 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg) bdesc->part_type = cfg->part_type; mmc->dev = dev; mmc->user_speed_mode = MMC_MODES_END; + + ret = device_probe(dev); + if (ret) { + device_unbind(dev); + return ret; + } + return 0; } From patchwork Fri Oct 1 05:01:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514984 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp451272jaf; Thu, 30 Sep 2021 22:04:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiOMiWtVj+yW1NN61acj+I1cPnf7NbOxJBJjaReI75Z5N0U3PAO8W/c5j8OJkpVEtHjOmm X-Received: by 2002:a17:906:6dc1:: with SMTP id j1mr4005281ejt.324.1633064653479; Thu, 30 Sep 2021 22:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064653; cv=none; d=google.com; s=arc-20160816; b=SfyThz8se4kuqYBoYvZQyv1wsfRFwv54kxXuV0TbW/gBlXajYccKq9VSOX5YADcgQe AqKZXOpT/Yi9s40enBuikY0Cj2dAG7K08B+9bEzCXwNkyxFg9IcWOZWELrOwBX45KrVS zB1eq+a3cMojt5tzc7KEg7+oAzYSMkhS1EyGyh22uTRJHZD3CyIrbm2Nu75lVBjThbxu Hlsx3HvrlH4SLhJ9qWDM7dnfJ5QjWBRGIusMi/GlWj91P6sHCIVAxrq7pRm1fKOHpADa d4XICOOeVcjJqjpeqPjVb5STFNo6hK0AclKJeDrH+7UmeDRmaKV756XD3VSIXxsrDeFv VN0Q== 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=7OKUttBQihWNcWyMidD1s3fR2TfffMDvW/RIGoolU3A=; b=xdsgO7AV30e5KFHeHq5+ylimf8gq5sHF9lbaXkdtz17tGPjRd26g1BHGy+qc517Vmm vvW1AYmWz4suguJpZ2FoIyfLT+FphY+v7JORLVTYj9dvu3PMWy3vTBcEX01ni6O7swsd W23cyPrbcbGfeFWVGtrWTvOiqGHThWilK+N5Kxt+pKjm8kdzj340CirtyO5lhs7yWU9w j1YkPqf7z5xhsYooxZFKZ6Sjjxw0dsjAZCJ4mhpRRaSjOAibQEvHGOGO2UmiBNo9L922 z1wAnd56gOWq25FdpGVczZbfMq+hK0k5wkHlA/kHY3GCu9KrQJwXgxZG4KcASe8fg6PI oRlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TtxJLefm; 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 m7si6855954edq.29.2021.09.30.22.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:13 -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=TtxJLefm; 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 0EAB581EE5; Fri, 1 Oct 2021 07:03:31 +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="TtxJLefm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0BD2F82021; Fri, 1 Oct 2021 07:03:16 +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-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 DCF5C81F0C for ; Fri, 1 Oct 2021 07:03:11 +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-pl1-x62a.google.com with SMTP id w11so5513927plz.13 for ; Thu, 30 Sep 2021 22:03:11 -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=7OKUttBQihWNcWyMidD1s3fR2TfffMDvW/RIGoolU3A=; b=TtxJLefm5slwsfNe2UoWt/XZDieuaZ5pFU8pQdAw5Fv9s9S35qOltT/grE/lLbiTUz oRiFi/PX/6Q//MiWedF/kjcDa/JVM2wiKV/zDu92L/FaFys3DC5YvLS5RSSqXCK0ihrE WgVIVYmLIlG8aLPcfvaGGpbLyuCA9aGwZbxUqCXDvWOsG/aKnu87uBc7hfqoSCd7jhil 9WAvoaPLShqmEEJVZvosFUS6Eqo8yzgcebeeeEUf4NbMdfuQaw2iXJgYdXIX9IoE6emu SoAF8atqJ33higFLr0QmiBhhIZcfT8mSqoD8f4bfdEDTGMMk2PRnIO9615hMBa9uM40z br3A== 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=7OKUttBQihWNcWyMidD1s3fR2TfffMDvW/RIGoolU3A=; b=0KPXjjG3dWkiIVlf0oVp3N/tD5EoVLc10zvkLSgsX0r6ChSkIObepfWCbZdATEw5Bg qSbBRrcRe/sdX+e2c8Rf1A1OTKM/4HXqk0pwEo92u6IbUwfjIMiUzBKNw15DUqcpfmAN Z4Z5fs8xCsukiDg/uGc0ldv7XzyTVwfDcjI/zxxCPVexdy7rf2hBs03D/WY16EkmPV8Z qiBfwKCDSu54xkBypxdjH1WjZfyvnoKyZ0n66yNU7mwD1hY6+xj767cGD/OYL9105Pow J2c5MVwjIddyq6a8DgUNIWwn6xR9y0olRqF9Bzf5uB9PzLjsmko2OZ+WWhl7SDIRIH/2 AAKQ== X-Gm-Message-State: AOAM531YFNKbfQ0L3osoHHh8WqTDRj5Hh9ZrFs8/wKgrsC/4h2WSGFNP JWuCVMhoCB7EbiiD6gRlDOwpAw== X-Received: by 2002:a17:90b:3e84:: with SMTP id rj4mr17588984pjb.208.1633064590055; Thu, 30 Sep 2021 22:03:10 -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.03.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:09 -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 04/22] mmc: call device_probe() after scanning Date: Fri, 1 Oct 2021 14:01:51 +0900 Message-Id: <20211001050228.55183-8-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 Every time a mmc bus/port is scanned and a new device is detected, we want to call device_probe() as it will give us a chance to run additional post-processings for some purposes. In particular, support for creating partitions on a device will be added. Signed-off-by: AKASHI Takahiro --- drivers/mmc/mmc-uclass.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.33.0 diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index 3ee92d03ca23..07b5c1736439 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -418,6 +418,13 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg) bdesc->part_type = cfg->part_type; mmc->dev = dev; mmc->user_speed_mode = MMC_MODES_END; + + ret = device_probe(dev); + if (ret) { + device_unbind(dev); + return ret; + } + return 0; } From patchwork Fri Oct 1 05:01:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514986 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp451527jaf; Thu, 30 Sep 2021 22:04:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRI5+8cUip+j5UflDVRtwD//V8/Yhy5gGUF6Lx1Syw3EzTyxmrV36SVHuoXeuJP5Lho/p8 X-Received: by 2002:a17:906:d182:: with SMTP id c2mr3868753ejz.47.1633064679881; Thu, 30 Sep 2021 22:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064679; cv=none; d=google.com; s=arc-20160816; b=QCpVxpy7C7HegAfczrE6dPT+QoC8TLaMBJtwSQe36fv2mYXzheYl6WZRmii+pX7xI9 yi0DsZbE8f8h8BD4OFfYZZ7pgho/FsNh4sWBQTZqz9BGq1Vrjg8lAHiPEfkoL/wyGvt2 SHU4VgA0rIjN4bhvwcj3qEY+UOqcruJqNC+Jp6qv0Ee57xZEFwXMTlwNQbrx0PHhJj2s XiSvH0LCggyuZXi94CQ54EAGtRlF9NV2vs9lHSLUoWx8HcJ4ARBYjrVK0qbBTYnt/AQK k5N6o3S+BrlfoWiYl/ylpMnwtcFaUFoQzuekvboBFgIvxqMhhVqw9cP+9EtlZGHtQJuW WRHQ== 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=O9pL0Hmq9ZA289/TrCWhV3wB8eKqhp6uxXQgYO+xSj0=; b=EKUbY3rdrQ/j+uYbDp3GjIB9f4U1866uecH+jdY13DX6iUDPTTaVOZ3bX8lJddM4+s RIPN7lacXf0LWZ/gCoh2eYiWb/gFfjmjPJAJzAGb75Btwa4q8VOyDhyW70N1l/yURfBu SNEqfnkXvnTiqaP7hgrbkGUR4uAUWiAbMZI4FoLnJ3adeXW9sBmNL3eWf08lznAk7S4x X3VVGo1HJgErzexEShzZqzdaMVtTOig/EX0dVB5fs9sI7BhO+r6CVWNQH7ytTyzG3LhX QBgzml8V5fEq8JzhHe1o/fd5qGAlCFv7QbxxH22jaknGlB8v60iXYEJgimUpFPYNr6Qu 15UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oSdv6rRx; 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 kz10si3114951ejc.582.2021.09.30.22.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:39 -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=oSdv6rRx; 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 17F3882DF9; Fri, 1 Oct 2021 07:03:39 +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="oSdv6rRx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7689E81EE5; Fri, 1 Oct 2021 07:03:26 +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-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (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 8F1D982DB3 for ; Fri, 1 Oct 2021 07:03:18 +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-x42a.google.com with SMTP id y8so6894097pfa.7 for ; Thu, 30 Sep 2021 22:03:18 -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=O9pL0Hmq9ZA289/TrCWhV3wB8eKqhp6uxXQgYO+xSj0=; b=oSdv6rRxjNcv2pfNyESI9wbJ5/4NCEnJ4NxYLF6/tTagWu2J7brd3ZViAidncKB7ss +lZsbpYN6oyXALRGHpoTcoyzfPCej7S2N5kANMlAYCBqz+MeYADGPCJ29ZLl24MBaJO4 gHNonjM7fwvwvoIu0GbXkMGlDEhw7X/8WCHasl562+wjh9HJFCk6RZgXzZl0NKVLB7kv Lfzdhb0v2LkDLZEj0fPXrhyUvr7g+K4FlEktJPF0DzkFwk0FnC7NXeTJ5ffjacCSpjxW LROxMH5/yyZt/NijiczauosFsQUhIVrVpuqlT//sxPgJSl0sChnv/bT0eAGg/0EzsQuD JRig== 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=O9pL0Hmq9ZA289/TrCWhV3wB8eKqhp6uxXQgYO+xSj0=; b=oT2ojVqWsWE3sk+t1coOL2vEnL25IQ2l3pKW8w8eh6K39Af6ywzo6juSru2FNcQ4Eg 2+VR8KZB9Uo4u1tZNOg9RKHGqQgEqVla4JliTkhNxxK8UkwJgf3HCbfc4L9O+v0Zcsyr +hBNsz5GZAQPaGYxIpdZ2i/tpGAb+Ze211SblZtuvhuQrB/rV5TYXPJp90VqxS+CBbTW toIDwgoPmMV5ExWs3jX2I5vwWfIyF5be8JYi94BREJlhN73v82qoqaL0ciC/E8ETOQ+C PqV3sNb/RhUQST3r9BKMbNSR72SaKo78hgAZPbVM9seMWTfeeOlhqPLItoy4ryse+DgA yjhw== X-Gm-Message-State: AOAM532rn5zoIvdxWrNmVwaqu6vm578/5AaHdMNu1Mmeq7Yjtx0xePw8 o2Ah/9rksJPMsJWNcOAknFXxXA== X-Received: by 2002:a65:45cd:: with SMTP id m13mr8358031pgr.26.1633064596714; Thu, 30 Sep 2021 22:03:16 -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.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:16 -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 05/22] nvme: call device_probe() after scanning Date: Fri, 1 Oct 2021 14:01:53 +0900 Message-Id: <20211001050228.55183-10-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 Every time a nvme bus/port is scanned and a new device is detected, we want to call device_probe() as it will give us a chance to run additional post-processings for some purposes. In particular, support for creating partitions on a device will be added. Signed-off-by: AKASHI Takahiro --- drivers/nvme/nvme.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.33.0 Reviewed-by: Simon Glass diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c index f6465ea7f482..975bbc6dc3b7 100644 --- a/drivers/nvme/nvme.c +++ b/drivers/nvme/nvme.c @@ -909,6 +909,12 @@ static int nvme_probe(struct udevice *udev) -1, 512, 0, &ns_udev); if (ret) goto free_id; + + ret = device_probe(ns_udev); + if (ret) { + device_unbind(ns_udev); + goto free_id; + } } free(id); From patchwork Fri Oct 1 05:01:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514988 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp451794jaf; Thu, 30 Sep 2021 22:05:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMvVDAsST8+RuLe2rp1cHTZofoILRJKY3qR+QxqTZdoYZwskVgDx3L+YwkfRzvT3TyfywU X-Received: by 2002:a17:906:354a:: with SMTP id s10mr2398648eja.475.1633064705506; Thu, 30 Sep 2021 22:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064705; cv=none; d=google.com; s=arc-20160816; b=S4fMGB4irwrBnhnnTC6O0haneKDb5zfxxQYAZ2zKy96n9Ii1F8ycSvY82pRb89rD6J r7xJtpY3uTtVk2qSjgMLy1SF7RElzq9SC93etn9fEp/TOFrxFnqAIjFqk+v8ctSfQphT RO57IxcdGIR1/CYgVC3criU9xnyh9Y2ObMyiMJ0JyvFxQein/EDEeialRDok3XVjajJh beoEybg2pmjK0HplzwSTQ08XNLoEhZ25dPbwp4RfDDg159T9q7nKtosOCmLFDg9Z8VO5 oqThAZBiggxlafsVREmh9s0fQIzqDL0NPTMrPJarc+8cyRBo87grBFiPZhUSXEhWR/nF vcvA== 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=DUqHk6GqAD3KhgmdEMlQyPoaCBbyBnak6/KyeiOBA7Q=; b=jgw+N/JiIpfLFVwg97+AiE6Z4WWgUn+fLU6tFttMxBLPh+577ivVjYC3EUWVWztz8u 6wAtAeE/xVjZOH+PpZ2iF1DOSJalQ2gvBUMJ1be2SE6XB7tzHWnl7abd+5O/WjatrUsF svlW7oLlSLfszH40Jw2x0MR46gFlOMGt3LbIMNi437QN3oPhUZUYq4pDf7JjlQg/gg/i HvURUkVKcpwm9y/UbyDXtnAk+Bxo+zQRTNhEyCxZlNsVmNQBREEYJ+ByTq+xK+pkRKwk +ldznQOZl+aZrTMDCbPJNA1pYYMtUVpG1UMrPsXGjZldI8VV5jwDzdVcYKDpXxdN0XKm w3BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PePSl2+d; 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 24si5690368ejg.618.2021.09.30.22.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:05:05 -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=PePSl2+d; 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 862A182EBD; Fri, 1 Oct 2021 07:03:47 +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="PePSl2+d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 573E582F08; Fri, 1 Oct 2021 07:03:30 +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-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) (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 700F682B9F for ; Fri, 1 Oct 2021 07:03:25 +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-pg1-x52b.google.com with SMTP id 133so8383306pgb.1 for ; Thu, 30 Sep 2021 22:03:25 -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=DUqHk6GqAD3KhgmdEMlQyPoaCBbyBnak6/KyeiOBA7Q=; b=PePSl2+dpjrvDUiPtY918ySDfFdiWKT6A/mlR2A7hfMyVvbNk2EAEv6kjTQDEBHhV6 nmwqt34KutDWRMfBWNkDx4Pd4D1O33mA+x4D7ePIJTAwXJP49ONLm3wZ+NAObXOtHLCU GAb2NGa+20OY3bgsyUP0mcTK2ULJ+SypLpoPvJBXmdO2JODUSxw5Xlf5yr2OPnQFJP6D sitfGOZac12QYhYUyo1qRtDV46XDommz5Q7q4GiRNhRpTJipbqSJSkfAPns8tv9/XdQm KMO+8sDb5CmnqauhGqy3OWXubEPx7z8bBDoMUhL32qAvz8utkkqNgPwjz0SJobx5tHg8 RWfQ== 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=DUqHk6GqAD3KhgmdEMlQyPoaCBbyBnak6/KyeiOBA7Q=; b=RocKRBFWmPXr9pVNga4qzrrEYQXrSxcZ5p8hxRFiLDqMwD+sKhu4z5i7uvSSgrL8Ba YhuPetwhkKp0Yo40fN+VBs9RQeG/aC9ZzV384I5+1NmhFUncfUGOgbXM2UGCxh4lbAKB ewC1uDsuKTZOiV7tMm81jRNg2jfmOywJH6yDoLQqUorclAsn1vftvBITDdG++Xp8RIKg G9Ddq5ZvmUsyVDrLB333XKnqzdrQ/75sCrItLXbhYiQ/bVaxYVp4wChnntR0fN03J5Wu wdyw9NscclgjFTLhgYN7R14wQhBAjkWAghjjMhKCfdlFWtLs4TGgP4XOHJ5/GEVonjuD A2vw== X-Gm-Message-State: AOAM532TRWBb8PwJOsdAlTN0SjuphBF5H/jP2EQ+sIuy79KQgwi7LrjP DxRYxv0cL+UR6ie/O9ASAlbk/Q== X-Received: by 2002:a63:4f:: with SMTP id 76mr8041498pga.457.1633064603624; Thu, 30 Sep 2021 22:03:23 -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.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:23 -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 06/22] block: ide: call device_probe() after scanning Date: Fri, 1 Oct 2021 14:01:55 +0900 Message-Id: <20211001050228.55183-12-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 Every time an ide bus/port is scanned and a new device is detected, we want to call device_probe() as it will give us a chance to run additional post-processings for some purposes. In particular, support for creating partitions on a device will be added. Signed-off-by: AKASHI Takahiro --- drivers/block/ide.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.33.0 diff --git a/drivers/block/ide.c b/drivers/block/ide.c index c99076c6f45d..31aaed09ab70 100644 --- a/drivers/block/ide.c +++ b/drivers/block/ide.c @@ -1151,6 +1151,12 @@ static int ide_probe(struct udevice *udev) blksz, size, &blk_dev); if (ret) return ret; + + ret = device_probe(blk_dev); + if (ret) { + device_unbind(blk_dev); + return ret; + } } } From patchwork Fri Oct 1 05:01:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514990 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp452052jaf; Thu, 30 Sep 2021 22:05:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+CNN2JpUDP5bakAd3RaVoslzjKaEjfZhNtL1cEjOw/rgYYyTi+kWDZQl1gkvvBlnK33Et X-Received: by 2002:a50:83c3:: with SMTP id 61mr12082891edi.81.1633064729094; Thu, 30 Sep 2021 22:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064729; cv=none; d=google.com; s=arc-20160816; b=v+NbW+cciYelaOVzO+2WHkPV+MSNVOU+OaOC0dAx6bEK1awb5jvDFBIwlnbwe3A+jW t8/YXT+N3Xg0SX1OiszIH9bkUKgaQHhNlhM3BTjFQbl3KrwYRazhV/jV1COffKtwpJ49 kwdHc2Bh/tBs7GwcR4nt0xqosnqYSaACba8IP30FSHOpMoz7n0x3iSexrCH0k15wEyFA +ALw4pNbn3aGXTNvNIwpNe6H2NSUVJawbPm6W7I/XMTtzoq6PiRTxgNhz7PpjShChYlf SCoj//+fpPEqcNrNoLUYBksJID27tVvEFdREpd2PDBvdT497yShIXQg1cYzwLG7z4UWj omwA== 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=DUqHk6GqAD3KhgmdEMlQyPoaCBbyBnak6/KyeiOBA7Q=; b=NUYU48g9HZUE8paUcmkA4hclx9dqg6PNB2qB5kM6Qs4CaGhM3u9HMZ70jk2eoVsh1F OcdGF75VoYBw8sLlutsl8qktCzJ2kK70E7ij7JcTzmrSirUR1lsDINhcGo8YW8bBB1iR OV6DQB6eFfaoWH8Xls+UJ233G12Z4riGz/RTfrqi8IxGR6iQd3DGAQv8zfuHr+D6s97D K7aTo/5kxwsQk8b9uV/NCOoGKoxJZrKA15K3ukseLh1fukyUdb8iF3KF/rwEzwiBNDgh KkHVMMtqhok2J0ocA58s6glfdETgkm0QOV34ymMkdLjBRVsOW0Wm54Xub4xab9GrExBD dnhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fqmxyb9C; 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 w3si5621644ejv.301.2021.09.30.22.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:05:29 -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=Fqmxyb9C; 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 9BFCC832A1; Fri, 1 Oct 2021 07:03:54 +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="Fqmxyb9C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 508118169E; Fri, 1 Oct 2021 07:03:37 +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-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (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 EB5AD82EBD for ; Fri, 1 Oct 2021 07:03:31 +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-pg1-x536.google.com with SMTP id h3so8349834pgb.7 for ; Thu, 30 Sep 2021 22:03:31 -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=DUqHk6GqAD3KhgmdEMlQyPoaCBbyBnak6/KyeiOBA7Q=; b=Fqmxyb9CVBMymCKF+iNqCM3XoVZfgHRTWK8bc2SKWr1Lg2P2KJ3Tv1xsHkPxEEPAKy i1dLXiHD37NZ9H7v5mUakDXn4KURlhMYyEpPD//DSq4zuMYj8913twmlC+O7wsxUJGfS 9M1mNCoOXIb1HrDu0sU9z24TYJTQYTHpuB1FmuioG0TidRA46hrwGSxlCFU3Kasd4vHf QwBXfXkPnHY6blbdx2Vlp6pGxsARD/1BDLHB9/q56KUTxCZTK+8lIAAQJ/etdcpraskD om2SjnLbrCkePdcIiUiV53+cAjht4M7en9XwNnuo7de6GVAVm2mx9SshSYlP3sboOsvP Hz7w== 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=DUqHk6GqAD3KhgmdEMlQyPoaCBbyBnak6/KyeiOBA7Q=; b=jfTzerXa4fZIKfsCWeSyqhQHfbXs8RQUeCCmVPEQNKsFwzWiFWf37yygLu2dSOQAbb hyLSl9gMo5P2VKSHfp+EE1LtgSO1JWZVm6zusvnSvJH0jSnrttfqDi5oPdj6N3X7Wdid 0zcL60lIAFp6qbas0T52wzqlNHuqWOi5p9tRzGkHft4c1tNLfmWJRyOgNDHov5AEIUq4 S+2feccInF+CBKBJ2/9DT5wsIcKWZ9GCj7+iLo8RK/Eb93DfLRuMqypO/PtNHX2wkEev 5nG6BfyGoshbO0Kyk05TRwPJP38o6oqnDffAO1Ja0MJtbltsbhlDbVedeqPT5ZsWX/op WzqA== X-Gm-Message-State: AOAM530JKdNXdjWKqTPmrsFbARk1F52oylU5+10E8Rboha5LeC57vJwp /Ah5faUyouJZNWQ+DGxfjVihJZatTIeFlg== X-Received: by 2002:a63:d2:: with SMTP id 201mr8113210pga.400.1633064610218; Thu, 30 Sep 2021 22:03:30 -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.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:29 -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 07/22] block: ide: call device_probe() after scanning Date: Fri, 1 Oct 2021 14:01:57 +0900 Message-Id: <20211001050228.55183-14-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 Every time an ide bus/port is scanned and a new device is detected, we want to call device_probe() as it will give us a chance to run additional post-processings for some purposes. In particular, support for creating partitions on a device will be added. Signed-off-by: AKASHI Takahiro --- drivers/block/ide.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.33.0 Reviewed-by: Simon Glass diff --git a/drivers/block/ide.c b/drivers/block/ide.c index c99076c6f45d..31aaed09ab70 100644 --- a/drivers/block/ide.c +++ b/drivers/block/ide.c @@ -1151,6 +1151,12 @@ static int ide_probe(struct udevice *udev) blksz, size, &blk_dev); if (ret) return ret; + + ret = device_probe(blk_dev); + if (ret) { + device_unbind(blk_dev); + return ret; + } } } From patchwork Fri Oct 1 05:01:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514992 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp452274jaf; Thu, 30 Sep 2021 22:05:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+pc8M6u17uGpQhwZUs7/Nds62m6r78zWQKsH64kw/ryxBseX4O9HMNxaa0tl6QG0xk5GS X-Received: by 2002:a05:6402:5186:: with SMTP id q6mr12416231edd.64.1633064752771; Thu, 30 Sep 2021 22:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064752; cv=none; d=google.com; s=arc-20160816; b=KdVbAiKVeBcv3KF3ZHfiaec80cICOGgUCf4YQEbybWMb4CgbXtsLWtEeR23Dt+sBJU jAeFqT1mrb4Bi2Xf5I2T+u4aqOR77brYLmDFbmKHMyI3CqifFd0lXGFqizhzaDOcfesb 8LA7DQPvi26s1bgGK/AGIuoh9NwE2JJIJyeGd+h/F7A+sKYPpz49uEij/dHBpybdPD5y gCUl16c1+Co0litBzp9/WkpCW58giPWOaC1jCqCX5y5nBpXIl//oVSd33pB/BfXPX+h0 xt0yThlnz/Gc0LK1h6WWjCBNA+yw3x288DIiij5G2lsBgfVFfmlJ1jBxsFZBbTUFIFW1 xKtQ== 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=xNd/2bFfKjwaY5xV+8Y8nucr8xmVq9A0zVABHGaXLyA=; b=M1QmaGPB1jY3ktE9zUcnB3ZhDSExNMLt8nEg2Elk+W5nKJ6F2YKONWUngwt3TBNmsk 32ShO5/P8AjCbIv0z7v5K80MIy8YhrG9NqdnPcDhcH4Hu1HO5hQ/LHrZkLKE87Ed1g4M trFLuR0+qPuvyqMFEjqDmZJusm2gtPGy7HJQh9LG0dQ2fpUonzUBuJWj3RjRxJYV446x LubgjBPzy+KxXdb9wLlv4trVeY9T+u8zxCWJ4cZOQANp79fSxRQRggH8NYfk+bSg3UYT o//YlW6eiiRozqWUP7VuRboHlKVgidFuAP9bD7aaruaMGSIgbJ5c1ZdLASqEYL0aWFr2 PZyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hKpb2ZfT; 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 18si5454903ejj.476.2021.09.30.22.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:05:52 -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=hKpb2ZfT; 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 1124F831B0; Fri, 1 Oct 2021 07:04:03 +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="hKpb2ZfT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C79E482EBD; Fri, 1 Oct 2021 07:03:45 +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-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (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 63B9D8314C for ; Fri, 1 Oct 2021 07:03:39 +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-pg1-x52e.google.com with SMTP id k24so8357030pgh.8 for ; Thu, 30 Sep 2021 22:03:39 -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=xNd/2bFfKjwaY5xV+8Y8nucr8xmVq9A0zVABHGaXLyA=; b=hKpb2ZfTGylTNCfzW29vonqKEdvHjQ1nhfyGvWI0SFt1LJwu97Y6W4kQbjLmOjGxxD DMdydq87nBZ7MX+zJm0twMRaqdJ9I4ZzVQZYhICc7bi0FN/Bxv9fvVUKaM0UaIHi32J5 vg8GpFn7uuwtZ9nHN3TdnuDihD8Z89drFRHfXeFe1qrQtQtMjnj6PNCsKkXtZFnXWeov q4b7sLjzsUd8wixwRUP/aOzUm2wHmEkzEJlE6Q849vCRSEv6n+Y/ILXcNEYLn3PZRh72 mPZ8l4jbzUIHMMBxrgePhmJBXcYUDeslfR9MDWGSx4PfesibKNHjGKuLllzTJiWccXKt AXrg== 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=xNd/2bFfKjwaY5xV+8Y8nucr8xmVq9A0zVABHGaXLyA=; b=VdFXjGHhBe3zy8ftXSfwzEwVPfyx8sduPKfDAGG6MfHsvPvhkICcO3iPvog9WhuQbm db1RqG1PAmjnBzA5AslqzZLxopXBr3dCcpbjpPB6YYj9OKqtmQOBLEgI/A2xiWxaTRdN bJThfGKglXO8w6LRgHqg0MOzeGa8yi5qfy5HdYaWahc0qAA0sMWaByRya5T87MlQK9tq wYGY6vWboQHOWccyLjqW2o2wGLQWgfgiE1e/gybXt5YjUn+I1/7p5VbI8d3hRmA432dX 6lbGLU7CKv8SDvbJeYPUChho2yb1qEiXZzi27FfjDRyIrnTaIyPdPl2kb2v2Di8q5EYs xOrg== X-Gm-Message-State: AOAM530zRbzXwYeBdo/x46hJ6Ken89PxwqsGvDOywX8qjWPrNs3RBM5Q Y7EeYTjAMxR6CDfjiLABtUQACQ== X-Received: by 2002:a65:564e:: with SMTP id m14mr8237408pgs.113.1633064617616; Thu, 30 Sep 2021 22:03:37 -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.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:37 -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 08/22] dm: blk: add UCLASS_PARTITION Date: Fri, 1 Oct 2021 14:01:59 +0900 Message-Id: <20211001050228.55183-16-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 UCLASS_PARTITION device will be created as a child node of UCLASS_BLK device. Signed-off-by: AKASHI Takahiro --- drivers/block/blk-uclass.c | 111 +++++++++++++++++++++++++++++++++++++ include/blk.h | 9 +++ include/dm/uclass-id.h | 1 + 3 files changed, 121 insertions(+) -- 2.33.0 diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index 83682dcc181a..dd7f3c0fe31e 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -695,6 +696,44 @@ int blk_unbind_all(int if_type) return 0; } +int blk_create_partitions(struct udevice *parent) +{ + int part, count; + struct blk_desc *desc = dev_get_uclass_plat(parent); + struct disk_partition info; + struct disk_part *part_data; + char devname[32]; + struct udevice *dev; + int ret; + + if (!CONFIG_IS_ENABLED(PARTITIONS) || + !CONFIG_IS_ENABLED(HAVE_BLOCK_DEVICE)) + return 0; + + /* Add devices for each partition */ + for (count = 0, part = 1; part <= MAX_SEARCH_PARTITIONS; part++) { + if (part_get_info(desc, part, &info)) + continue; + snprintf(devname, sizeof(devname), "%s:%d", parent->name, + part); + + ret = device_bind_driver(parent, "blk_partition", + strdup(devname), &dev); + if (ret) + return ret; + + part_data = dev_get_uclass_plat(dev); + part_data->partnum = part; + part_data->gpt_part_info = info; + count++; + + device_probe(dev); + } + debug("%s: %d partitions found in %s\n", __func__, count, parent->name); + + return 0; +} + static int blk_post_probe(struct udevice *dev) { if (IS_ENABLED(CONFIG_PARTITIONS) && @@ -713,3 +752,75 @@ UCLASS_DRIVER(blk) = { .post_probe = blk_post_probe, .per_device_plat_auto = sizeof(struct blk_desc), }; + +static ulong blk_part_read(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt, void *buffer) +{ + struct udevice *parent; + struct disk_part *part; + const struct blk_ops *ops; + + parent = dev_get_parent(dev); + ops = blk_get_ops(parent); + if (!ops->read) + return -ENOSYS; + + part = dev_get_uclass_plat(dev); + start += part->gpt_part_info.start; + + return ops->read(parent, start, blkcnt, buffer); +} + +static ulong blk_part_write(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt, const void *buffer) +{ + struct udevice *parent; + struct disk_part *part; + const struct blk_ops *ops; + + parent = dev_get_parent(dev); + ops = blk_get_ops(parent); + if (!ops->write) + return -ENOSYS; + + part = dev_get_uclass_plat(dev); + start += part->gpt_part_info.start; + + return ops->write(parent, start, blkcnt, buffer); +} + +static ulong blk_part_erase(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt) +{ + struct udevice *parent; + struct disk_part *part; + const struct blk_ops *ops; + + parent = dev_get_parent(dev); + ops = blk_get_ops(parent); + if (!ops->erase) + return -ENOSYS; + + part = dev_get_uclass_plat(dev); + start += part->gpt_part_info.start; + + return ops->erase(parent, start, blkcnt); +} + +static const struct blk_ops blk_part_ops = { + .read = blk_part_read, + .write = blk_part_write, + .erase = blk_part_erase, +}; + +U_BOOT_DRIVER(blk_partition) = { + .name = "blk_partition", + .id = UCLASS_PARTITION, + .ops = &blk_part_ops, +}; + +UCLASS_DRIVER(partition) = { + .id = UCLASS_PARTITION, + .per_device_plat_auto = sizeof(struct disk_part), + .name = "partition", +}; diff --git a/include/blk.h b/include/blk.h index 19bab081c2cd..3d883eb1db64 100644 --- a/include/blk.h +++ b/include/blk.h @@ -366,6 +366,15 @@ int blk_create_devicef(struct udevice *parent, const char *drv_name, const char *name, int if_type, int devnum, int blksz, lbaint_t lba, struct udevice **devp); +/** + * blk_create_partitions - Create block devices for disk partitions + * + * Create UCLASS_PARTITION udevices for each of disk partitions in @parent + * + * @parent: Whole disk device + */ +int blk_create_partitions(struct udevice *parent); + /** * blk_unbind_all() - Unbind all device of the given interface type * diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index e7edd409f307..30892d01ce13 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -80,6 +80,7 @@ enum uclass_id { UCLASS_P2SB, /* (x86) Primary-to-Sideband Bus */ UCLASS_PANEL, /* Display panel, such as an LCD */ UCLASS_PANEL_BACKLIGHT, /* Backlight controller for panel */ + UCLASS_PARTITION, /* Logical disk partition device */ UCLASS_PCH, /* x86 platform controller hub */ UCLASS_PCI, /* PCI bus */ UCLASS_PCI_EP, /* PCI endpoint device */ From patchwork Fri Oct 1 05:02:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514994 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp452507jaf; Thu, 30 Sep 2021 22:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6TWLuGSuRhu/SKtD/On7Rf8SiLwlGJL3c3SBST4W04uGsO5WF2BkEDnv0cYKUaD0A3xFO X-Received: by 2002:a17:906:c18d:: with SMTP id g13mr3859095ejz.518.1633064775371; Thu, 30 Sep 2021 22:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064775; cv=none; d=google.com; s=arc-20160816; b=cRnhupBi/rvGsY/zYs2D0VJMwEHCNmU/e5kzSWqnTBTmMFVYzjbenAYTA1HSCdcBjb 8mpkV95BX9aaFWElqsk29bP+2QzrOrH/HRV7d7iHK5QIVl8hgUVYyWAFmM66Az5z8rdm 0jr0qHkAb0dOGdbffn2i1nCkdLCWCjgjm+18I6gMkVf+qFYLR3auw1wK1MUnxtTNbpdR 56O0ZVSzUJjhUlFAGw0qBJE0FpZyewKccRkf+85J1mqlZunt2aEFPW3jqoWlO4QO62gd XTz+Vzpwnz/7i4P6VSZzQAW0wPBxlkNFah7PkasyY5b0RCbCpwB5B+iCidgh4UQwddSo zXJg== 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=bmMB/nA9xkBo6ahFeLmZvwsTNZp33CmIqHJrk8Hn7OE=; b=RK4hD0Y0pUAteVF+Voo8UiPtasSRUK+EST9qehfe0wVedjHlV9lbK54zY2+yBirFoe dCpGClqd/06jaFGNmUYV2/Dggs+09UeM0Xe20lD0gywtvF1zFeyyzrp7FLDGsuX3r/08 5KzozN9IMmcLf4Nds1OKTtkKL41KwV0LNHF46GtiXudOaGgffiDOx4+8Kk8kU/leXtUa pVjkRtVMzvod6L0VBYglELdtp9ZoTWmwW79n6Du6kvV0r407MaRUAMyjWuZiTJh0O1Cv sxni9ZuauE7bKHToETbXaqBlwP0guPdMEEXRoGng/2l46Xs0QF660F15KvsPPGMrjDm3 gdRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X8ZRRiOF; 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 m11si2622407edr.329.2021.09.30.22.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:06:15 -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=X8ZRRiOF; 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 23FBC83326; Fri, 1 Oct 2021 07:04:11 +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="X8ZRRiOF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1987A83176; Fri, 1 Oct 2021 07:03:51 +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-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 EE57A83138 for ; Fri, 1 Oct 2021 07:03:45 +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-pg1-x52f.google.com with SMTP id e7so8379529pgk.2 for ; Thu, 30 Sep 2021 22:03:45 -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=bmMB/nA9xkBo6ahFeLmZvwsTNZp33CmIqHJrk8Hn7OE=; b=X8ZRRiOFWLKdauaaNTk2ybj/4Sb+69sI/xaoHXN46oG9osCII48O8zcVl7KBYj7E0G qS7Rd52zPvdA8kKG8+cdeKZnBjXY2S/Uff1vC4U00w0aZgV+/DJiytI6Wd9uaPz1ARaj dOIZimSW18We8hhabRe3AB+r7ga2yqcTQ9j4MCA+B2/S5N3C8civspz26XyqnzZi6T3O MFcAbcVHlFuN4T59SuG8gMtdmMbtYz0/Dxu+SBEhtrAjs7oMT7bYED3ml003p+TJHRkD DWhKohnblVFS9TfNrWKoDpABcpTU7ZuaFNBMSoOYLmWqkrZzWnNGHGZDmcpcgHKOjpCj inuw== 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=bmMB/nA9xkBo6ahFeLmZvwsTNZp33CmIqHJrk8Hn7OE=; b=MWkAx4SvMnLuBFvh/jO2z4RnJhP66HXsiUmDm1M2Vfrqwyin2g9R4vXGjZ80G2x/2P mHR72is7BWZPeqjkjtqLrxP+AG/sZ5cFXNDSKhGSuJGkRGv9dKGWWaFfAaqhRcvMuNt5 GDbnzFzDKc8ivFD4k5ZOweluPMTfTGrUPpGcqacIbVSorwdgxOCsUCMelfGlQLNHtzar IN82M4OEaJdUajiz1wq2Zz+4fyflEIKHQNzLjojixBlS1KCAUvlPNevJcZZEKHlhHANa Pbmsn/uaxRScphH+VW7xGGdu26nSYVJv9H+mvb1/NG1DIf5qIXMwpNQfYVcpoRoVFO8b Fx9w== X-Gm-Message-State: AOAM530PvfZNwkdtRvOlNnLG60i94TGk+8FmKbGXbU+DyL25FWtmKp62 mGZoxhbse0YhrDrN9+jiVyzZVw== X-Received: by 2002:a65:62d5:: with SMTP id m21mr8307754pgv.124.1633064624100; Thu, 30 Sep 2021 22:03:44 -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.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:43 -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 09/22] dm: blk: add a device-probe hook for scanning disk partitions Date: Fri, 1 Oct 2021 14:02:01 +0900 Message-Id: <20211001050228.55183-18-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 Now that all the block device drivers have enable a probe hook, we will call blk_create_partitions() to enumerate all the partitions and create associated udevices when a block device is detected. Signed-off-by: AKASHI Takahiro --- drivers/block/blk-uclass.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.33.0 diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index dd7f3c0fe31e..6ba11a8fa7f7 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -741,11 +741,25 @@ static int blk_post_probe(struct udevice *dev) struct blk_desc *desc = dev_get_uclass_plat(dev); part_init(desc); + + if (desc->part_type != PART_TYPE_UNKNOWN && + blk_create_partitions(dev)) + debug("*** creating partitions failed\n"); } return 0; } +static int blk_part_post_probe(struct udevice *dev) +{ + /* + * TODO: + * If we call blk_creat_partitions() here, it would allow for + * "partitions in a partition". + */ + return 0; +} + UCLASS_DRIVER(blk) = { .id = UCLASS_BLK, .name = "blk", @@ -821,6 +835,7 @@ U_BOOT_DRIVER(blk_partition) = { UCLASS_DRIVER(partition) = { .id = UCLASS_PARTITION, + .post_probe = blk_part_post_probe, .per_device_plat_auto = sizeof(struct disk_part), .name = "partition", }; From patchwork Fri Oct 1 05:02:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514996 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp452705jaf; Thu, 30 Sep 2021 22:06:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTzoqMYjt8joxy9zdQoQBJl+NV0/13YOHfe5uGAoaf1jwnXif6PY2RLBNrpyIasFbYEVUv X-Received: by 2002:a17:906:374b:: with SMTP id e11mr544236ejc.492.1633064796406; Thu, 30 Sep 2021 22:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064796; cv=none; d=google.com; s=arc-20160816; b=upCKBr4IJUnSqgCl0IslJybO+GoV4Zm3Sj/0SxWtTh6tGWcudgvbyEIyXtSuNYDJ/1 N5p6aelYmYfmE0bhDOysTcj5DEJgNy2BQ0PqvYyBWMGsHGIhoxTXN9VmdNbtHYnJLXkD XR0l3SN6hHfBKQhg7R0z4L19GgnNQm/BzRUJbpj7YSLd64g5DpGIp+9+NP0AW+9Re+OY 1snnb/cpGknidj+4wk+rit9yWGBx+eLj5UwiBAsLRcRtQD++1VEScQSfdO1fKGrnMsfV WxmBN+hcbKeZsOxUBBh+HFDDL85FjBN/SZ74wHhHMHb6INAZAfoVmLEZi71M1TMdiM/N 0jjg== 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=UhrBaUxpdF9KOEH0VMrJEPB6fFwCE5yYYSjjBkt4tmM=; b=xksqh8QTsrIvS3PNb1xv01TEbRYulHoECyvz6tj8vYm/aKTR99fg/+NUZVKiQsjqMR nkkgszBSd4I5uFbINvyLuvcRS7vvbNEKZLwLFnC8oCKccsuT8aYR2Uv4FSQ6rgWClhmO 6zFpyLCilXn0BKirWP9Gl45KVhPsqnj4L2fEY69/6+kKbwY+HmOfzntJl3AezcF39lA4 GbAcJu6QCujOK9LDwDIerEjtYRMMJ9ETj7uYOiwIuKH0ZHkFRJLZZZQDvYDWdgcRRt34 wPH/ltkediCX3rJnXRfX6LX3MRtJm9KglpHQhNlQE6QxJ/WuKrexY6mpJDER1/tISOle hk/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PVZPi25+; 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 c11si6758980edy.498.2021.09.30.22.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:06:36 -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=PVZPi25+; 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 4213383424; Fri, 1 Oct 2021 07:04:16 +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="PVZPi25+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DD304832AF; Fri, 1 Oct 2021 07:04:00 +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-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (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 401508328D for ; Fri, 1 Oct 2021 07:03:54 +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-pg1-x531.google.com with SMTP id 66so7945933pgc.9 for ; Thu, 30 Sep 2021 22:03:54 -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=UhrBaUxpdF9KOEH0VMrJEPB6fFwCE5yYYSjjBkt4tmM=; b=PVZPi25+76+yZ3FqyQ09LXR2Bif4y5oDdh8aR9BRUP+IHJSl0daYsyEDAsepdAXSSX Fcj2W37qe61bEuXc4REZpD2IH80U9vHw2LrKW7briB3Wi7OQQCGp9SW1uh2k8YdXNAXs KA1s8A+BR/Bv9JSRjX+rHX4hfOyiAuOao8W/zIXmU/qH3p0tYbBY3QeEFOxzxbYF6xhd DY5yUd0aIdlHEXHB/EMunv8iWB+gI2wIn5CFfgZFSwmTJnYvWZJ9VHbSy1VmJKWnXGkE dQ0mI1qT1g+arCWVAtSccRwH7rK7M4HbC9xJsyTLpjjhCyviv4k0zXUYBce9CdK6kfzB B3WQ== 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=UhrBaUxpdF9KOEH0VMrJEPB6fFwCE5yYYSjjBkt4tmM=; b=zi1W3quc4j5CVosxEJxOkXbxIkLDEgleY0lwwNkjVrPEDLGHK7FNp9TPvut3n5Jm0M SkGl7vk4M5kgAhLid761Vp1Q6yRVDiUHzX3ImF0+W+7Q38DlGaE8D8pJTshKN9Fs/IBi DJiR8I5Gpfg+dL9PfkD/0gpBYA0lHOcZZ0MduoS/YPXBMN/Ndd9zZBAmuxWQ+SoUCnDQ Os5oGVmRA1MRliRInHgqx2onJro05JjExytaR9+ClSAwTCYdNvG5SA0HZqJLRrdpPDkK nvcGs+1j0PXBJDTk08+IUARKc74LpdIo8oOSAG3M0Yl5DveZVP9BKHANpqt4ElFCSg4q ffmw== X-Gm-Message-State: AOAM532RkenrAIciCeRvXVBFK4GSaqjDXM0rDc6VxfIi3Dgzclz1ZXA2 lKD6BWYSewWZswnWI1sGvw6VQw== X-Received: by 2002:a63:ea48:: with SMTP id l8mr2218498pgk.99.1633064632427; Thu, 30 Sep 2021 22:03:52 -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.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:51 -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 10/22] dm: blk: add read/write interfaces with udevice Date: Fri, 1 Oct 2021 14:02:03 +0900 Message-Id: <20211001050228.55183-20-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 In include/blk.h, Simon suggested: -- 2.33.0 ===> /* * These functions should take struct udevice instead of struct blk_desc, * but this is convenient for migration to driver model. Add a 'd' prefix * to the function operations, so that blk_read(), etc. can be reserved for * functions with the correct arguments. */ unsigned long blk_dread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, void *buffer); unsigned long blk_dwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, const void *buffer); unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt); <=== So new interfaces are provided with this patch. They are expected to be used everywhere in U-Boot at the end. The exceptions are block device drivers, partition drivers and efi_disk which should know details of blk_desc structure. Signed-off-by: AKASHI Takahiro --- drivers/block/blk-uclass.c | 91 ++++++++++++++++++++++++++++++++++++++ include/blk.h | 6 +++ 2 files changed, 97 insertions(+) diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index 6ba11a8fa7f7..8fbec8779e1e 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -482,6 +482,97 @@ unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start, return ops->erase(dev, start, blkcnt); } +static struct blk_desc *dev_get_blk(struct udevice *dev) +{ + struct blk_desc *block_dev; + + switch (device_get_uclass_id(dev)) { + case UCLASS_BLK: + block_dev = dev_get_uclass_plat(dev); + break; + case UCLASS_PARTITION: + block_dev = dev_get_uclass_plat(dev_get_parent(dev)); + break; + default: + block_dev = NULL; + break; + } + + return block_dev; +} + +unsigned long blk_read(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt, void *buffer) +{ + struct blk_desc *block_dev; + const struct blk_ops *ops; + struct disk_part *part; + lbaint_t start_in_disk; + ulong blks_read; + + block_dev = dev_get_blk(dev); + if (!block_dev) + return -ENOSYS; + + ops = blk_get_ops(dev); + if (!ops->read) + return -ENOSYS; + + start_in_disk = start; + if (device_get_uclass_id(dev) == UCLASS_PARTITION) { + part = dev_get_uclass_plat(dev); + start_in_disk += part->gpt_part_info.start; + } + + if (blkcache_read(block_dev->if_type, block_dev->devnum, + start_in_disk, blkcnt, block_dev->blksz, buffer)) + return blkcnt; + blks_read = ops->read(dev, start, blkcnt, buffer); + if (blks_read == blkcnt) + blkcache_fill(block_dev->if_type, block_dev->devnum, + start_in_disk, blkcnt, block_dev->blksz, buffer); + + return blks_read; +} + +unsigned long blk_write(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt, const void *buffer) +{ + struct blk_desc *block_dev; + const struct blk_ops *ops; + + block_dev = dev_get_blk(dev); + if (!block_dev) + return -ENOSYS; + + ops = blk_get_ops(dev); + if (!ops->write) + return -ENOSYS; + + blkcache_invalidate(block_dev->if_type, block_dev->devnum); + + return ops->write(dev, start, blkcnt, buffer); +} + +unsigned long blk_erase(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt) +{ + struct blk_desc *block_dev; + const struct blk_ops *ops; + + block_dev = dev_get_blk(dev); + if (!block_dev) + return -ENOSYS; + + ops = blk_get_ops(dev); + if (!ops->erase) + return -ENOSYS; + + blkcache_invalidate(block_dev->if_type, block_dev->devnum); + + return ops->erase(dev, start, blkcnt); +} + int blk_get_from_parent(struct udevice *parent, struct udevice **devp) { struct udevice *dev; diff --git a/include/blk.h b/include/blk.h index 3d883eb1db64..f5fdd6633a09 100644 --- a/include/blk.h +++ b/include/blk.h @@ -284,6 +284,12 @@ unsigned long blk_dwrite(struct blk_desc *block_dev, lbaint_t start, unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt); +unsigned long blk_read(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt, void *buffer); +unsigned long blk_write(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt, const void *buffer); +unsigned long blk_erase(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt); /** * blk_find_device() - Find a block device * From patchwork Fri Oct 1 05:02:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514998 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp453001jaf; Thu, 30 Sep 2021 22:07:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/kolPvaCO/A0c5xdNzWWcJW0SoIFi2g/rW7fdq2Vi6uJGjI0WVaBI+ThwmHavA5S1xTTs X-Received: by 2002:a17:906:49d5:: with SMTP id w21mr3970463ejv.30.1633064827634; Thu, 30 Sep 2021 22:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064827; cv=none; d=google.com; s=arc-20160816; b=CE+uy3fCjkAqFLpObCsqJ8Ydj6MMNE6yWrEruP0kTKqoS1uV9jTO5wwgMkLD2bcZgT IPmhUNgtv25NCQbw1OObVwo2LYg3KeLlJirwCsLySZYm1FdFmqBAXfwrmB/LBP7GErOB vnftMDiEAuQUIMpfMy/NyL8PP1kl77sCU4BPmYlMCNUiKTTa1FCAEAha3Zhyq5eNYsh9 EWvEt/slLWpRvRf9kjBxuODHU7z7HziXafjCi2ZFfUxTz2eMElqLTvaW59j97Q7lNx6u fuMwfDyPbVy0YR3CVfMonCLXi4MvQKey87ie+y5I3+S6cG+//2AERj29BokGejT4qwgV Id5w== 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=4mn44Pr4crHZayV4dJN9FRKvZepqTA8aJ3PwtV1W9t8=; b=wdf/kZnjdquHtgt6RED5qsbb6NvNQn7dyfdZZhn0pw0gmzVrmK+kk7QX87k53P7KFf SkSnVX/Q+CseX3ZsP0G9cGbI578vD56rs09vQhDZtfQEAh6cQo67xsH093BDlTYIXjcB oJvvw1sp+cb8uI4D6UdemlAqH51iTf1E2FPk2zUH/AE+cMBidRaKubRy4AbkbxYWL8M7 p01Rqk9crv/Me6LENxy8/U1oN1DHKy4mb5jxzdMT3GnNPs5uwEK3Dhj/rS6oTs9RNtnp bLC/JD9qeI+40n6fy4xKu0/n3s73UidA2l/MPk6LL68+dZ7is6GtaRsFe2SsmIEupxql p4RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bkrTk401; 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 y6si7640193edc.477.2021.09.30.22.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:07:07 -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=bkrTk401; 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 E944283404; Fri, 1 Oct 2021 07:04:25 +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="bkrTk401"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DB9A483323; Fri, 1 Oct 2021 07:04:08 +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-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (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 8667B8323E for ; Fri, 1 Oct 2021 07:04:00 +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-pl1-x62f.google.com with SMTP id bb10so5554479plb.2 for ; Thu, 30 Sep 2021 22:04:00 -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=4mn44Pr4crHZayV4dJN9FRKvZepqTA8aJ3PwtV1W9t8=; b=bkrTk401vE5oKuKWxesl9l24UoBIHX3y+xNcZf3XPssIqlf2GyWKHWRUgYoBF8Ms+K 5NK/Ae/649UVnbKZwoifcjJiBxa5ShpsGrQY85VvKeBfe5wruiMOhpn6hnViga/3l5kf 6fjbeAwYGpe/oaD94VKNi/c53Zp23oX5Q64iKrPgIuM73YDI+yurt9Lwgc6rV3lgIo4W pBkoOEdK9R05LcCStMtNDEgWvxiQOSuHKoo1l/ea1hy5mO/yADHrImjbJ/yMVQd335Tw UF4NYycsjWXAyr8G0DEUx25QYtz/WqPsosNfmQwp77e95LXPoLORQN3pUngKHT6sKJOi /bOw== 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=4mn44Pr4crHZayV4dJN9FRKvZepqTA8aJ3PwtV1W9t8=; b=SZc0CHOWXcQ7XbXGAOTMgomuyjxuDzeGTNgIFZDk2ZSbJWnhWlVzUElBwM3hUyhoqd ET5SJLp1mJoh0bTaqrTvrszNkDE8WX8787wt09tbvCsEr/YuSfedwVrGjqUif1PCSiHa mCVCoEw0zMvT/zKaDnTxIudfqKBOXhSMPX8iSQ3OlIRrcnqBqTeh7+cJBZu7SFZyhMeC gQ7UT731iHHJihYUEChuPjtU+aAiJPKByHhvvZXtQeUc6+z+g23CJme/FmW8cowe1tL/ SYBc9ptICC5o2s7HBVRpqmW7d/9cDrCHNdjAJ6Fgnd74+yfgh3YjnnFnwIG71qoYX5uf V5tw== X-Gm-Message-State: AOAM531uuSt4nusDUu9ZG4pJVHuzNu1uxTJWryEUqPMn/HWMiAVJPtNt ldSr3AgegM+iuCnW5M5dQuL+6w== X-Received: by 2002:a17:902:d88d:b0:13e:807b:d52b with SMTP id b13-20020a170902d88d00b0013e807bd52bmr3041746plz.69.1633064638690; Thu, 30 Sep 2021 22:03:58 -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.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:58 -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 11/22] dm: add a hidden link to efi object Date: Fri, 1 Oct 2021 14:02:05 +0900 Message-Id: <20211001050228.55183-22-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 This member field in udevice will be used to dereference from udevice to efi_object (or efi_handle). Signed-off-by: AKASHI Takahiro --- include/dm/device.h | 4 ++++ 1 file changed, 4 insertions(+) -- 2.33.0 diff --git a/include/dm/device.h b/include/dm/device.h index 0a9718a5b81a..33b09a836f06 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -190,6 +190,10 @@ struct udevice { #if CONFIG_IS_ENABLED(DM_DMA) ulong dma_offset; #endif +#if CONFIG_IS_ENABLED(EFI_LOADER) + /* link to efi_object */ + void *efi_obj; +#endif }; /** From patchwork Fri Oct 1 05:02:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515000 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp453162jaf; Thu, 30 Sep 2021 22:07:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxV5/vpc5iip/6ZWuCk+lxNeuvG1xTz9r1AfgRfmf10nGz5IeaN2r+eC4nnBPT0v2GoLsVO X-Received: by 2002:a05:6402:5c2:: with SMTP id n2mr12166783edx.239.1633064848018; Thu, 30 Sep 2021 22:07:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064848; cv=none; d=google.com; s=arc-20160816; b=PFe+rNADNjPm6hWDsTg0Isl8Vp3lKYUutY5YxiQeqU0QN+CMCj/K1WiPp3Gv2Ci085 w6bY3bsXrdMugooMDdVeL97K4B+Cl4QtC+xQ0THY2JOvIEDXxD8dGNIP+5y96qayc1cM B+kkiHU20G2rgVG46pamTU0Cw6jNEuh+EOuUPGhNySC4b8qLm4ABNQ2D6QRyvybaxENg QJ5GRGro83VBrCi0XVhSbWooeTzatpnQ+xtWQSKpZqB76ewge/ZZyuRAhGkgzpvbhCh8 aV/WnGRqFJQ8lsOsSJK0wC1tXBP4p1TmXvNop/gwjzlyo9lQ/TsZgbChQ6bFoI84wf2x ttaw== 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=4mn44Pr4crHZayV4dJN9FRKvZepqTA8aJ3PwtV1W9t8=; b=ECSKURU77Y3aLcvSR8af2yl6yF3uqujqohTMSskeFjcQACLL2hSP7LCacLm5jtENaH u8UWSB6FF0Y5pRSA9iKTiTiH/NM8+J8aa7e6lITxWwSq9uJLGAnor1X/5KS7jCYxU7tL CibKNP3V0YaQT8btnGE+T4/WBbMWhgm1Qlp3y8N4ulVxz2HQE8DEjt9jNw4FiFJO4pn4 Z7/+DD6hUnfd1T8spj98tKAaIKtNJ3A5xdLNujayrAIgJTKPCOWrVtNiXq/Z3PbDAD6Z +O8CK6p8di0ASPfPVKiiD2HY5Nj/5ZEjSBPwiglXclVCyaHNj7rrK04HVpGwB2R7yUyT Vpfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rNGFRybx; 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 v2si5444362ejv.739.2021.09.30.22.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:07:28 -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=rNGFRybx; 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 5AA03832E9; Fri, 1 Oct 2021 07:04:36 +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="rNGFRybx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1192F83405; Fri, 1 Oct 2021 07:04:21 +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-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (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 2406283325 for ; Fri, 1 Oct 2021 07:04:08 +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-x1031.google.com with SMTP id k23-20020a17090a591700b001976d2db364so6402479pji.2 for ; Thu, 30 Sep 2021 22:04:08 -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=4mn44Pr4crHZayV4dJN9FRKvZepqTA8aJ3PwtV1W9t8=; b=rNGFRybxbJhedVavrpDjECKD4Qlf2Vu8CIHhlDmIpfuJ/txjcshAbRltficzTLTyQA aktwtYSEG5qUq1rfiwF5sRchKi68EcmX0slsZ8x48REYhcSzS+4229T/zaW8zg8jdvBU t6pxGN0UD2BLILQPNVYk9UKNcMwhLWp6bxh3iMmCacCyX3P5NNKH2ZWIS/wGFpJzh8/7 BQeIGBQgtfNbh50phQOfh8BIPaNQD5VTsb0lbd2utTHcpEpH3J6JFKtYsVoqNu9GR0yo AKQ+Ebba7eUjs06EaWxMJ6gn3ZCX5froaeq1XBd8HiIG4kWpPcmDPL0MgSpq5zTUKnT7 AWdQ== 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=4mn44Pr4crHZayV4dJN9FRKvZepqTA8aJ3PwtV1W9t8=; b=Rk8nOXG7bGC4RIPAycU+QdGGxbA9UnD3XIg8wLf52I6JRqqpkSZH2v78CWgdoAX/XV 93T88470MjZe2o7y8yUCrwzfks5lAmxxys4JXOgRav6BA4oqrA8jMov6GwrzXbm2kkjO RMtNEFpMgbq0qvjluOU8+DZddothLk4GHVXU1j10IDeL07p12uDbr3RfANrMXdSb4ups R3st+fbAA9l/Tkf2mloABzKba3ScNqxZdvncC+2kANITbDKUAVhCEedOqVx6bTdzu9iz A+wLn/SuymHMoxyjb2hstuwUAlMkXVqZEZNmXF1aUEXHMlKuoADUYTUQ6yY2eUgW5ung iAag== X-Gm-Message-State: AOAM533Y0+8nk4TbLEoHyuD/8hs7jDtyLDOsQje2xyODcNdFLb/VZeGr AQn9C/pr7HBbtRpRtDU3PH24iQ== X-Received: by 2002:a17:90a:7a8b:: with SMTP id q11mr10922841pjf.35.1633064646285; Thu, 30 Sep 2021 22:04:06 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:05 -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 12/22] dm: add a hidden link to efi object Date: Fri, 1 Oct 2021 14:02:07 +0900 Message-Id: <20211001050228.55183-24-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 This member field in udevice will be used to dereference from udevice to efi_object (or efi_handle). Signed-off-by: AKASHI Takahiro --- include/dm/device.h | 4 ++++ 1 file changed, 4 insertions(+) -- 2.33.0 diff --git a/include/dm/device.h b/include/dm/device.h index 0a9718a5b81a..33b09a836f06 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -190,6 +190,10 @@ struct udevice { #if CONFIG_IS_ENABLED(DM_DMA) ulong dma_offset; #endif +#if CONFIG_IS_ENABLED(EFI_LOADER) + /* link to efi_object */ + void *efi_obj; +#endif }; /** From patchwork Fri Oct 1 05:02:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515002 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp453373jaf; Thu, 30 Sep 2021 22:07:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPM/LK22Tz9GWAj8YgIh3Br6vHkMkOc0epU72A15foFEqXZC8DWVqkAXJFEg6fch1QrsFE X-Received: by 2002:aa7:c686:: with SMTP id n6mr12132065edq.101.1633064868552; Thu, 30 Sep 2021 22:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064868; cv=none; d=google.com; s=arc-20160816; b=t7vfHwNbB23Zcl3bRmdbD5e2KdzdqVUjjwyL3bN4h2gwdXDP3OmbrIwAmy5acbUDBR DbpJ4HbFDhER/+W+OxAcHIv8KynHCaBF1rIFOb1vl/geCdJCbA1/2Lc1ASo2daUH9zB6 NegtaFi+iRj7wU1+8hTV35WaMYXJvHNntIRcvm6DaIj1JID5WX12LIgQ5W3/tvJLon2g JkamEDpwR1V8vtR8LuI9Q2BBxzeroRBoDe2UGbrW6vgXjvV348mynjVHmuYO759LGpYJ P/ZR32UtxwEcIyfMBr7EPcVr/wZfqA9QCt1g1mMKqqMaa7AbASF1QNBAvLcaNd5Ps++8 txwg== 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=ljBbc9yy6BIAE/d1lliVlMaJO1EJHQ1AhZFnjPHH/kI=; b=BvRrFipl/EvYgNWpP+69NhKVET2p4M1XRrSA9jXFyEyuyhNx3E3z7p288nbmANXzgI N/qEu3zE2eDecdKkJ6QdAGAnLLZnnPeYafwVXdVE9+Dq4aDHi8ueR69XzZUIdLsuf+Bq Vswi4DckWCF/XCBvMRmQcIFbZdB+YLJOZDPIOoSD8c3gahg7zkuy8MyhCvwxjwMaN7vZ +2EcczuxAP2ujV8KFh84HrgZU6DuQaQPbCY9NDDHw4fkjTPYWvlPH+S8lkzEZhcwoowY xaFTJNZ33SFWmEW/1Y2GRZpL6cv9a3xIwYpKIgn7KPwo/B0TG9h/pF5Vd+T63FXzU9Jb tW/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ah/HQK35"; 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 i10si6497020ejd.99.2021.09.30.22.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:07:48 -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="Ah/HQK35"; 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 A7F9083465; Fri, 1 Oct 2021 07:04:47 +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="Ah/HQK35"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7AFE983404; Fri, 1 Oct 2021 07:04:24 +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-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) (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 18B838341B for ; Fri, 1 Oct 2021 07:04:15 +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-pl1-x629.google.com with SMTP id y1so5519729plk.10 for ; Thu, 30 Sep 2021 22:04:15 -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=ljBbc9yy6BIAE/d1lliVlMaJO1EJHQ1AhZFnjPHH/kI=; b=Ah/HQK35REkodihkPeXka5DzU0sy9gTFtKA+qdvW6+E1PrA/ISx9pWIHe0kbxAt5df g5bj85m3xHpd5o+8p0lXfjTf6Ddnrj6eQWr0C15fFrbJDVs3JhuJJ5fgy4WtEknzTxpZ +1QmL+nydHj2mAsBoD1PVQnzvu/UdCU3a5f65OjB2uYdF7UPpPGfcDv3F2zv432goR3u im1xxevUEYjwL8uWZElV39sOqO9LQ7Yjk5fmLL5DwTqd5uaelFOHlvU5EvoGpCX5sZe1 my7uggw/p0PUGIplxNzuOmBYF6lSSb6FIKMXtkbOts5+o5WmFUbQKaAeKwURGl5/aoHR zrhQ== 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=ljBbc9yy6BIAE/d1lliVlMaJO1EJHQ1AhZFnjPHH/kI=; b=LWw0DaFl8qWvRPKUTGYtM3Wd3qRev2tR6StrSt3txJ4WatApyTZfSS7xCngbNj2MPo yfgOA63GpkwcPJ+eMXagiI4g57PlV243R8zFezbcB+8yyL5eeKnjFD0XB4WO658OhUxy T4x6RR1oiaJMsC32LjEXkyl5AefegvVCuvO3QHHQH8t2QmsgfgqKYI4c+Qg0YYdueQn2 0EGswn8Adomufc3dfsn3w3e5iQpdWnzDOkqgItQXFfH11MbOsNp38mv9Jgur785MsQyG 43Prm0kaQcrK5BCpx8tnWexcWFsRBu8M2Y7Bp9OQ+kWz7DPY+W2VqdRQpjMhDxaeAuLG CyOw== X-Gm-Message-State: AOAM533vgFyKQi90r8eur8caahwF3ZHsRFHqLa23fyasOMZw4walaBP9 uR6QFKtkQTe0xp+P2hHvLIyRYWPEoxkKqg== X-Received: by 2002:a17:90a:3fca:: with SMTP id u10mr17393243pjm.95.1633064653336; Thu, 30 Sep 2021 22:04:13 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:12 -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 13/22] efi_loader: disk: a helper function to create efi_disk objects from udevice Date: Fri, 1 Oct 2021 14:02:09 +0900 Message-Id: <20211001050228.55183-26-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 Add efi_disk_create() function. Any UEFI handle created by efi_disk_create() can be treated as a efi_disk object, the udevice is either a UCLASS_BLK (a whole raw disk) or UCLASS_PARTITION (a disk partition). So this function is expected to be called every time such an udevice is detected and activated through a device model's "probe" interface. Signed-off-by: AKASHI Takahiro --- include/efi_loader.h | 2 + lib/efi_loader/efi_disk.c | 92 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) -- 2.33.0 diff --git a/include/efi_loader.h b/include/efi_loader.h index c440962fe522..751fde7fb153 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -517,6 +517,8 @@ efi_status_t EFIAPI efi_convert_pointer(efi_uintn_t debug_disposition, void efi_carve_out_dt_rsv(void *fdt); /* Called by bootefi to make console interface available */ efi_status_t efi_console_register(void); +/* Called when a block devices has been probed */ +int efi_disk_create(struct udevice *dev); /* Called by bootefi to make all disk storage accessible as EFI objects */ efi_status_t efi_disk_register(void); /* Called by efi_init_obj_list() to install EFI_RNG_PROTOCOL */ diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index cd5528046251..3fae40e034fb 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -484,6 +485,7 @@ error: return ret; } +#ifndef CONFIG_BLK /** * efi_disk_create_partitions() - create handles and protocols for partitions * @@ -531,6 +533,96 @@ int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc, return disks; } +#endif /* CONFIG_BLK */ + +/* + * Create a handle for a whole raw disk + * + * @dev uclass device + * @return 0 on success, -1 otherwise + */ +static int efi_disk_create_raw(struct udevice *dev) +{ + struct efi_disk_obj *disk; + struct blk_desc *desc; + const char *if_typename; + int diskid; + efi_status_t ret; + + desc = dev_get_uclass_plat(dev); + if_typename = blk_get_if_type_name(desc->if_type); + diskid = desc->devnum; + + ret = efi_disk_add_dev(NULL, NULL, if_typename, desc, + diskid, NULL, 0, &disk); + if (ret != EFI_SUCCESS) { + log_err("Adding disk %s%d failed\n", if_typename, diskid); + return -1; + } + disk->dev = dev; + dev->efi_obj = &disk->header; + + return 0; +} + +/* + * Create a handle for a disk partition + * + * @dev uclass device + * @return 0 on success, -1 otherwise + */ +static int efi_disk_create_part(struct udevice *dev) +{ + efi_handle_t parent; + struct blk_desc *desc; + const char *if_typename; + struct disk_part *part_data; + struct disk_partition *info; + unsigned int part; + int diskid; + struct efi_device_path *dp = NULL; + struct efi_disk_obj *disk; + efi_status_t ret; + + parent = dev->parent->efi_obj; + desc = dev_get_uclass_plat(dev->parent); + if_typename = blk_get_if_type_name(desc->if_type); + diskid = desc->devnum; + + part_data = dev_get_uclass_plat(dev); + part = part_data->partnum; + info = &part_data->gpt_part_info; + + /* TODO: should not use desc? */ + dp = efi_dp_from_part(desc, 0); + + ret = efi_disk_add_dev(parent, dp, if_typename, desc, diskid, + info, part, &disk); + if (ret != EFI_SUCCESS) { + log_err("Adding partition %s%d:%x failed\n", + if_typename, diskid, part); + return -1; + } + disk->dev = dev; + dev->efi_obj = &disk->header; + + return 0; +} + +int efi_disk_create(struct udevice *dev) +{ + enum uclass_id id; + + id = device_get_uclass_id(dev); + + if (id == UCLASS_BLK) + return efi_disk_create_raw(dev); + + if (id == UCLASS_PARTITION) + return efi_disk_create_part(dev); + + return -1; +} /** * efi_disk_register() - register block devices 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 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 From patchwork Fri Oct 1 05:02:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515008 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp453974jaf; Thu, 30 Sep 2021 22:08:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxouU9pXDtR3MlPayp66GVl4TSTJiSMTYjU5VTmcPBTh9qq+2V2MaJtsAKwLhJKXhIaaDPj X-Received: by 2002:a17:906:154c:: with SMTP id c12mr4233829ejd.76.1633064928107; Thu, 30 Sep 2021 22:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064928; cv=none; d=google.com; s=arc-20160816; b=VbI7NsKV74JRB8xrchhwHvj4T8lwI39WCTFVNqzff0JwNYu4Ip6+4B3NSRV/DfmN78 Biwtzky/gGQmqUqfHC9WnGJFpTFQoFIJ0DpwwXPN8pjB/u7vk2bVUFdh6iwZL3oNlqYb 8hAIyY60fnJlRz1xNMKiX5S3Y3OOCQuZ/S95LVr949Zit4iz8lzgPMGYnMfkxXmXWdsZ ze+DmODaWj6uXkzXGzSe1Vf405PbZpaOB0MTSLkwHalVkRQAw2qdcXHpD+hkdG7ccbKJ K4HPVy/UigiCHC79aNcM5H6swLCQbkpkWEUW5gCaaHvFq6F7IyCpvzVguitwY6n1bKI4 DAYg== 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=L0tO99RHHL4KQN7RYjqTxDr3uBNsF0Bss6lY1EesGwM=; b=HU9uUrak2CuG1ekkIN4+Jc4L76kevQf296nnQSOV7+CSct+28jaDQo4NNmqxWdO6kq ldyJmy3dwT6qEecZs+u4vpVvwTMP9Feiz209DHO5npMm5EA8pio51et5EpM2JQI/UxnL R91kOB4u5dbSyAbsTTDu7xQT3Z2Af0qp7T1RWbCl5C09FqawTqHXzBLkvb8o589Y5sUF p7Vlhp7P/Ut/lq3uwHylm5uqekLqgVkaqVXIaMEnKosmUkNaLhlTHB740QEFD/ruMhoK WR9OHrI0NBkozmEq6RZqqeaVWrpiQOg1WZP/3QP5TB2gXERNPXZBoyyP5sdDclkIbf1J XbmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y7KOFyjr; 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 21si6402856eji.148.2021.09.30.22.08.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:08:48 -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=Y7KOFyjr; 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 6CCD283453; Fri, 1 Oct 2021 07:05: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=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="Y7KOFyjr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B44D383453; Fri, 1 Oct 2021 07:04:46 +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-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (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 283788316B for ; Fri, 1 Oct 2021 07:04:37 +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-pg1-x530.google.com with SMTP id 133so8385403pgb.1 for ; Thu, 30 Sep 2021 22:04:37 -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=L0tO99RHHL4KQN7RYjqTxDr3uBNsF0Bss6lY1EesGwM=; b=Y7KOFyjrz2NTfd2CHfewsXXkaQqHEFa2XMa+jJyxSCZpvLPq+FaDWq7YN/R9Os5ji9 fDBT2lqMFs1O1qKo1SHOcI10ZtRkUrMi/BAXI1NC56W2l5dQkV+fPRbwAGfifuhRbOFe FtLoIe9ZVNr9I8BOp6O1DhEZCIGTVb0jJ7ke0a2FvibPk7LySVzfKuw68ElckJSFbVpG 1FzZD5p+R7KCEe1NS1LkFzP/mXjaxzngyO3PTxu6+eWq4YJfGJpbdBVGQP0Zvk5NjQqE ljHZcIuHJ6yMKEAIjNrtUUj7CbnVPsMcy67Hr0yRiMsnWkE1k2q8HUdt8Ta7DYrF2pM4 NDNw== 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=L0tO99RHHL4KQN7RYjqTxDr3uBNsF0Bss6lY1EesGwM=; b=a/HoQEiwzXUbpizOFeb6FEh3qdf/Zq4YQBJ+dltWtjT2syeieSXatW27u5ntFS1BCM V56vZKzoihb11Vyxgcc36NZYl8Ml4IwDd4JY6I5xwBkpq0expik59Obsxu8xl5Slf4WM FKoqFb9dxHR2UcmyDNats/5zvhuoVuuNO8KrPX5wDj2btv7mCnPeTf6YikrPd8482Jmi 4q7e3HMxORKsSmAPyp2MiEJya5lhSGrBVT1NG87zaKxhPXo/ZHOVjR4v23CGO2pmPep4 Ou+eyrwNKO1SwB6NSDQ+82KxfOWYaua+5/qfEY0XiSIekocnU4vOY+Da3JYKNfky8vrS jiFA== X-Gm-Message-State: AOAM532o++dEmVWHbbJJ4JuA4HFwXL/r+eQcbqa8Cfvdy0mEm5AJ4yz7 c74ONjf9oJs/MCV9TJn60nf6zg== X-Received: by 2002:a05:6a00:cd4:b0:44b:b523:4d7 with SMTP id b20-20020a056a000cd400b0044bb52304d7mr8191663pfv.72.1633064675343; Thu, 30 Sep 2021 22:04:35 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:34 -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 16/22] efi_loader: add efi_remove_handle() Date: Fri, 1 Oct 2021 14:02:15 +0900 Message-Id: <20211001050228.55183-32-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 This function is a counterpart of efi_add_handle() and will be used in order to remove an efi_disk object in a later patch. Signed-off-by: AKASHI Takahiro --- include/efi_loader.h | 2 ++ lib/efi_loader/efi_boottime.c | 8 ++++++++ 2 files changed, 10 insertions(+) -- 2.33.0 diff --git a/include/efi_loader.h b/include/efi_loader.h index cfbe1fe659ef..50f4119dcdfb 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -579,6 +579,8 @@ void efi_save_gd(void); void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map); /* Add a new object to the object list. */ void efi_add_handle(efi_handle_t obj); +/* Remove a object from the object list. */ +void efi_remove_handle(efi_handle_t obj); /* Create handle */ efi_status_t efi_create_handle(efi_handle_t *handle); /* Delete handle */ diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index f0283b539e46..b2503b74233b 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -503,6 +503,14 @@ void efi_add_handle(efi_handle_t handle) list_add_tail(&handle->link, &efi_obj_list); } +void efi_remove_handle(efi_handle_t handle) +{ + if (!handle) + return; + + list_del(&handle->link); +} + /** * efi_create_handle() - create handle * @handle: new handle From patchwork Fri Oct 1 05:02:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515010 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp454209jaf; Thu, 30 Sep 2021 22:09:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxurvrsaDe2SDebkYNSmIn8w3Smy0PJXWWzET76id4s5mJ3LcqubLGe7Vc1SL/ReXBLwHYg X-Received: by 2002:a50:e14c:: with SMTP id i12mr11912024edl.125.1633064950448; Thu, 30 Sep 2021 22:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064950; cv=none; d=google.com; s=arc-20160816; b=jhMlUudBFCZZR+Y9npdDNyy6lmH9YLKE0eRfVkN7jRRjnhnvHL+tIBHopcNHGJObbo coyvl3/MiAHCv7w2LWR+ysYZY59In7R1JVGA8ZV1g5YhfNrXN9rkSpm5wQ1tJqoBoSBO eQgv0a3lJZg49XNNGjqJepHJT42E4rakblDfYu+2lmdgecBdWjDyBaCRPl3aWCiPMS9c FzC133iJRzUL2I5py4ASlg6+LgeQg4F7RngOyGOyGPwbgA6io2ySoZ/okPYM54S3+cEZ cUqjNBXBzMePQ8hhsWJ9RX+MYgR/AlQahfJ2/ggfMssXyEqkpwfNiCFnwcLdmKuu2nZn tcPg== 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=L0tO99RHHL4KQN7RYjqTxDr3uBNsF0Bss6lY1EesGwM=; b=YbUKhczwc9BGVoe+b9XSP/w+j1dGLjLudX2C13i5CiMUnAlnfzsn+9UWfuN1NSnr5j F9MupFgsGUasb4nUO86qPjhHWSb25CjuS9TSNdbcCzIWzLp4JMQFk5N5OdMZ1PFwM4yn tYde7RxpxptLdH5zAkrrHXAxgGrpiSb3xVBGuFAju7dSIOGP97tYVYkakzjDFbdw/zV/ nSIbK9wNSZI1RnC0qnpmOwSK6y6RAPf7UKUu5SXtBcIy96ztYbfUyou8RzRs6tB6d+4Y swf77MrlOYtQ5vASBrZ+vi3dQsZ11TD3BJARRlUAQ37x83fq4oDB0ZRdQYDrXAZf0cqj 2PTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MvkuiY72; 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 b9si5789894edn.271.2021.09.30.22.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:09:10 -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=MvkuiY72; 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 6C97B8348E; Fri, 1 Oct 2021 07:05: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=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="MvkuiY72"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2820281EE5; Fri, 1 Oct 2021 07:04:54 +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-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (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 237E38344D for ; Fri, 1 Oct 2021 07:04:44 +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-pg1-x530.google.com with SMTP id g184so8368255pgc.6 for ; Thu, 30 Sep 2021 22:04:44 -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=L0tO99RHHL4KQN7RYjqTxDr3uBNsF0Bss6lY1EesGwM=; b=MvkuiY72V2ngYAgrSvdQXWIoXQRyfLYFxin62zE23hCAeACcA2Sbr9sVBpUnimPPae igLZ8WYjMeYJPVobuRnXctlv7xvM3IKGlsDzAlEgiSaK/q3UuX3GWh+8hju2pUonFU31 dud4RMGed2Wutl8L14rh+Ws/ywaGcuJm/0gzskrdsVzJXjcksJfq0S8q+0Z2jLMwZc4y 7UvCy6p3PKwM+olXx0wP629cZ3gnMSWKf10w9LG475QgVxxVR3O836eb6ogxGRsFTbOL C6BBnha/a1Vg4plaNVe/DV5XWFC5RIRcrIJomlh1Le4CmHk3pwO0v2SzzPhd9un/VnCC caTg== 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=L0tO99RHHL4KQN7RYjqTxDr3uBNsF0Bss6lY1EesGwM=; b=KTlozT6XgaZ8kX46v3S/K2yiOZ4qFIMCcA/3LBTEqGTlZKPbghOmYW5qA91T48lzJE j1OfX1AfCnLXq+3kl9M3VyCt1fYGwr8GvYkd3faqGwE1clR1eeGh6kzWcPmLNiKkTEn5 MlxEW4rzmKQcIUmJOURtUIgX0VA8fYlPK6RwZAvucvu1BWfVvcyBwu/+bEuk84IS7ta4 sUTRiML5c5VEGglJLMvkGD+W+N11xMo2kSPhK3hP6wIyDQgqpmShOLUxKelSWpEDTo2v g+Rl6vGQesCWuNHLo68qwQKpEBH3Z9+dTHmjK4FhjWqfBp2g+AJif4KJywQRQ+3ZIHPQ j4Qw== X-Gm-Message-State: AOAM53254H8ZE2kUcBLOM0VDdzVoqDYrMPtlkEjKC257xFxqyXPnCMQP mEfZPFT/+6/bJV2MGqeokhPOGw== X-Received: by 2002:a65:62d5:: with SMTP id m21mr8310723pgv.124.1633064682281; Thu, 30 Sep 2021 22:04:42 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:41 -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 17/22] efi_loader: add efi_remove_handle() Date: Fri, 1 Oct 2021 14:02:17 +0900 Message-Id: <20211001050228.55183-34-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 This function is a counterpart of efi_add_handle() and will be used in order to remove an efi_disk object in a later patch. Signed-off-by: AKASHI Takahiro --- include/efi_loader.h | 2 ++ lib/efi_loader/efi_boottime.c | 8 ++++++++ 2 files changed, 10 insertions(+) -- 2.33.0 Reviewed-by: Simon Glass diff --git a/include/efi_loader.h b/include/efi_loader.h index cfbe1fe659ef..50f4119dcdfb 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -579,6 +579,8 @@ void efi_save_gd(void); void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map); /* Add a new object to the object list. */ void efi_add_handle(efi_handle_t obj); +/* Remove a object from the object list. */ +void efi_remove_handle(efi_handle_t obj); /* Create handle */ efi_status_t efi_create_handle(efi_handle_t *handle); /* Delete handle */ diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index f0283b539e46..b2503b74233b 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -503,6 +503,14 @@ void efi_add_handle(efi_handle_t handle) list_add_tail(&handle->link, &efi_obj_list); } +void efi_remove_handle(efi_handle_t handle) +{ + if (!handle) + return; + + list_del(&handle->link); +} + /** * efi_create_handle() - create handle * @handle: new handle From patchwork Fri Oct 1 05:02:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515012 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp454446jaf; Thu, 30 Sep 2021 22:09:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6b7aMJlO+V5OE2RHKNErANHyeOQirodEGycwqyZruSB8CJ+dq/PeZiMV4dqA/pPXmfVRp X-Received: by 2002:a05:6402:21d2:: with SMTP id bi18mr11809784edb.21.1633064969416; Thu, 30 Sep 2021 22:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064969; cv=none; d=google.com; s=arc-20160816; b=VwU8sD1GS//kQBgR4dAfV0BrD5jXHsEtYZvDqws8zt5aQPItmnzUS1upiIN5CQElUQ NMm6Pg734TRT17oHBp44V1cI7AbbKeEUG7MP9wLxe98xVZM6+jvFGUEeLxSJWu0ajG7w VlCjaGOd9tXOUn4199JK8M4+WXQz/cwLIHORES62ERglpPIKNYIsjjFihvccUxPeCC9E fZwA/GDYysinC55b41sFj+d0686LCRfncWR+7JtRSzeCo1mSbcOHWtXUO8gQsbrwpIeI J5WmZ9G5YlXCEbPnNUwkhLi/72LyCM5ZGUHBX65S8TzkCmu9D2j603nifyWmHcJIAQfK GpMg== 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=3twPqvbIuj/O0dFgQHqyndh2aMFnT3N8S7zk68TTxgo=; b=zbNmN0XRRzZQg2m9FJTcpaV4yIp2y6LeslXqD3Un30IXKIgiH9B1ipfl1PIJjMEPZF EGHBaNUUjdNnvXiizzhQvp7ZIfr+u2+Sck57SBeU90iJkoHNManqiOVX+WWH2HO/BJqQ 6n7hsO+a5F8f1YU+AVRKlCibfwAjMJR6J7IDFaiPOAUBPDuBOZFP1ULuoxSpQXMU3cDv 5Sb2RvxlSMaEFnZvHTiq88l2HQwMEsw6WPmWAD+B1bCi2P4b5MGAQa+EKXVwueuuHUwx bG7IlMSewWFH7Cb3aALmXXpMtRCEXTMOnxYanscIX0GbEtpkKEt6FSj8tbnv4H8Wwy0F wcYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QmdjNkL1; 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 f12si5576936edy.16.2021.09.30.22.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:09:29 -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=QmdjNkL1; 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 EEF4F834AA; Fri, 1 Oct 2021 07:05:36 +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="QmdjNkL1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 142EA83453; Fri, 1 Oct 2021 07:04:57 +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 EB79583455 for ; Fri, 1 Oct 2021 07:04:50 +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-20020a17090b3a8c00b0019eff43daf5so6384623pjb.4 for ; Thu, 30 Sep 2021 22:04:50 -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=3twPqvbIuj/O0dFgQHqyndh2aMFnT3N8S7zk68TTxgo=; b=QmdjNkL1qKi2D5Lk+8DMiFpdcN6OSACpjwI2NYIwX34ziBAfhI82AG1FwIp7tBXtzv j8FzYmlQhum7ksIRFpFV4YIZN0jqn+y65V81ueGoB/Fq/axBkrMggTzZ/IO18Vr8c1he GeP8zPXzhASASikrPX5pgllx3yWiuy5GS6phl07kCDn9AcVndhOVFnQ4xdt6muQQu9Jj J+nwTBaWPcJMsvZ0YbK42ht+oUgYvFu8VOnkicvse7jmxECuqbnCHjIEtyutPv6d/Gqg d2Cax3E12TdcNpmlK84ln1vZjA6Os5AjKExL/URbrizeXGw30UrCqo1Z4UbPSWAsoPyt 44gg== 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=3twPqvbIuj/O0dFgQHqyndh2aMFnT3N8S7zk68TTxgo=; b=LDaUnhAjTsF6gypSwl4RIEFBD3C13Ijl95aPtAaWQ+qo/xEx8L/a186fhLn3INHW67 /lIW4AOr39trwgKcQatAMTQBkrnTXNfHzVG/1IT9u0dLWpIN8qlX/ec01aApCI6vsABF Y3Nl/h2TmFkWFyiuvP9S9H0hzcXcQ89SJHhhr3fGZY6W7BcINoHHub7mt2l6V5c0fWxw A3UaX4ZF9UEUQlbeIZgtu6BpmsWuPcAZk7wJOa7aU2Uqx4Sk3Z4IQCOhq0CplfaCfrtU fGYf8+aGlrITAPx7OytLTwAto68peeHG/021OaVBi6X2gXLPx4TD52jfcJLQfv4hwk1m Ay+Q== X-Gm-Message-State: AOAM532X2gnFCoOJGgOhA6O4BJ0MFqrQhKam1zRUgCUvcBcV6Ir26RnV lHffDLQUK4JgYx9GTJxhvk1/2w== X-Received: by 2002:a17:90b:4c4d:: with SMTP id np13mr391326pjb.193.1633064689215; Thu, 30 Sep 2021 22:04:49 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:48 -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 18/22] dm: blk: call efi's device-removal hook Date: Fri, 1 Oct 2021 14:02:19 +0900 Message-Id: <20211001050228.55183-36-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 the callback function, efi_disk_delete(), in block devices's pre_remove hook will allows for automatically deleting efi_disk objects per block device. This will eliminate any improper efi_disk objects which hold a link to non-existing udevice structures when associated block devices are physically un-plugged or udevices are once removed (and re-created) by executing commands like "scsi rescan." Signed-off-by: AKASHI Takahiro --- drivers/block/blk-uclass.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) -- 2.33.0 diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index ce45cf0a8768..b8ad267c6c61 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -847,6 +847,16 @@ static int blk_post_probe(struct udevice *dev) return 0; } +static int blk_pre_remove(struct udevice *dev) +{ + if (CONFIG_IS_ENABLED(EFI_LOADER)) { + if (efi_disk_delete(dev)) + debug("*** efi_pre_remove_device failed\n"); + } + + return 0; +} + static int blk_part_post_probe(struct udevice *dev) { if (CONFIG_IS_ENABLED(EFI_LOADER)) { @@ -861,10 +871,21 @@ static int blk_part_post_probe(struct udevice *dev) return 0; } +static int blk_part_pre_remove(struct udevice *dev) +{ + if (CONFIG_IS_ENABLED(EFI_LOADER)) { + if (efi_disk_delete(dev)) + debug("*** efi_pre_remove_device failed\n"); + } + + return 0; +} + UCLASS_DRIVER(blk) = { .id = UCLASS_BLK, .name = "blk", .post_probe = blk_post_probe, + .pre_remove = blk_pre_remove, .per_device_plat_auto = sizeof(struct blk_desc), }; @@ -937,6 +958,7 @@ U_BOOT_DRIVER(blk_partition) = { UCLASS_DRIVER(partition) = { .id = UCLASS_PARTITION, .post_probe = blk_part_post_probe, + .pre_remove = blk_part_pre_remove, .per_device_plat_auto = sizeof(struct disk_part), .name = "partition", }; From patchwork Fri Oct 1 05:02:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515014 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp454595jaf; Thu, 30 Sep 2021 22:09:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOs7QdKa7QJ01o8bS5YqTym700KrcCZlGf2F9Qen6IRbH8CNDeb0X23EpTuXrPmmVRG4bJ X-Received: by 2002:aa7:c0d4:: with SMTP id j20mr11890558edp.26.1633064987439; Thu, 30 Sep 2021 22:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064987; cv=none; d=google.com; s=arc-20160816; b=KP6rg1ugboZXeFUKY30JbXEABlprpxXvlS+rXsVUx6ekG6GMr6ZsW8DLyHumA2JK6N F5dnSdTH+GTH0yGZKs2OA7B+4cfz7RMcpqROl/pIPq7KR6uGN83Bq5WdTdlpqoNSnPMR YRD5cypbh7LPncaHxDJuaSLkJA4x/5qv4rKdZSjtQ2kLAlWYhkiiBLQpmw09hMmjly7e VvFZcLrGXUnmpZY+wfOeVl4vj1yoSl98FKwGz5tClf4Bwhd3PSsRU1S3SkCVUHsxLcVv IdK/c13+G+ghXJHAQN2d0TFBQHXZHQdS2li/Ox6qU+Lm+LuXeFj9rW7c8Cg4q9ZavrXy xXNQ== 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=3twPqvbIuj/O0dFgQHqyndh2aMFnT3N8S7zk68TTxgo=; b=yKCMbIeRUafdiq5KPryRP1KmHrlAxkmsjZtU9K9Tn0HFASObfqdssypJ7ROTJPn5Tn MaNDSR1mVj7mUgq+h+j7N85CThMPEI895gQq7KeQtDaPPsppLI7ftL44QtxqgCvLkNfp i7w2oRN800fQtWFD6jq7vBYGX62b5sqWCJaAhMQCd/ebv51B3aJE7chnHU7gScubUwbY oTYNto/UzQDGZlZXNoldSI1jNzjf9yvL8jH9N3gFPnFmgrQEiZYzJZHkqyFvPhQt9nx6 r2CRB1GmBvM7AGreHa8FnWyDqKB9ThwcEwqt1aeAVsZklnBmPVDHmj0gVDV7Rc3YVhA2 rSlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="B2/LAZp9"; 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 u15si6918575edt.211.2021.09.30.22.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:09:47 -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="B2/LAZp9"; 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 8060D834B5; Fri, 1 Oct 2021 07:05:43 +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="B2/LAZp9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B94BF834A4; Fri, 1 Oct 2021 07:05:17 +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-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (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 3750B83460 for ; Fri, 1 Oct 2021 07:04:58 +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-x42b.google.com with SMTP id 187so2480828pfc.10 for ; Thu, 30 Sep 2021 22:04:58 -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=3twPqvbIuj/O0dFgQHqyndh2aMFnT3N8S7zk68TTxgo=; b=B2/LAZp9ftkpbiPyKZtOfLtdCqYbzPoGbQZvyBCoRVhR2wHtskdxiY+gWr2LLsxGiD 9jp0W7bsfEONOisAGIBpQzStYQWQf43t3Hmqi+Duqelp7xZSH6U2LaHOFSgliwxQ2dZg k8hbTERIhJ0yQLKxxFgu7Jr5jB1pr1OgRwYu4hAioy1zagNhM3QKaGK4BnfOOMfjKLKi InhLxrl76EH/Dn/QA7mjQ2WIMMhj1XyNM29l0Xc1TI0c506FDn9qlIs4ufVALS7+fJXQ XmdDMqm8xkISVlldGFNFXcL9n5QSnmAmLEfyU6eys7JTxFrS9OOgj99Q+otrpSTYd2sE XRKg== 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=3twPqvbIuj/O0dFgQHqyndh2aMFnT3N8S7zk68TTxgo=; b=ucx1SNWJ7Gnreck3loyp0Doi/wv2nrga+iWa5IlNTj4VgVH3RhK0PksVYEXd/F5f+L cmRtVBAM+XAvVuVxT2UZUeEVO/SUIZT4IoMybNFIe1YZs/NewjcF+buJ7wmEecBk7HMZ /c8k10tUDMrXxAPj+CY6zYQqE357g0waVQrbS8oSiBtmXCNkd3ksBdF4zmNmlubdd/9T ulApNksrviLS0d+OSja+7QwowWkqP4XSXuYqjYZM+QVuT5KcmU6WAgOwApt0k4/KKUAh 2tjE5ycWiTTOnzpmg5qjnPEZeiVZhn6eVAQvIbqdFW0K3ds9TAUMbpH1W7uHsTmMyIy/ FiqA== X-Gm-Message-State: AOAM531wosnOQ7pm+x1MDKGE8IWfEdCqiQRWC4PH/wUkLIBqKiyQoKdd GwHoHYlVJLZuKUpIpJgkwhlnHA== X-Received: by 2002:a62:f20c:0:b0:44c:1f55:b008 with SMTP id m12-20020a62f20c000000b0044c1f55b008mr17566pfh.22.1633064696458; Thu, 30 Sep 2021 22:04:56 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:55 -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 19/22] dm: blk: call efi's device-removal hook Date: Fri, 1 Oct 2021 14:02:21 +0900 Message-Id: <20211001050228.55183-38-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 the callback function, efi_disk_delete(), in block devices's pre_remove hook will allows for automatically deleting efi_disk objects per block device. This will eliminate any improper efi_disk objects which hold a link to non-existing udevice structures when associated block devices are physically un-plugged or udevices are once removed (and re-created) by executing commands like "scsi rescan." Signed-off-by: AKASHI Takahiro --- drivers/block/blk-uclass.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) -- 2.33.0 diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index ce45cf0a8768..b8ad267c6c61 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -847,6 +847,16 @@ static int blk_post_probe(struct udevice *dev) return 0; } +static int blk_pre_remove(struct udevice *dev) +{ + if (CONFIG_IS_ENABLED(EFI_LOADER)) { + if (efi_disk_delete(dev)) + debug("*** efi_pre_remove_device failed\n"); + } + + return 0; +} + static int blk_part_post_probe(struct udevice *dev) { if (CONFIG_IS_ENABLED(EFI_LOADER)) { @@ -861,10 +871,21 @@ static int blk_part_post_probe(struct udevice *dev) return 0; } +static int blk_part_pre_remove(struct udevice *dev) +{ + if (CONFIG_IS_ENABLED(EFI_LOADER)) { + if (efi_disk_delete(dev)) + debug("*** efi_pre_remove_device failed\n"); + } + + return 0; +} + UCLASS_DRIVER(blk) = { .id = UCLASS_BLK, .name = "blk", .post_probe = blk_post_probe, + .pre_remove = blk_pre_remove, .per_device_plat_auto = sizeof(struct blk_desc), }; @@ -937,6 +958,7 @@ U_BOOT_DRIVER(blk_partition) = { UCLASS_DRIVER(partition) = { .id = UCLASS_PARTITION, .post_probe = blk_part_post_probe, + .pre_remove = blk_part_pre_remove, .per_device_plat_auto = sizeof(struct disk_part), .name = "partition", }; From patchwork Fri Oct 1 05:02: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: 515016 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp454856jaf; Thu, 30 Sep 2021 22:10:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuGxw5M2YgtJHcLe/sHelFfydNTsyXhPepBeViuYHvpzQbLpehgy7asgjWaXRfwfJ3sZve X-Received: by 2002:aa7:c2ca:: with SMTP id m10mr1671220edp.394.1633065008739; Thu, 30 Sep 2021 22:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633065008; cv=none; d=google.com; s=arc-20160816; b=FPXsPE7SDQvj8ocYPyDhbkQvxAESPC/JcaBXij64gN36SnlMxi4roBmSoNLyPIhzT+ paw+SmnAe/aG7eNvCD+OHG6yaKiZc6uXnufewFkLvCW2d2UDn1ZNOkzvSbxR8rjux6u9 vt6oIYPtFpCbCZhEThR2HPM2bsg7LPX9UCfGlqjDAUixSS2lysioAtcLUuw2ykagUvCQ mPd5E9EdH0c/1MeBJ0HK8TENSVjU4Q3d8UoCGN69iv5O3wEMiAAUfhStD0OoS99aah8x Nt22SNM04TKBO9Pyk7ZSFEjZKpS9Bm+hh9D7cnkMrRS41Qs71QeKtZnpGBJkBoeogO4j Lf1w== 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=YrQ0zQfK6xopCyFsakNibpnVNyGMpKui4X/QiOxRkwE=; b=R2JpzjcQqrW9eUvJtcGXOTg3issdq5NUYr3cHtz5mSagXYYe43DiZhvi6Al19++3tk 5Kc+nhvzYTGVINNaaHzSQD0W7H1KGoJKaXDmsV9FdlrKZ47T/UrwKNE7azZco747MPC8 GGck3up3S5wDrFndW3iGm/liOoI2vM5SUsh1tlp9UEk7722a6x7OaX6wfLTE4jXC4FJp wlBv/gJks1jK9khYF5C3U0mhpav06wc0JlelZXqDb/lz7xf/kmIWMtYLPBfc2okiJJak pQu0tvNQv/wvSIHp/bNIsU8WimKKe4owYaQ4djg6MDEQfi2M3U6SC9BvXPD3vyqG5+3R 0LDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UIXos/Ar"; 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 y1si6251144ejk.130.2021.09.30.22.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:10:08 -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="UIXos/Ar"; 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 D989C834B2; Fri, 1 Oct 2021 07:05:50 +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="UIXos/Ar"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E1CD18349B; Fri, 1 Oct 2021 07:05:19 +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-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 C074C83423 for ; Fri, 1 Oct 2021 07:05:05 +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-pl1-x62a.google.com with SMTP id w11so5516189plz.13 for ; Thu, 30 Sep 2021 22:05:05 -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=YrQ0zQfK6xopCyFsakNibpnVNyGMpKui4X/QiOxRkwE=; b=UIXos/ArgegyXCVqTvVRDhF2/PsXAS+c72XjrblML/LdvlryZTANtBk/CEYrfE/hPx WZoATp2tN9LRFLPb0RTUAojxUKSO5YHIRQ4M9TUd4vW9LXw4XZL5gdiwSFv7p3LNpqx6 mdQEj9XZY+xo43x0168oKuNwDcyT6N6E4UnmJ8c6ueYEpMP+d0TnY0DKowr+RHOWPQ5e baMXwKWBz/9/fv92VbwYnclquaGjrDagt7br3PvvlyabEyATNvE+Dc7ttr2kaIzp/PrS s0tTj7B2Y0WtwalMPBrqjt8sYLB4/5NLSk32vpzupSPZAKp8pUA5896wNGTXlaI0wFDK RDdQ== 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=YrQ0zQfK6xopCyFsakNibpnVNyGMpKui4X/QiOxRkwE=; b=POV2bQAKwiZpDe1fyEs+s9/3pkwjuGYOlQTMd4PPK4KiKOkKorEu5yvPDEMmgMR50S Yo5Dmefzj97I9PDXomGU7qWjOCDml6yWdJUFFR1MDlSjCct7Mi0/81C1IIC3pC8Y/Pkf 9S2TIJBH7Rx4aoymV88N6vW9sxoFxYFpbwFIM5ug7ETT3ZJkc+dSnqwLBsapqXlysAQv NwD9DrupyhJ8iDYdcxAJmrZYI9jLZ40vC8MtYdSr0AUQr1LgfPQ5HjrZrtFR+g4kycRD ax42LS+gWCl54BZxCaegmPlXt206R9oO5pSzjk6bE6uzmp6enOiifc8qzkkq0A3r/2tQ MApA== X-Gm-Message-State: AOAM531AXps1sIR8bx2uaDAZYq34GU+uaXAt9LfAs+lB1N/816TNbYH/ cCmXf4DevYfLKGvuL0GMv+SYLxWUjdi82Q== X-Received: by 2002:a17:90a:5ac2:: with SMTP id n60mr10933067pji.184.1633064703974; Thu, 30 Sep 2021 22:05:03 -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.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:05:03 -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 20/22] efi_driver: align with efi_disk-dm integration Date: Fri, 1 Oct 2021 14:02:23 +0900 Message-Id: <20211001050228.55183-40-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 Signed-off-by: AKASHI Takahiro --- lib/efi_driver/efi_block_device.c | 6 ++++++ lib/efi_loader/efi_device_path.c | 29 +++++++++++++++++++++++++++++ lib/efi_loader/efi_disk.c | 12 +++++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) -- 2.33.0 diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index 0937e3595a43..b6afa939e1d1 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -173,6 +173,12 @@ 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(). + */ + bdev->efi_obj = handle; + ret = device_probe(bdev); if (ret) return ret; diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index cbdb466da41c..36c77bce9a05 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -628,6 +628,35 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev) return &dp->vendor_data[1]; } #endif +#ifdef CONFIG_EFI_LOADER + /* + * FIXME: conflicting with CONFIG_SANDBOX + * This case is necessary to support efi_disk's created by + * efi_driver (and efi_driver_binding_protocol). + * TODO: + * The best way to work around here is to create efi_root as + * udevice and put all efi_driver objects under it. + */ + case UCLASS_ROOT: { + struct efi_device_path_vendor *dp; + struct blk_desc *desc = dev_get_uclass_plat(dev); + /* FIXME: guid_vendor used in selftest_block_device */ + static efi_guid_t guid_vendor = + EFI_GUID(0xdbca4c98, 0x6cb0, 0x694d, + 0x08, 0x72, 0x81, 0x9c, 0x65, 0x0c, 0xb7, 0xb8); + + + dp_fill(buf, dev->parent); + dp = buf; + ++dp; + dp->dp.type = DEVICE_PATH_TYPE_HARDWARE_DEVICE; + dp->dp.sub_type = DEVICE_PATH_SUB_TYPE_VENDOR; + dp->dp.length = sizeof(*dp) + 1; + memcpy(&dp->guid, &guid_vendor, sizeof(efi_guid_t)); + dp->vendor_data[0] = desc->devnum; + return &dp->vendor_data[1]; + } +#endif #ifdef CONFIG_VIRTIO_BLK case UCLASS_VIRTIO: { struct efi_device_path_vendor *dp; diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index dfd06dd31e4a..e7cf1567929b 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -562,11 +562,21 @@ static int efi_disk_create_part(struct udevice *dev) int efi_disk_create(struct udevice *dev) { enum uclass_id id; + struct blk_desc *desc; id = device_get_uclass_id(dev); - if (id == UCLASS_BLK) + if (id == UCLASS_BLK) { + /* + * avoid creating duplicated objects now that efi_driver + * has already created an efi_disk at this moment. + */ + desc = dev_get_uclass_plat(dev); + if (desc->if_type == IF_TYPE_EFI) + return 0; + return efi_disk_create_raw(dev); + } if (id == UCLASS_PARTITION) return efi_disk_create_part(dev); From patchwork Fri Oct 1 05:02:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515018 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp455043jaf; Thu, 30 Sep 2021 22:10:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhAsFGNxUe6huhA0CFPd8XTzdhrbv/EQjFizMZJDOdZK94YRT76ZMoPG6rc/Sb5dOP2/68 X-Received: by 2002:a05:6402:2793:: with SMTP id b19mr964188ede.291.1633065029316; Thu, 30 Sep 2021 22:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633065029; cv=none; d=google.com; s=arc-20160816; b=DWxRontDaJRYQMts98b2Kjsd9r16CC/tXBJx6w6PtP0IS0EoXhKQkCz9W12uOPaB30 8CMTYWDWyhecfzNyfC7cNB1nf8skwOuyiW1F47ylsCpZx5vJTICRTNtCp8E/Xz9tbqDo 8+oX/QtHY22zrqFghO1boU7bdR8GCc420rD7zAntM3y/qyAOdQqBP2wdj09pVHUxVfUJ fYOv6UNnsAEa//czF9pUWWK43jwyh1pn6g8zLqrZENEliGwc2AnBBWqkN8Rt/dHVcOcD 1XuzCM6uScaGmGz8sZs/chQZ4+sUT+zlXSeM8MKgQVJLJxdaF2A4oN+WjVA6cOD1mR9e zBZA== 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=6MEGdxi745RsEp0C1/1GgabgXJFBoip4chk54RcwxKw=; b=z2EfY/o1jchZLbwBLoISU32/UhHuSHsE3UD7kvX6Kehkv87VkTcAvMlrg04Uygxgql JS7cy8EzUvA0YWnKiDv8Rya34ymlrJ6uzMZYg4Y7VI6imbYIcWSDn8lJOX9TgyewPQEw DXOins6NBbrJ9Nd0vctMmBOfQ6TvO+YdTSVMdmeblAa2OSu56B7d/mcAy2H3sZAoRjLp H1xWV2doasSfv5/eUhgERCyvroxXVsje/XnkCS+UaGKXeVsh6S45dvYY1fwizHWtS0f+ 4E60j24hGwYEBc+VvqF8vbipsVEM87OQowxvCirbf4JKNRCN5mdHU2jGMTAAa6nDk25E Zs6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GnsdGf1O; 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 f12si6057855edl.138.2021.09.30.22.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:10:29 -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=GnsdGf1O; 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 46D7A834F2; Fri, 1 Oct 2021 07:05:57 +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="GnsdGf1O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D094D83230; Fri, 1 Oct 2021 07:05:25 +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-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (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 52BEB83165 for ; 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=takahiro.akashi@linaro.org Received: by mail-pl1-x634.google.com with SMTP id c4so5538942pls.6 for ; Thu, 30 Sep 2021 22:05:12 -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=6MEGdxi745RsEp0C1/1GgabgXJFBoip4chk54RcwxKw=; b=GnsdGf1O/QXYeZ2w6/S6i/ovo3EqqzHjtK3wTRy+OohigadShWgAW2WGnHliu/oHCj coM/sIvBs/B9zpvHzI9WuSBOI2wd+d0f7ULFP5ZAB6zjJGSeyzpt6nivoC1ojIhLCsuK nQfCAUgy2fbIRhuHGVj/V2AYsjE96zVLh43tQ1RIhf6+JBFO37Wps0VBZNh6oK4d3guu y/15JhICXW0GSoCcuaF2OiwNHfLZ6fdk4l1WtR4Dr50+vSuoCoNG+nftPp9TvebhgyOD nB+XgqiD8EAUDtUYANfsC+sj/ki1h301yJV8lbLIbqvEwhKbAyS0D8vsdqNRCi2I7aCK KYIw== 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=6MEGdxi745RsEp0C1/1GgabgXJFBoip4chk54RcwxKw=; b=BwfTY4GghEJVOfo8hakC1rG6CZUhNfVL+RDg8Wa9tawDLhiGcSj3gFi1tbKfnU9RkG lRoWOLJ+LNjiW+/VDQRMapXPG6Qs7XGD8h3bNJfJ6ziEcM3WO/bcL711/MbmssRzMitS EGO6ONGm99Yen0tpx3jip5GNHg/G34IDiJ8zEnCQcgQJrFXucmWxSJkavGx46mou245N 36Sc7D/Y3o8bpPpvM+vl/uNAQlI2BfBSuwKAgHzlp9hRjpTmpK2hzjElXe77XjEk2j1Z tQTtz0+znThRXARakfLyBHTJzJHyRcPbwMkBVoHvpI4jSbfqq7sEBP/qbpNpRt368ygy O8RA== X-Gm-Message-State: AOAM530uv/uDEER9aDdwetrv29sD0AtKTxORXL9aFm7Vz9EV9UkXU/nj VoDv3RRE5h7rfpw0BAxNLpbhfg== X-Received: by 2002:a17:902:7613:b0:13d:b35f:b4d7 with SMTP id k19-20020a170902761300b0013db35fb4d7mr9303397pll.8.1633064710535; Thu, 30 Sep 2021 22:05:10 -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.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:05:10 -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 21/22] efi_driver: cleanup after efi_disk-dm integration Date: Fri, 1 Oct 2021 14:02:25 +0900 Message-Id: <20211001050228.55183-42-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 efi_driver-specific binding will be no longer needed now that efi_disk- dm integration takes care of efi_driver case as well. Signed-off-by: AKASHI Takahiro --- lib/efi_driver/efi_block_device.c | 24 ------------------------ 1 file changed, 24 deletions(-) -- 2.33.0 Reviewed-by: Simon Glass diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index b6afa939e1d1..1f39c93f7754 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -106,25 +106,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 +120,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); @@ -184,10 +164,6 @@ static int efi_bl_bind(efi_handle_t handle, void *interface) 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; } From patchwork Fri Oct 1 05:02:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515020 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp455222jaf; Thu, 30 Sep 2021 22:10:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxulMsAdjTJ8Yc108LUH/up+okqHwYntg6SQHJ4CQY3ozENyQR0NmaxmuF3WjvpX98u3Y87 X-Received: by 2002:a17:906:7848:: with SMTP id p8mr3936927ejm.212.1633065048604; Thu, 30 Sep 2021 22:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633065048; cv=none; d=google.com; s=arc-20160816; b=HnO0XnZ0F29iPvXMS2gcvAftMY0jDh+tt5yEelHldYLU0xiJY6phSMNJcrUewMRvjJ 8TAOUIDvFVusynHKrxdKweU7tqPTvopc712E3yQQwuNwtwa4ucrCSXV3S2JQcnBfA6l9 AJJlPyEfjweBt5RJ36Ib/91a9dmxec7OFxW8pAWoKlPg/54NdXdtiS6PNpQy84XyCav9 vFDKOwyCJTeOseWPe+Ai0J6J7Lbr3Vtm7rU8QiJ4uAAkcM2OlX2XKNT7OxqURgnUF183 Qc/cSDTqHT24K8cNBWldq0zd81847d7lTMXYzJYm7lLVqTjeBqM0H03ScuiRM37Np65D Ft6g== 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=GaBfqEe9/isngFGZx0xTE7ByQ3K1rJMReuvhopoSJjI=; b=iQc96rqnyapguqg4I5SCbkuc7I9TSNnDEybG/Zay3yTDtnDSkuaZq3wmYwk/Trit3a aRqkLBrQ2DW8zXqGAxbZHqRn1Ru9WP2x8Sf/hD/f77XNTa8dHUZu+HTDWSPv9Itwu9AY b+CzXZmm4D/sENnii+HAStwKpABWrf65cO3qm8p+Q9rvVS7If+hKZBF/NQ9ZSM2OmNlm a1JvRrA0JocI15nqY2x8dsrbrr0BQCdUF/Dy/eKeLfY74VvVMjR6GmRtnl7QSLXvZ4pm ityp5ckUhjz/FT1DIUDPlnDEHWPSZtI8GUlXXOJcporw7vPC1pRz7hU2zt9mPB/NaeI6 Uqwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=togcgOoV; 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 ds1si7093762edb.568.2021.09.30.22.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:10:48 -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=togcgOoV; 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 F0AAA83507; Fri, 1 Oct 2021 07:06:04 +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="togcgOoV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 25BFB81EE5; Fri, 1 Oct 2021 07:05:31 +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-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (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 1F95F83423 for ; Fri, 1 Oct 2021 07:05:20 +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-x42b.google.com with SMTP id 187so2481486pfc.10 for ; Thu, 30 Sep 2021 22:05:20 -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=GaBfqEe9/isngFGZx0xTE7ByQ3K1rJMReuvhopoSJjI=; b=togcgOoVGLjCNfqpWdaAqpWSSyvSwzXkuzTAt63M68F55w52Tm3nDruWbXK5ZCPWaV jFpwukk+VFG3yZiXAkrfoTKmQVuumKyvQJ3S5wUPxdl2qjltPpe1UpWRefA5TZ77qmlG 5lcnDgUzxmbDXIzCAs+hoK61CAHIH4I1gUy0GIyajA1MEBwMQj3/tdrEJPdqcoWh3w20 1twBN+b9vtVrsLbkEDZId104BkZoOLurNHNl3s9ImgsXRQwoMMbFBq/Q409scGkDlMrm R1u2g0CyOwSoapJOpLj01zChQS10d6uVSAiY8t+pQFSJaZ+GOlsDVN8+Cc7qE9DgJSF+ Lg/g== 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=GaBfqEe9/isngFGZx0xTE7ByQ3K1rJMReuvhopoSJjI=; b=LY9JG74gxtwqiHFpzgN1DK89//b+U/OmjRNMM17GCxXINCvuzLtKVTRPQxEdpK5+o7 eAjmZQFYuSHDDnLuLLyGVMf+WEQztM7dTJUySffnRjL1l4xxSLrNRp3VP/uupap9zo3b 6k30MNLt8/DvoqBGsaNaM5lPx5tZ6K8CAfWLBbtgnm1nPLNh3BZJK0xu+ykOigR2UvRP rGVTzSuiPJLExaWXQJyMbwX3ssTgjIfUdDXQc6dCU7ToCjtekt+KHhLOYK3HqBiwe4/k fOvZg23uENws/uUQFGjSV4ACK62zougqAdrELLI+eBH6KPyDlMDd0N+HEIWQAHQyOpY0 qYSA== X-Gm-Message-State: AOAM533CkSUmDOd2MR5QhCT21Dp20MTxSvFRE6nMHfCzuo4gAAsGCw4v uH4sWii2EmMBnoFf/qA/OVJJvA== X-Received: by 2002:a65:4884:: with SMTP id n4mr8244743pgs.68.1633064718278; Thu, 30 Sep 2021 22:05:18 -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.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:05:17 -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 22/22] (TEST) let dm-tree unchanged after block_io testing is done Date: Fri, 1 Oct 2021 14:02:27 +0900 Message-Id: <20211001050228.55183-44-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 --- lib/efi_selftest/efi_selftest_block_device.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.33.0 diff --git a/lib/efi_selftest/efi_selftest_block_device.c b/lib/efi_selftest/efi_selftest_block_device.c index cac76249e6b4..358797d224dc 100644 --- a/lib/efi_selftest/efi_selftest_block_device.c +++ b/lib/efi_selftest/efi_selftest_block_device.c @@ -268,6 +268,7 @@ static int teardown(void) { efi_status_t r = EFI_ST_SUCCESS; +#if 0 /* TEMP */ if (disk_handle) { r = boottime->uninstall_protocol_interface(disk_handle, &guid_device_path, @@ -285,6 +286,7 @@ static int teardown(void) return EFI_ST_FAILURE; } } +#endif if (image) { r = boottime->free_pool(image);