From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mx.groups.io with SMTP id smtpd.web12.9307.1638519170654954834 for ; Fri, 03 Dec 2021 00:12:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=oZwujFlE; spf=pass (domain: linaro.org, ip: 209.85.214.178, mailfrom: masami.hiramatsu@linaro.org) Received: by mail-pl1-f178.google.com with SMTP id o14so1575321plg.5 for ; Fri, 03 Dec 2021 00:12:50 -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=oZwujFlEartHg6HcjWxdMqQiSdiizzVXmqg2YpLKJwWcKj0R488JdH08NAcoI1Plri rqcKbm/J13aZeUJ0ytNM0gpkD+kl8EFxIwe1V0hdR0xO5S0y5hWdPA4r9XUE0FS8GLpD oCjF53bRigBAg3DajAF5tUxa0MstYU7oj7yuH/bxUHQ0zgKYJpra4MWUcgOlDg+hBPFn aXVcW4IbW3IFZrZVrFUPCN9UyrnOEM8iqtY2Rb7E1jYvX13t8MUQnus4Tmiwx1xP/qgY aLp3kpG/qBkfzkEJc8eSkQI1GlJrfOMoiF4fuVGos0RSvHxWNBArA66+UfRIT8Nja+/p gMAA== 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=Fhc98vk18CQHppdK2lpHtvqdGMNEcrWORgCTRl73g+HjDP1hmmWKQB4dB7X/avvILP EZrffD7AgwNebipi01XfnViS2tSB7sCuDnZm44GVq0mpCtgNXcubtCYLxjaFeKJ2a8F8 1ctPW5xLwjGjDgt6ygoueShekqf12PhYH9vWIOgKcceDQJqSaHqyGIa16hpzKlrCIGmZ mNeFgwn1G4s+S2etRAe/htP5BXtvd6qR2qAWc4rbDM09+kZuJRtnYybRjOZscDy2UQL+ vd09qPer4X8tAa5iffpXKFI0qNcGHN9vEoUv+Y4IWYgIuMg0knm/U2lR6Lu1JyoLHrpH MOFg== X-Gm-Message-State: AOAM531LTpIpT5PxiCRGgY7X3zMZt3FNJ0tbU1aT5umyv23FoZORDEEv Dz6q6oqUJM2IQRx0zz0hY7DHAA== X-Google-Smtp-Source: ABdhPJznwuwWMJYvynUIna4B7VSNtRga+bvbZpmkyeEl1hzN9tZolTuBeY/rd50YRylLuLivur2/Qw== X-Received: by 2002:a17:90a:46c9:: with SMTP id x9mr12444396pjg.183.1638519170202; Fri, 03 Dec 2021 00:12:50 -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 m10sm1648094pgv.75.2021.12.03.00.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 00:12:49 -0800 (PST) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [PATCH v2 4/5] [edk2-platforms] Silicon/SynQuacerPlatformFlashAccessLib: Fix the number of erase blocks Date: Fri, 3 Dec 2021 17:12:47 +0900 Message-Id: <163851916709.1636051.9018442736759044218.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163851913341.1636051.3357297397950801289.stgit@localhost> References: <163851913341.1636051.3357297397950801289.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",