From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web11.26586.1637949138206359316 for ; Fri, 26 Nov 2021 09:52:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20210112.gappssmtp.com header.s=20210112 header.b=lML8JX5k; spf=pass (domain: nuviainc.com, ip: 209.85.221.42, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f42.google.com with SMTP id d24so20339194wra.0 for ; Fri, 26 Nov 2021 09:52:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=I/qVMgStMm3d3H3+M979yPDZJ1mUT8toJdMX4sycNkM=; b=lML8JX5kCSF+K9F2X3LTctMdwQRKLohn+CLhhA9b0K6jEnh/oGUp2YFDfV0tIg0B60 3D2Mpzpzn05f80t67PD20DK8NMUH6XKUn5wD54Rr6KkW+nmJeilLzfo+V842JEYXTF8U i3VgByTuWoU2H9k3pL5Xv1RTWhR3Zggu9D3zVROOaj5dG2SfoCVnAkaC1fixAolIRFlt j1kt+L8oPuja8o0Lf1u5yBqDZFwnXKUNATjzIvGfUHbBoSNUBbGtiL5DZxtmtvXTxP0c mS8tkajby1QDi5wp77rXFuTOJCTkL+3q0dpAdTkARJ0Ogn2aH5tncOl/XBGaWO8JpsE1 DtNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=I/qVMgStMm3d3H3+M979yPDZJ1mUT8toJdMX4sycNkM=; b=vhV5+KtGvt8+2DliRH7Ef9RkeiUj63IRAakrdSj6K/F3hxGvtjhERrBIUFcIyyTyvR CG8yOqc3+9FAJq+hejWGEA6EfU3TljXKFWEkyaojlOyNju/svxrN4duX57Y0gRYmAzpq Rm9R9NlogWgSFB8EZiLrP8t9yBvDEB/ryNuUSxH1N5InVtAi/APVZg4a+RZcOKbGixBb 1Jw/3Ssfqj3oA3pFcVqxJXFGVBPCx2n+p5MklD6fy4iKf58BWOrphmA36HfdOi8uzdFq Q97e9P/wTBh73udxCI1X3DGLjSpEh+lgMNc/myd3vElpRhavBa1tFg26aO/WQuzVCgYS x4DQ== X-Gm-Message-State: AOAM530Ng+THeT6U/OlmDls9dbSwKN4XKijSQBXEBiG38YjwMNQjxE4A PE5lbBXoguACc0HPLdZSTL9/Ww== X-Google-Smtp-Source: ABdhPJxgRGN1UOGCKwAow86Hge6EPcYx3wPU1uGyw4XHxO45C5jN1sqAPdMubrEPgbMf9x5sq1V0Dw== X-Received: by 2002:a5d:4e10:: with SMTP id p16mr15249758wrt.454.1637949136799; Fri, 26 Nov 2021 09:52:16 -0800 (PST) Return-Path: Received: from leviathan (cpc92314-cmbg19-2-0-cust559.5-4.cable.virginm.net. [82.11.186.48]) by smtp.gmail.com with ESMTPSA id x13sm6264036wrr.47.2021.11.26.09.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 09:52:16 -0800 (PST) Date: Fri, 26 Nov 2021 17:52:14 +0000 From: "Leif Lindholm" To: Masami Hiramatsu Cc: Ard Biesheuvel , devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: Re: [PATCH 3/5] [edk2-platforms] Silicon/SynQuacerPlatformFlashAccessLib: Fix the number of erase blocks Message-ID: References: <163610419943.391624.9289897029386201296.stgit@localhost> <163610422496.391624.6619000045636196996.stgit@localhost> MIME-Version: 1.0 In-Reply-To: <163610422496.391624.6619000045636196996.stgit@localhost> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 05, 2021 at 18:23:45 +0900, Masami Hiramatsu wrote: > 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", >