From patchwork Tue Oct 10 12:23:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 823810 X-Patchwork-Delegate: agraf@suse.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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="b4YStndf"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yBGc50JBNz9tY3 for ; Tue, 10 Oct 2017 23:28:21 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id C227CC21C8F; Tue, 10 Oct 2017 12:26:35 +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=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 882CAC21DBB; Tue, 10 Oct 2017 12:24:31 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AD1DFC21DCA; Tue, 10 Oct 2017 12:23:56 +0000 (UTC) Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) by lists.denx.de (Postfix) with ESMTPS id 4BF56C21D7E for ; Tue, 10 Oct 2017 12:23:52 +0000 (UTC) Received: by mail-qt0-f196.google.com with SMTP id p1so13136649qtg.2 for ; Tue, 10 Oct 2017 05:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Pg9n/43d9x283IHYp+lwVUfjg9JPCIhBewuKUgQBJiY=; b=b4YStndfp7qDZXGNetrOLMueTvTE0G6Xnh+5eBigbMYtq3EBaT81G49Kkp9YvWRjpT UyTbVa5iuItKFwN5YZxZQUFUIlpZ2GM3f5Kp/PgIoP6skyvNG7Zbea3YCVs20yGYFOYQ HJAcvjJLQsPhP6TgdBudOX5cmStrpVPt5TSS13yjiBClQEOKH4LAuYIXwBwcF1EfvFXo WVuO94ocEDjGeTlyChZ7KwjizaXUXHj+HQhfwhfL/m2+bUg9U2DpYQoa0NvYJpYISBEJ dm9OsbiEXa8qo1xfvnJHKG8OVdgiq683kZcxSTnGp725g9XS0WAnYFUxBhkxd3F419CY IvhQ== 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; bh=Pg9n/43d9x283IHYp+lwVUfjg9JPCIhBewuKUgQBJiY=; b=NNwbDmO8DwC7z9XKpZBVnp3BeSxeQL2uOK41XrbbCEfAU3w6h4bmfEUh+SyHZdFdCI BDOG0slHNa7+lfAgw1zgDQihTIDEpcXnjFGP31XutXx9I093nCQuNWMy5wGJ82kx4BEy FS1unfCEOTA2kJ+1Cz2SSUMuhRJe0VvdPEMZMXrxAoaeJGW18iENKAK1+unQn8S8XBUG mvhc2rU+RRqT8FEzpEfCd1Nx4iFXZ73EhdiwMq7ZRlY/lnB/Khp2+BWwBaA81/DYKUJV +HsLUn1rLNPwM5kBjK/WYvACXlCe4UPmHBmU4A5CN0SoVOeA8UKdg8hPyLuA6Epq84bH zGlA== X-Gm-Message-State: AMCzsaXNXBMZ8goizYizp366+v4mogvrfycDJWJFA1/o4HMIjFGTB4zX hNDKCQiPt6bKnaDQEBe18MYQJ8g3 X-Google-Smtp-Source: AOwi7QA50YyzgY8L9Pd8OwhyeaOx4vohpnO3+pH8HTEtJ7Of1fVFbOqUwPU29+IuwDWPN+brOOOw9g== X-Received: by 10.237.34.56 with SMTP id n53mr19433604qtc.140.1507638230959; Tue, 10 Oct 2017 05:23:50 -0700 (PDT) Received: from localhost ([144.121.20.162]) by smtp.gmail.com with ESMTPSA id f64sm6242951qka.6.2017.10.10.05.23.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2017 05:23:49 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Tue, 10 Oct 2017 08:23:05 -0400 Message-Id: <20171010122309.25313-10-robdclark@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171010122309.25313-1-robdclark@gmail.com> References: <20171010122309.25313-1-robdclark@gmail.com> Cc: Heinrich Schuchardt , Leif Lindholm Subject: [U-Boot] [PATCH 09/11] efi_loader: Fix disk dp's for pre-DM/legacy devices 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This fixes an issue with OpenBSD's bootloader, and I think should also fix a similar issue with grub2 on legacy devices. In the legacy case we were creating disk objects for the partitions, but not also the parent device. Reported-by: Jonathan Gray Signed-off-by: Rob Clark --- lib/efi_loader/efi_disk.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index eb9ce772d1..47b487aa30 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -340,6 +340,8 @@ int efi_disk_register(void) for (i = 0; i < 4; i++) { struct blk_desc *desc; char devname[32] = { 0 }; /* dp->str is u16[32] long */ + disk_partition_t info; + int part = 1; desc = blk_get_devnum_by_type(if_type, i); if (!desc) @@ -349,6 +351,15 @@ int efi_disk_register(void) snprintf(devname, sizeof(devname), "%s%d", if_typename, i); + + /* add devices for each partition: */ + while (!part_get_info(desc, part, &info)) { + efi_disk_add_dev(devname, if_typename, desc, + i, 0, part); + part++; + } + + /* ... and add block device: */ efi_disk_add_dev(devname, if_typename, desc, i, 0, 0); disks++;