From patchwork Fri Oct 4 03:05:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1171537 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="F6qdef7+"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46kvpt0cRsz9sPd for ; Fri, 4 Oct 2019 13:04:06 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C54F2C21EFD; Fri, 4 Oct 2019 03:02:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 93B6CC21F37; Fri, 4 Oct 2019 03:02:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9A3FCC21DEC; Fri, 4 Oct 2019 03:02:14 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by lists.denx.de (Postfix) with ESMTPS id 921A7C21E4E for ; Fri, 4 Oct 2019 03:02:13 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id y22so2996069pfr.3 for ; Thu, 03 Oct 2019 20:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZdRWS/ib/9u5grmaKK/hSaT+ceNntjbXTBiRpHJEoBo=; b=F6qdef7+Xu57/miqcrpKEPBNBqWaYG1MaLW1/qJefRa1TyCpbrLJdrxOOLzcBUtsHs O+qZ73f8RcbF2Ecvjr7GYhG2qJ5rmT1YhXAxdsUw+Br38JNdprYwUT3JB3HHaSIx7lw5 gIHaqI984pNjpnot5O2Czzn8YK5qIBjIyf9jSJYTICzzpwxamoMZR9OZF7EQwNOwa01+ 6sHz9liB67najcRxIKapIY3SEe50+ga1/jAKKt86IugnA/jF3YA3WIoN66p2vFumsz29 lrdwvpH7eZL4h7mKigYpE4/eBPI+A+aBbNKjjyI+1bHroxe+oH7ptH4yVK+iGObheCsr l0kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZdRWS/ib/9u5grmaKK/hSaT+ceNntjbXTBiRpHJEoBo=; b=qgCFRaGGMX7O+GrcRknQ4NmhDq9+Oy4Trkt5vPcEmDtBaPgSAcG5UJd9ZD+/bM0TLd HH3N9dZU9/zZ5Vlz+CErQZtOHIZcSpt9aNQ0P+x+K2F8y9n3pzoTPY5jg4Asn3gLH+rk UxLqZN6v8TxgAIpx3LfnNpInCzfmfU6o/B8he3cW8zXc2WSUSgI/Fgap0rg3FowFTPcM wFV683ZkrW4lDfqHhw5+8BqE9DzoNFXKRUADlnebkc/uSMxCT/oa4BQyptk3uY9CYCVb 0xKhEJnl6/JWvsXK6DzNeF7zqlNgEZM0PoJkA8hHQkgcw2ZRbanVk++IE0RX1ApCKZ8B 7EHg== X-Gm-Message-State: APjAAAUzYmbutzwNgi86j5L8JM37KsbJT53KzG0SdKtMWuRj1SRMgQNJ qca1JkO2LEnYRKXbcATBA0SIbQ== X-Google-Smtp-Source: APXvYqwZI5pAQHM7oNLjsvSr1JfErucQyrfE3uXYKKaHvwz6Z/r1TT90MNmvIGW2QA3iybkYNk3KuQ== X-Received: by 2002:a17:90a:bb97:: with SMTP id v23mr13649798pjr.84.1570158131891; Thu, 03 Oct 2019 20:02:11 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id m136sm5494178pga.94.2019.10.03.20.02.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Oct 2019 20:02:11 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, xypron.glpk@gmx.de, agraf@csgraf.de Date: Fri, 4 Oct 2019 12:05:23 +0900 Message-Id: <20191004030523.21579-5-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191004030523.21579-1-takahiro.akashi@linaro.org> References: <20191004030523.21579-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3 4/4] efi_loader: disk: install file system protocol to a whole disk X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Currently, a whole disk without any partitions is not associated with EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. So even if it houses some file system, there is a chance that we may not be able to access it, particularly, when accesses are to be attempted after searching that protocol against a device handle. With this patch, EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed to such a disk if part_get_info() shows there is no partition table installed on it. Signed-off-by: AKASHI Takahiro --- lib/efi_loader/efi_disk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index 27329cadb6f1..4e1a1efed7ec 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -329,7 +329,8 @@ static efi_status_t efi_disk_add_dev( diskobj->dp); if (ret != EFI_SUCCESS) return ret; - if (part >= 1 && efi_fs_exists(desc, part)) { + /* partitions or whole disk without partitions */ + if (efi_fs_exists(desc, part)) { diskobj->volume = efi_simple_file_system(desc, part, diskobj->dp); ret = efi_add_protocol(&diskobj->header,