From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mx.groups.io with SMTP id smtpd.web11.3155.1636104228334133343 for ; Fri, 05 Nov 2021 02:23:48 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=pLsaVBC6; spf=pass (domain: linaro.org, ip: 209.85.215.169, mailfrom: masami.hiramatsu@linaro.org) Received: by mail-pg1-f169.google.com with SMTP id p8so6566249pgh.11 for ; Fri, 05 Nov 2021 02:23:48 -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 :user-agent:mime-version:content-transfer-encoding; bh=VOj0NVSBpT7XS49pLOxVERbeRbHu7/sK5wrK7AAC1M0=; b=pLsaVBC6vQ25YdaMTZ9ESi9kIcGFtbotW5a/YEQA1mSoQvTjXvr0Dc/WLUpyqa7NQY 26JZumTMoNYIy7t+ORuTt8B24pGyytxQ/Sj9o3D10FSbGej0GShkGmxb8+Jll9+bkQWX rkg0xmtphzOYy6tWZMSbC6mSc6i3JXR5XxWCz+IUBkhbLr1S1hs1185X7MjIpghVtxd2 BLktopWxqBqcPUU46nCjq9vs5P5LSKjtdK2xpXUSpqhRTeAd+fVp/1A4TKADCnZerxGF uxkg9Vk1rlJ4axur+/fpbuNDP7uJfcfC/378bqKVr68SA8kOstfOT+u6lnyeB/qO/OOx nbwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=VOj0NVSBpT7XS49pLOxVERbeRbHu7/sK5wrK7AAC1M0=; b=0biFIs0LkjHsY3N6d6r28ZuoA1CAUTo9xFZiqKmy+//p/E4djhues4KgWKZwv9/kf2 SXHxDYXxcyJug7qpDIz2+PSdrz/Um/5YtpsjdAg+OjjlggkMaVNaFPApW1EFjiIji9F6 /o8BwhmpsrszQU/071MVjFJH8j036cLjtkp7ifCioeUBfckgXccpOsWSJtiMTNSehdFl cBzU3bcQRTMKZrPnS6/+AVdZ/HQvtIQ7zeWC7Gyesb9Xlvk+zkvtt7YbDDoUaW1VVGDq FMF4Sw+7HvdPeYwhz8Y+OrhHdufkVCDOsgu6wcd/bDp9xK+X7dxEP44/ByzW1YjNxb34 G7PA== X-Gm-Message-State: AOAM532tf9dV6klum0pQAGLSWiUqY7iemaihavjFUXdWp7zfqhNn6SZe TWzp22xl4z4x1rLgj/cN0gc/Nw== X-Google-Smtp-Source: ABdhPJwyDc0fPrCPuqWKUfaJ78ME7SAh20dX1IVgIbHbAcT0bGzoPQSrNadD7kkLcE0whSMlWI9Adg== X-Received: by 2002:a63:3348:: with SMTP id z69mr43600465pgz.177.1636104227913; Fri, 05 Nov 2021 02:23:47 -0700 (PDT) Return-Path: Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id v14sm8000353pfu.171.2021.11.05.02.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 02:23:47 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [PATCH 3/5] [edk2-platforms] Silicon/SynQuacerPlatformFlashAccessLib: Fix the number of erase blocks Date: Fri, 5 Nov 2021 18:23:45 +0900 Message-Id: <163610422496.391624.6619000045636196996.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163610419943.391624.9289897029386201296.stgit@localhost> References: <163610419943.391624.9289897029386201296.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Fix the number of erase blocks by rounding up the result. The erase blocks must include the last block covered by the length bytes. Signed-off-by: Masami Hiramatsu Reported-by: Kazuhiko Sakamoto --- .../SynQuacerPlatformFlashAccessLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c index bded74dc4f..ad4021cf59 100644 --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c @@ -283,7 +283,7 @@ PerformFlashWriteWithProgress ( DEBUG ((DEBUG_INFO, "%a: erasing 0x%llx bytes at address %llx (LBA 0x%lx)\n", __FUNCTION__, Length, FlashAddress, Lba)); - Status = Fvb->EraseBlocks (Fvb, Lba, Length / BlockSize, + Status = Fvb->EraseBlocks (Fvb, Lba, (Length + BlockSize - 1) / BlockSize, EFI_LBA_LIST_TERMINATOR); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: Fvb->EraseBlocks () failed - %r\n",