[{"id":1769684,"web_url":"http://patchwork.ozlabs.org/comment/1769684/","msgid":"<dac1f204-0eda-d6a7-f292-ec36223770c7@gmx.de>","list_archive_url":null,"date":"2017-09-17T08:21:41","subject":"Re: [U-Boot] [PATCH] efi_loader: fix TEST_PROTOCOL case in\n\tOpenProtocol()","submitter":{"id":61270,"url":"http://patchwork.ozlabs.org/api/people/61270/","name":"Heinrich Schuchardt","email":"xypron.glpk@gmx.de"},"content":"On 09/16/2017 03:26 PM, Rob Clark wrote:\n> In the TEST_PROTOCOL case, protocol_interface might be NULL, and at any\n> rate should not be touched.  So skip efi_protocol_open() in this case.\n> \n> Fixes: \"efi_loader: open_info in OpenProtocol\"\n> Signed-off-by: Rob Clark <robdclark@gmail.com>\n> ---\n>  lib/efi_loader/efi_boottime.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c\n> index 72a0c932a6..f1f0e021b9 100644\n> --- a/lib/efi_loader/efi_boottime.c\n> +++ b/lib/efi_loader/efi_boottime.c\n> @@ -1723,7 +1723,7 @@ efi_status_t EFIAPI efi_open_protocol(\n>  \t}\n>  \n>  \tr = efi_search_protocol(handle, protocol, &handler);\n> -\tif (r != EFI_SUCCESS)\n> +\tif (r != EFI_SUCCESS || attributes == EFI_OPEN_PROTOCOL_TEST_PROTOCOL)\n>  \t\tgoto out;\n>  \n>  \tr = efi_protocol_open(handler, protocol_interface, agent_handle,\n> \n\nThank you for pointing to a problem in my patch\n\nefi_loader: open_info in OpenProtocol\nhttps://patchwork.ozlabs.org/patch/806178/\n\nYour patch makes OpenProtocol conform with this requirement cited from\nthe UEFI spec:\n\n\"TEST_PROTOCOL - Used by a driver to test for the existence of a\nprotocol interface on a handle. Interface is optional for this attribute\nvalue, so it is ignored, and the caller should only use the return\nstatus code. The caller is also not required to close the protocol\ninterface with CloseProtocol()\".\n\nThe last sentence implies that we should not update the\nOpenProtocolInformation for TEST_PROTOCOL. We should put this into a test.\n\nThere are anyway other review comments I have to consider when\nresubmitting my patch series for the protocol services. So I would\nprefer to just integrate this correction into my patch instead of adding\na separate one.\n\nBest regards\n\nHeinrich","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>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xw2DS41cQz9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 17 Sep 2017 18:21:59 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 44A74C21D56; Sun, 17 Sep 2017 08:21:53 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 38595C21D19;\n\tSun, 17 Sep 2017 08:21:50 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 66435C21D19; Sun, 17 Sep 2017 08:21:48 +0000 (UTC)","from mout.gmx.net (mout.gmx.net [212.227.17.22])\n\tby lists.denx.de (Postfix) with ESMTPS id E1D81C21CB3\n\tfor <u-boot@lists.denx.de>; Sun, 17 Sep 2017 08:21:46 +0000 (UTC)","from [192.168.123.31] ([84.118.154.110]) by mail.gmx.com (mrgmx103\n\t[212.227.17.168]) with ESMTPSA (Nemesis) id\n\t0Maa3B-1e9FV81jhp-00K8Xu; Sun, 17 Sep 2017 10:21:43 +0200"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_LOW,\n\tRCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","To":"Rob Clark <robdclark@gmail.com>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","References":"<20170916132610.7939-1-robdclark@gmail.com>","From":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Message-ID":"<dac1f204-0eda-d6a7-f292-ec36223770c7@gmx.de>","Date":"Sun, 17 Sep 2017 10:21:41 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170916132610.7939-1-robdclark@gmail.com>","Content-Language":"en-US","X-Provags-ID":"V03:K0:OK4Kd5MRbh7n4f3Ec8AdIozfx6lNhURDSyCKi/QHtduafePvwfU\n\tEEAERvo4G96tThjl+2M7vl+X+lP6L3NIeNghvw8sEBMuFe3oqnM2Q1xEIeYkVZbqpvWZJEh\n\toDpriaRckti55gBi55eW+x3o5in3/MqOjkWjqO81BSt4c0fm5/wtvxZK//SwWpGvGr7BhJd\n\tAiwD6/EeQhdg4V6PVlWjQ==","X-UI-Out-Filterresults":"notjunk:1; V01:K0:6BYpjKVIFQ8=:ngcLbR7ff6EmlzJpU2H1Eu\n\twFSNC5GkxjrKKWacnwdUAojWV+NBgbOrrBsTR9IMh1lOOW0a8oy22VtqjhbjDNgSXoS37M920\n\te54Qk0Zjwgf8b6bzQQ356R3UOZ6DFZK5Ivt3VQY1sHH/heEQQkoELLEahsND3ziMp7wUDs7Jv\n\tSn4KUoPqMQ6SLVVdPcSJYYEDLrPoliGSxZTnzFIkoxOZHqkveUV6k2kPHk30XQOSu0vZ8tjJn\n\tGck/XBYt6Kx+2zzWhrZTT9KFRaPNe1WW3igDx38r1FD9eig99kOcFlDPlofGxV/hE0x3iVAhR\n\tcBpjKtphciNuAT3mSP5iffH8uAfOhDrNoQ6E4ljrq0LlfutgszfCdt4Mi5kkgB05T57Zi9Wsx\n\t0EoO9w9EKVFV+0faFbeyFvP56nS3o0Pyr8+KyRUEhUkOfTn6FAlxP490cVJ71cOQHLbJflBoU\n\tJinGJlorQtJ/ZbgnMONrrHtbwXzsbiPK18Ag4E2d6oX+6pyIyUTpJ/RkSn2dDWSdVM4WWwtXO\n\tJxe54XXqx8CYuMszlabnYbmesle2scquvLtJE5IXzAxYtPEoCcLmBAbV7JtTDJfuh2qv702pg\n\tfBL6/NTt6jY/X5oJ7vIYn0noXFCqVA53wk1XtaXPiAfiE+VpyX40kB9gsYX6eCmGrmeXRrA3g\n\t/kf0ejX+i4X6Kof89sbvKWnaUlysFBIjMPdbzaFLu7IYXEuc23EEVoO3hfABvzBfqUjSNLvOn\n\t2r8IadGzm2NbxuLO+t4aQ3p2gNzegaXH9JpzdacyZJjnbeql96EsPmeJ/aQYv8770IEoSu1Pj\n\taxaQyJ6z2TNGg3hP5dtfh2cGAduhTdbDa+EKMCtM4gYoyVBKck=","Subject":"Re: [U-Boot] [PATCH] efi_loader: fix TEST_PROTOCOL case in\n\tOpenProtocol()","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>","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>"}},{"id":1769691,"web_url":"http://patchwork.ozlabs.org/comment/1769691/","msgid":"<CAF6AEGvYBcALA=FfwVPr15Q32Me+dZ+s9NUbYf_1+97f1DMTZw@mail.gmail.com>","list_archive_url":null,"date":"2017-09-17T10:32:08","subject":"Re: [U-Boot] [PATCH] efi_loader: fix TEST_PROTOCOL case in\n\tOpenProtocol()","submitter":{"id":18760,"url":"http://patchwork.ozlabs.org/api/people/18760/","name":"Rob Clark","email":"robdclark@gmail.com"},"content":"On Sun, Sep 17, 2017 at 4:21 AM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:\n> On 09/16/2017 03:26 PM, Rob Clark wrote:\n>> In the TEST_PROTOCOL case, protocol_interface might be NULL, and at any\n>> rate should not be touched.  So skip efi_protocol_open() in this case.\n>>\n>> Fixes: \"efi_loader: open_info in OpenProtocol\"\n>> Signed-off-by: Rob Clark <robdclark@gmail.com>\n>> ---\n>>  lib/efi_loader/efi_boottime.c | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c\n>> index 72a0c932a6..f1f0e021b9 100644\n>> --- a/lib/efi_loader/efi_boottime.c\n>> +++ b/lib/efi_loader/efi_boottime.c\n>> @@ -1723,7 +1723,7 @@ efi_status_t EFIAPI efi_open_protocol(\n>>       }\n>>\n>>       r = efi_search_protocol(handle, protocol, &handler);\n>> -     if (r != EFI_SUCCESS)\n>> +     if (r != EFI_SUCCESS || attributes == EFI_OPEN_PROTOCOL_TEST_PROTOCOL)\n>>               goto out;\n>>\n>>       r = efi_protocol_open(handler, protocol_interface, agent_handle,\n>>\n>\n> Thank you for pointing to a problem in my patch\n>\n> efi_loader: open_info in OpenProtocol\n> https://patchwork.ozlabs.org/patch/806178/\n>\n> Your patch makes OpenProtocol conform with this requirement cited from\n> the UEFI spec:\n>\n> \"TEST_PROTOCOL - Used by a driver to test for the existence of a\n> protocol interface on a handle. Interface is optional for this attribute\n> value, so it is ignored, and the caller should only use the return\n> status code. The caller is also not required to close the protocol\n> interface with CloseProtocol()\".\n>\n> The last sentence implies that we should not update the\n> OpenProtocolInformation for TEST_PROTOCOL. We should put this into a test.\n>\n> There are anyway other review comments I have to consider when\n> resubmitting my patch series for the protocol services. So I would\n> prefer to just integrate this correction into my patch instead of adding\n> a separate one.\n\nSure, it's fine by me if you just want to squash this into your patch\n\nBR,\n-R","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=\"hR2Vza1u\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xw56t1DxWz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 17 Sep 2017 20:32:22 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid E9EF7C21E0E; Sun, 17 Sep 2017 10:32:16 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 7CD9EC21C62;\n\tSun, 17 Sep 2017 10:32:13 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid D5826C21C62; Sun, 17 Sep 2017 10:32:11 +0000 (UTC)","from mail-lf0-f67.google.com (mail-lf0-f67.google.com\n\t[209.85.215.67])\n\tby lists.denx.de (Postfix) with ESMTPS id 86D15C21C39\n\tfor <u-boot@lists.denx.de>; Sun, 17 Sep 2017 10:32:09 +0000 (UTC)","by mail-lf0-f67.google.com with SMTP id c8so3177252lfe.2\n\tfor <u-boot@lists.denx.de>; Sun, 17 Sep 2017 03:32:09 -0700 (PDT)","by 10.46.41.75 with HTTP; Sun, 17 Sep 2017 03:32:08 -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=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=/vjnRwTis8lenIN2RNeSnYmJx84gNfJ4QYks1ItDOXQ=;\n\tb=hR2Vza1uUPfW5ReGNWh/8a/A7JFJtFns38XdMTZKVRlFkTMYeii7nKXgTIScSu3G/R\n\tzCycKneT+OgDEvXcEZYOAYLtRK6bpHIAEp/jz5RwuxiQ/ysqNwEoPJmR6XXrZsYvEmM1\n\tGYqGQd6QAjtbF/T+i+iyWKR3XxOa62JLTOHf/PXm6XwyN0RW2R6/JcsSMS6Tk2DE9Bih\n\tDCqk+e0MwXZRP3y+RJfQgau2O8sBKHKH0EoV378v8qpqfL2nWVAmwGlmACabFqagW5Sc\n\tiijXPtQoolE8D4+bo97Gwk7YfpB3hvs8dTfnY+MXflWM1ojp72D7iKyLZE9Nv4+jAfZK\n\th4/g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=/vjnRwTis8lenIN2RNeSnYmJx84gNfJ4QYks1ItDOXQ=;\n\tb=UsoQ+GCA0q+lTIdRiFUGid+rkmIJt46f+7lzvkl4s5ovWZIxUa6E5CQAOnSVX7lDr8\n\trcuJ8vzUfMQL0KnX/btam06VSmvQE3Jj8XaIcpZAkkxPgc75v7i1PbwUnTxtvEtrvbzq\n\tvlqD7mxQyX6glMKucnPFFuh/djNFvlidqZqilqLPTgs+LkLthoRFeWhhJim1xzQHw3ih\n\tOicykEawqXeCcX4djdmG9p4bBeRmoy63tNfUnOcEO0/ITlxKrex/jEUjWDVcsX4iE8dj\n\tJJr7qDi+4EiS5BJKHFG4IQ5v/eJK0ZcVo0fdl1f/S2OX7Nh+I/+NYHQ7bwD0vyRrqyyG\n\tYGtw==","X-Gm-Message-State":"AHPjjUgr7wpC4bgAE73bSzuaP2CEGAaKAh59EoUAXxhVJo/PNWe3BCG/\n\toudzf+csIbsx4rBzITq8Bu6FAd4VnPJ+/2wKYfc=","X-Google-Smtp-Source":"AOwi7QBP+Tgf6Eu4ZRFWeeZlF34vjR75x3Z7qPW3jw4rlGCy6kNI43AUyJFRLW+5BrtC/1YX7i/I7DvVvZjf9Fn8vvo=","X-Received":"by 10.25.41.147 with SMTP id p141mr2325060lfp.56.1505644328954; \n\tSun, 17 Sep 2017 03:32:08 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<dac1f204-0eda-d6a7-f292-ec36223770c7@gmx.de>","References":"<20170916132610.7939-1-robdclark@gmail.com>\n\t<dac1f204-0eda-d6a7-f292-ec36223770c7@gmx.de>","From":"Rob Clark <robdclark@gmail.com>","Date":"Sun, 17 Sep 2017 06:32:08 -0400","Message-ID":"<CAF6AEGvYBcALA=FfwVPr15Q32Me+dZ+s9NUbYf_1+97f1DMTZw@mail.gmail.com>","To":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [PATCH] efi_loader: fix TEST_PROTOCOL case in\n\tOpenProtocol()","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>","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>"}}]