From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mx.groups.io with SMTP id smtpd.web11.4124.1639119067660543796 for ; Thu, 09 Dec 2021 22:51:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=RAQ86r2n; spf=pass (domain: linaro.org, ip: 209.85.216.49, mailfrom: masami.hiramatsu@linaro.org) Received: by mail-pj1-f49.google.com with SMTP id gf14-20020a17090ac7ce00b001a7a2a0b5c3so8727173pjb.5 for ; Thu, 09 Dec 2021 22:51:07 -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:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=Se3dtRsnI4g8T2iJO52GLB57I3UHEwqMAVUenINVG7A=; b=RAQ86r2nIg2lS9SHuHuDMmv5DBgcOapmSK8g38hnGz2DQgD4nBkvklKADpbFC4V8xh ASvFfCaTzGVsdXvn6Hv+UQERsNyu4ntDN3/uEvPmxt5NpgNsorPwGfopDKd+BcRGbl51 DNdBLM4mDzSGYZ8sLPIUTYyVqNa1feF4elOzY7OpoNlW3NSS9k5G+Q25CSflKLtcCoV2 KcGCcuKejnonoTVsd4ZSB/6PNZhe+YRUU5PLvI0qLam2IJu3FqINbLgFrXpH6m8IsVT2 5g1u9wNqk0G9Gf+Cz7xsd39EOifVKqQmtisyY6p4rJbLmB/+sVgK/nCWewdxG2e8Svfp G8xA== 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=Se3dtRsnI4g8T2iJO52GLB57I3UHEwqMAVUenINVG7A=; b=ShcXgIkUG/dZaDFNnrt8WUSK3L4c8XExdoxRQ7SZMC8FIHQFDv8JW0RzwItu/egFW2 QFihPCHWgTOWP/rpv4t7B4qviwA5ytiAxfKLZt3Q9pfq/9/k44WlFtm9fgkG+KDlwtfx BGncZx6RC2dsnNt12KsdtniJFPNJA4t/CcmKyOspdTakb0xs+Sqa+U8syycXs+/a2GID GGh5u/Y89vaufn3jhmC0Xiq2AGt1gGSBwO6cYMLbfKqrAOihNTKxjGgKM5P8f35OLhhw 95C9cq/hcOG4pBPbnGrPs046HnzWcirIYcAnL/tj7slFNeGLMbae6ofWwA2uWiRs5IDz s9+A== X-Gm-Message-State: AOAM530e9BFUQyqvemqVGe202ON4plbRzD8Q4Tg5X7lu1+EKC1NhTQSw SDN7aTpKZd3ARrGfFpxbytlyfA== X-Google-Smtp-Source: ABdhPJxES02gsZSH8XZWHydgEEskEqVQ0sQlWylDTyxUC1pFAzyVquzw7iL0Rrk/yyh5/ETxh96N7g== X-Received: by 2002:a17:903:2306:b0:142:123a:24ec with SMTP id d6-20020a170903230600b00142123a24ecmr73621749plh.21.1639119067144; Thu, 09 Dec 2021 22:51:07 -0800 (PST) Return-Path: Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id q2sm1928770pfj.62.2021.12.09.22.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 22:51:06 -0800 (PST) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [PATCH v3 4/6] [edk2-platforms] Silicon/SynQuacerPlatformFlashAccessLib: Fix the number of erase blocks Date: Fri, 10 Dec 2021 15:51:04 +0900 Message-Id: <163911906395.561661.1999317391358075106.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163911902995.561661.9429300579159746333.stgit@localhost> References: <163911902995.561661.9429300579159746333.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 Reviewed-by: Leif Lindholm --- .../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",