Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/813648/?format=api
{ "id": 813648, "url": "http://patchwork.ozlabs.org/api/patches/813648/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170913220546.19560-9-robdclark@gmail.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170913220546.19560-9-robdclark@gmail.com>", "list_archive_url": null, "date": "2017-09-13T22:05:31", "name": "[U-Boot,v3,08/21] efi_loader: use proper device-paths for partitions", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "13e6d0da4077b1aed495d0544c680440fb8bcabe", "submitter": { "id": 18760, "url": "http://patchwork.ozlabs.org/api/people/18760/?format=api", "name": "Rob Clark", "email": "robdclark@gmail.com" }, "delegate": { "id": 3400, "url": "http://patchwork.ozlabs.org/api/users/3400/?format=api", "username": "agraf", "first_name": "Alexander", "last_name": "Graf", "email": "agraf@suse.de" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170913220546.19560-9-robdclark@gmail.com/mbox/", "series": [ { "id": 2990, "url": "http://patchwork.ozlabs.org/api/series/2990/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2990", "date": "2017-09-13T22:05:23", "name": "efi_loader: enough UEFI for standard distro boot", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/2990/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/813648/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/813648/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"a6361Evf\"; dkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xswvw1JFdz9sNw\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 08:15:24 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid EF0B5C226EE; Wed, 13 Sep 2017 22:08:46 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id C1F1DC225E3;\n\tWed, 13 Sep 2017 22:07:33 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 473C2C223DA; Wed, 13 Sep 2017 22:06:20 +0000 (UTC)", "from mail-qt0-f195.google.com (mail-qt0-f195.google.com\n\t[209.85.216.195])\n\tby lists.denx.de (Postfix) with ESMTPS id A80D0C225D3\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 22:06:16 +0000 (UTC)", "by mail-qt0-f195.google.com with SMTP id u48so943403qtc.4\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 15:06:16 -0700 (PDT)", "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\tn29sm7019637qta.61.2017.09.13.15.06.13\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 13 Sep 2017 15:06:14 -0700 (PDT)" ], "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,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=LW9yGF0ynYV60VUCYLbdLatJq83GK/GcnBaKAgR139E=;\n\tb=a6361EvfVzvRN8D+upKxv9SI7AJBdjKsFBvIZOMQB8+RiQd/Cqj43RAsTtMFDObLXG\n\tBqkLg2uIhgMhoU3DBGmJ+ZDIxgjDajEQiZ07UxrAX+Vnr8svhB0izadr1FItXU6V89+e\n\tjYFwPh4X6iTu3Aj/m7OhpLep5zBNlZ0h4qvQxfqQrRvunSoo/cZAYTCuJkK1qQqbDu92\n\tvj0FI296HDOqoxf4Nb3ymTdk0fwKaGmel7Yd+IIFs+vxfmCFh0vUcEUrTGWbuzbprC2+\n\tBPmamWhQMxABrfIAicvc36r9f08ZmuoHSvoJuxQQ2KNJ6KpM7pyeGl2osXP0L0De0cZM\n\t6qnw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=LW9yGF0ynYV60VUCYLbdLatJq83GK/GcnBaKAgR139E=;\n\tb=aL5PcT4tJQ+sWtSjbJAR24+0vOZJXVhPoKwJv0JN3i4177aAXdIu2h/e+eOMgYuIF5\n\tcDeiLsWhcFKDmFakQK0JotSpPapiVd+fWWwv68G+EPKcG0uL8wwDmG5+LO0/cAorYHEt\n\tMYo/pbK81icRGgEXMFAXJyXMn0akBoa6AoyvdBNYNAxUpW9/VW1pctnc8fYyBJqoUH6b\n\toBOPms5/5dzELCHkP8kjWrvXpYY9LPFJz6Fz94xPG657DEyKN/30qwztPS/pHGil9zBT\n\tv8axzvO/MLd6MX6Pbiu4OMbvH5nMfgF+ncCHpN5wNchSeNvCwYxAXMFrYx2YqrYiYIWP\n\tWmaw==", "X-Gm-Message-State": "AHPjjUgroXr44P6wki+aahqnB8z6Mk/Th5joqmkELGUos/WjfXQjdHqW\n\tk/b5SxoDaHz5gQy7r2E=", "X-Google-Smtp-Source": "AOwi7QDEZTMmurUOA8TAKjJM5VBd8JKZMehXve+HNR73tbfZRFmiDiYzTHYLmlWeE8aVVMO759Z+PA==", "X-Received": "by 10.200.23.37 with SMTP id w34mr25462498qtj.166.1505340375272; \n\tWed, 13 Sep 2017 15:06:15 -0700 (PDT)", "From": "Rob Clark <robdclark@gmail.com>", "To": "U-Boot Mailing List <u-boot@lists.denx.de>", "Date": "Wed, 13 Sep 2017 18:05:31 -0400", "Message-Id": "<20170913220546.19560-9-robdclark@gmail.com>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170913220546.19560-1-robdclark@gmail.com>", "References": "<20170913220546.19560-1-robdclark@gmail.com>", "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>", "Subject": "[U-Boot] [PATCH v3 08/21] efi_loader: use proper device-paths for\n\tpartitions", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.18", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>" }, "content": "Also, create disk objects for the disk itself, in addition to the\npartitions. (UEFI terminology is a bit confusing, a \"disk\" object is\nreally a partition.) This helps grub properly identify the boot device\nsince it is trying to match up partition \"disk\" object with it's parent\ndevice.\n\nNow instead of seeing devices like:\n\n /File(sdhci@07864000.blk)/EndEntire\n /File(usb_mass_storage.lun0)/EndEntire\n\nYou see:\n\n /ACPI(133741d0,0)/UnknownMessaging(1d)/EndEntire\n /ACPI(133741d0,0)/UnknownMessaging(1d)/HD(0,800,64000,dd904a8c00000000,1,1)/EndEntire\n /ACPI(133741d0,0)/UnknownMessaging(1d)/HD(1,64800,200000,dd904a8c00000000,1,1)/EndEntire\n /ACPI(133741d0,0)/UnknownMessaging(1d)/HD(2,264800,19a000,dd904a8c00000000,1,1)/EndEntire\n /ACPI(133741d0,0)/USB(0,0)/USB(0,0)/USB(0,0)/EndEntire\n /ACPI(133741d0,0)/USB(0,0)/USB(0,0)/USB(0,0)/HD(0,800,60000,38ca680200000000,1,1)/EndEntire\n /ACPI(133741d0,0)/USB(0,0)/USB(0,0)/USB(0,0)/HD(1,61000,155000,38ca680200000000,1,1)/EndEntire\n /ACPI(133741d0,0)/USB(0,0)/USB(0,0)/USB(0,0)/HD(2,20fa800,1bbf8800,38ca680200000000,1,1)/EndEntire\n /ACPI(133741d0,0)/USB(0,0)/USB(0,0)/USB(0,0)/HD(3,1b6800,1f44000,38ca680200000000,1,1)/EndEntire\n\nThis is on a board with single USB disk and single sd-card. The\nUnknownMessaging(1d) node in the device-path is the MMC device,\nbut grub_efi_print_device_path() hasn't been updated yet for some\nof the newer device-path sub-types.\n\nThis patch is inspired by a patch originally from Peter Jones, but\nre-worked to use efi_device_path, so it doesn't much resemble the\noriginal.\n\nSigned-off-by: Rob Clark <robdclark@gmail.com>\n---\n lib/efi_loader/efi_disk.c | 54 +++++++++++++++++++++++++++--------------------\n 1 file changed, 31 insertions(+), 23 deletions(-)", "diff": "diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c\nindex ed06485e33..14f3e020c8 100644\n--- a/lib/efi_loader/efi_disk.c\n+++ b/lib/efi_loader/efi_disk.c\n@@ -28,11 +28,13 @@ struct efi_disk_obj {\n \t/* EFI Interface Media descriptor struct, referenced by ops */\n \tstruct efi_block_io_media media;\n \t/* EFI device path to this block device */\n-\tstruct efi_device_path_file_path *dp;\n+\tstruct efi_device_path *dp;\n+\t/* partition # */\n+\tunsigned part;\n \t/* Offset into disk for simple partitions */\n \tlbaint_t offset;\n \t/* Internal block device */\n-\tconst struct blk_desc *desc;\n+\tstruct blk_desc *desc;\n };\n \n static efi_status_t EFIAPI efi_disk_reset(struct efi_block_io *this,\n@@ -172,26 +174,26 @@ static const struct efi_block_io block_io_disk_template = {\n \n static void efi_disk_add_dev(const char *name,\n \t\t\t const char *if_typename,\n-\t\t\t const struct blk_desc *desc,\n+\t\t\t struct blk_desc *desc,\n \t\t\t int dev_index,\n-\t\t\t lbaint_t offset)\n+\t\t\t lbaint_t offset,\n+\t\t\t unsigned part)\n {\n \tstruct efi_disk_obj *diskobj;\n-\tstruct efi_device_path_file_path *dp;\n-\tint objlen = sizeof(*diskobj) + (sizeof(*dp) * 2);\n \n \t/* Don't add empty devices */\n \tif (!desc->lba)\n \t\treturn;\n \n-\tdiskobj = calloc(1, objlen);\n+\tdiskobj = calloc(1, sizeof(*diskobj));\n \n \t/* Fill in object data */\n-\tdp = (void *)&diskobj[1];\n+\tdiskobj->dp = efi_dp_from_part(desc, part);\n+\tdiskobj->part = part;\n \tdiskobj->parent.protocols[0].guid = &efi_block_io_guid;\n \tdiskobj->parent.protocols[0].protocol_interface = &diskobj->ops;\n \tdiskobj->parent.protocols[1].guid = &efi_guid_device_path;\n-\tdiskobj->parent.protocols[1].protocol_interface = dp;\n+\tdiskobj->parent.protocols[1].protocol_interface = diskobj->dp;\n \tdiskobj->parent.handle = diskobj;\n \tdiskobj->ops = block_io_disk_template;\n \tdiskobj->ifname = if_typename;\n@@ -207,17 +209,6 @@ static void efi_disk_add_dev(const char *name,\n \tdiskobj->media.last_block = desc->lba - offset;\n \tdiskobj->ops.media = &diskobj->media;\n \n-\t/* Fill in device path */\n-\tdiskobj->dp = dp;\n-\tdp[0].dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;\n-\tdp[0].dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH;\n-\tdp[0].dp.length = sizeof(*dp);\n-\tascii2unicode(dp[0].str, name);\n-\n-\tdp[1].dp.type = DEVICE_PATH_TYPE_END;\n-\tdp[1].dp.sub_type = DEVICE_PATH_SUB_TYPE_END;\n-\tdp[1].dp.length = sizeof(*dp);\n-\n \t/* Hook up to the device list */\n \tlist_add_tail(&diskobj->parent.link, &efi_obj_list);\n }\n@@ -236,14 +227,18 @@ static int efi_disk_create_eltorito(struct blk_desc *desc,\n \tif (desc->part_type != PART_TYPE_ISO)\n \t\treturn 0;\n \n+\t/* and devices for each partition: */\n \twhile (!part_get_info(desc, part, &info)) {\n \t\tsnprintf(devname, sizeof(devname), \"%s:%d\", pdevname,\n \t\t\t part);\n \t\tefi_disk_add_dev(devname, if_typename, desc, diskid,\n-\t\t\t\t info.start);\n+\t\t\t\t info.start, part);\n \t\tpart++;\n \t\tdisks++;\n \t}\n+\n+\t/* ... and add block device: */\n+\tefi_disk_add_dev(devname, if_typename, desc, diskid, 0, 0);\n #endif\n \n \treturn disks;\n@@ -271,9 +266,22 @@ int efi_disk_register(void)\n \t uclass_next_device_check(&dev)) {\n \t\tstruct blk_desc *desc = dev_get_uclass_platdata(dev);\n \t\tconst char *if_typename = dev->driver->name;\n+\t\tdisk_partition_t info;\n+\t\tint part = 1;\n \n \t\tprintf(\"Scanning disk %s...\\n\", dev->name);\n-\t\tefi_disk_add_dev(dev->name, if_typename, desc, desc->devnum, 0);\n+\n+\t\t/* add devices for each partition: */\n+\t\twhile (!part_get_info(desc, part, &info)) {\n+\t\t\tefi_disk_add_dev(dev->name, if_typename, desc,\n+\t\t\t\t\t desc->devnum, 0, part);\n+\t\t\tpart++;\n+\t\t}\n+\n+\t\t/* ... and add block device: */\n+\t\tefi_disk_add_dev(dev->name, if_typename, desc,\n+\t\t\t\t desc->devnum, 0, 0);\n+\n \t\tdisks++;\n \n \t\t/*\n@@ -309,7 +317,7 @@ int efi_disk_register(void)\n \n \t\t\tsnprintf(devname, sizeof(devname), \"%s%d\",\n \t\t\t\t if_typename, i);\n-\t\t\tefi_disk_add_dev(devname, if_typename, desc, i, 0);\n+\t\t\tefi_disk_add_dev(devname, if_typename, desc, i, 0, 0);\n \t\t\tdisks++;\n \n \t\t\t/*\n", "prefixes": [ "U-Boot", "v3", "08/21" ] }