From patchwork Thu Nov 15 04:58:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 151158 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6553158ljp; Wed, 14 Nov 2018 20:56:08 -0800 (PST) X-Google-Smtp-Source: AJdET5cnd22VditwQVMiq5Gkf3ek/KnZeUE0z82/MXBaii8avbO9kG45isaKBw1n9LUaYi+DS8ah X-Received: by 2002:a50:87d9:: with SMTP id 25mr4533980edz.280.1542257768326; Wed, 14 Nov 2018 20:56:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542257768; cv=none; d=google.com; s=arc-20160816; b=M2c1y2FRnEwv2r1w9ruYfTd1dRJnxqvuyYXqIsAH4EXSNexV1Pa/V7iicjbBYxfdRQ fsN1iKy6eu7fI0IfcTkhQY6rBEdCWstgPAeDPpCA78rl3YTHMx7tPID9GSCgj/UPEDcN mgA7K831JpCOfEuYhdmBMdSPWG7YzwBGU/OMuJlprzFC7Ws8ytN3y8jJBA7E1pfNKBzP 5HF9j4NikQW2Tpc8y2xpdsz3lsr8rSlokdsCim64JJgHHcUcOduRrOW+f26bwyoZzb7J zff2EQsMpcBsNhtL/FeSxOyVTc+ui0BJMIdwdoN5BAz1KKmX7IMMHJD5H5DiMzsh0luE +HfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature; bh=+38lMMeizbsHlrgGnvMSNUtNPk9fLv3I72Jb86526ps=; b=03cEnMGcGe60rT0Mr33CLU3E94xMQyw+TvbfuI3AfJ+8gYp7AJeb2Pcf9udZr62pDg jJSSSm0pe2bIpW50l7gmhpWc4sPXnvuEyHn0Jf1DyjQGBKc6Dcsy0TZfC2Kh5sNXi495 4ygx1/YLcEQQnhUHc9n2r4YEUu3aEZ+re0A0xgdCshQ2UQ6gLk6hzC49OIPFz5lsRynB wJUv/4rDP082ywDeFKQLoh09X4M/1T+Lu965CeCfY/EQI6H8MxRnqQ+A1PaTy8nWoc68 hI7qcV0RWZcFR+TmaNIF2xaR/TxDhQ8duBNivhnN9b8czPw3jOMW9Unv9+TMmKEe8Joc tv7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="dWX6O/ti"; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id m3-v6si7146748ejb.316.2018.11.14.20.56.06; Wed, 14 Nov 2018 20:56:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="dWX6O/ti"; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 24802C224B8; Thu, 15 Nov 2018 04:56:02 +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=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 25262C2216D; Thu, 15 Nov 2018 04:56:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C7FC7C2216D; Thu, 15 Nov 2018 04:55:59 +0000 (UTC) Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) by lists.denx.de (Postfix) with ESMTPS id 4675BC22164 for ; Thu, 15 Nov 2018 04:55:59 +0000 (UTC) Received: by mail-yb1-f174.google.com with SMTP id i17-v6so7851959ybp.13 for ; Wed, 14 Nov 2018 20:55:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nOqggRu8WdVokB9pPPClqrtE6Pj08zxNCNz5yoC9sMc=; b=dWX6O/tiScADWgz8Vgqk1OBY/ck3gcgQ7f67yQADyx+SVqsTe51Z/aEx4e61qoJZRQ p8+puKrNDV4l3g6Q0PX0lJ3PvBcbUekkvS3SLXLVtIFKElZPT6+vT0Vh/rVCPncrYZ0r wmBYAymNv44i8RVHiDYkCy9TWf+AjpX/hyDrY= 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:mime-version :content-transfer-encoding; bh=nOqggRu8WdVokB9pPPClqrtE6Pj08zxNCNz5yoC9sMc=; b=G/bVUuk1O5CG07p7SADkddli+vzs2JeBwoC9WsPk6IU19B7dxk9kY0OhTKO2sVwtG0 TeynrPirVhE+BUmnwQs6w2D0N7m2F8o0JN8dpoOccZxdn9FmggTjbkSzMAszDaxpaQQG stQQWx4zoPJkXbNP1RNosnObIiXRctmbEdxpaAYchn+Pjqw6i0OVC/qbQvR7HkeVnh1w AWf4ppzCQ3JOIPyi7RZTvlmJn+/3kFsN4MYWICm9DxaxzKOSmlA8xsKlOKRaioPr75p4 BacN5tI5+9de1EkihVTe6k7Y2bqw+aqRTTfDyLgiYlpeo7ioGYA+etvpA0FBBRRdAItc WYjw== X-Gm-Message-State: AGRZ1gIsao43ao43Sesc5bOfzmqFgzU9btc4JiVAJEHQlofmnAYBnjqz tMs4+Z7M5bvDKIPV5ft9RKeBhg== X-Received: by 2002:a25:6d44:: with SMTP id i65-v6mr4350800ybc.454.1542257756896; Wed, 14 Nov 2018 20:55:56 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id k190-v6sm6061854ywf.66.2018.11.14.20.55.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 20:55:56 -0800 (PST) From: AKASHI Takahiro To: trini@konsulko.com, agraf@suse.de Date: Thu, 15 Nov 2018 13:58:07 +0900 Message-Id: <20181115045810.28736-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Cc: xypron.glpk@gmx.de, u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 0/3] efi_loader: add removable device support 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" Under the current implementation, any removable device which is attached to the platform will not be recognized after any efi-related command, in particular bootefi, is once executed. This patch set resolves this problem by re-scanning and recreating a disk device list for efi operations. # I didn't run selftest "block device" as I don't know how we can # create a test disk image. # Heinrich, can you provide a script? -Takahiro Akashi Changes in v2 (Nov 15, 2018) * efi_init_obj_list() will never return an error once it has succeeded * add "invalid" flag to efi_disk to indicate that a given device is now in stale state * modify block io protocol and file protocol to honor invalid flag * simplify efi simple file system protocol/file procotol by removing details of an u-boot block device * some function were renamed after Heinrich's comment AKASHI Takahiro (3): efi_loader: export efi_locate_handle() function efi_loader: enumerate disk devices every time efi_loader: remove block device details from efi file cmd/bootefi.c | 17 ++- include/efi_loader.h | 14 ++- lib/efi_loader/efi_boottime.c | 7 +- lib/efi_loader/efi_disk.c | 229 +++++++++++++++++++++++++++++++++- lib/efi_loader/efi_file.c | 21 ++-- 5 files changed, 266 insertions(+), 22 deletions(-)