From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=bTEReEzU; spf=pass (domain: linaro.org, ip: 209.85.128.65, mailfrom: leif.lindholm@linaro.org) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by groups.io with SMTP; Sat, 28 Sep 2019 15:37:32 -0700 Received: by mail-wm1-f65.google.com with SMTP id i16so9447821wmd.3 for ; Sat, 28 Sep 2019 15:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5/3rtjjwmUvZxK5m2RUPvLeS/zX7cJALxD6Suye64AI=; b=bTEReEzUAQajjjZmgnZ68W9lutaxGho84r4ngDSJNnAqk/Ci1bokYVzLjupkicwwP4 VANI9YFrLgzG3AEi6Zpjh4jM9RsxcIYAtStHJuoQYfoI8KQKnkwHGCkFq1PKtx6PAv7A 1TYrgWPK/LeufQI47KqPVah4QezZwfKqjRr65Gg3tXwnhCJbYbGheduw3GLZmpl7GUCH X7m5AxVOqL/bkxegUoprdDK2Gc/lhOSMVaijf3VU9HaiMRe+IMij5ekmJvil9DoSd9J/ QPj/dS/mAvSyUDVaiH7j5FEHOysoWWC4bOJ+CBGorEKzOd+WZHmmgseXk2yK9TwaTdzZ Tnrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5/3rtjjwmUvZxK5m2RUPvLeS/zX7cJALxD6Suye64AI=; b=jf5vdBciiF12wEVRQ7ARxHMXMyMN8G5pNQNVFc4IK/J65mkwl8tctwZKv0zEr4SzAX Wsu7RpDiFcnyov8+X+LX0jiraK31iyFNXuSCwTE4NNVylnTSEcN1wXyXVvZRUJabs3ni 8u8MCENHd/T5IvfSsCnRRZHzEqU1JJZJ8uUnK0IS/NyH3G4zwxs95EwP9xFkQFUO7W+M lnrSfHaYByXoLzaqtILtPQktAkLB4lRTN84rBjKupPxzrLXVzvbeRxS9qai6qx8dczSA DUxjyqPxUp7G+HEUQu66ivMk5Mdo3g6kZSPGizkzPhMPH2+ofbbeFjVcXzYHvASRDv0n QHNw== X-Gm-Message-State: APjAAAU51BVjJfck8dlpVNKepjBSnMVGxsDT9SO3F25kodjuGPcRwbOk beYGp5gR58n+oSwEXAwHH5bN3g== X-Google-Smtp-Source: APXvYqyDmqcpKpM/vSDd1zhrtVRCHChMui6DMxE5TBIwASZ4BzfmfaXQCZwgN2bhgJCtmDSVWp3Ikg== X-Received: by 2002:a7b:c0d4:: with SMTP id s20mr12515537wmh.101.1569710250173; Sat, 28 Sep 2019 15:37:30 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id q22sm7701287wmj.5.2019.09.28.15.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2019 15:37:29 -0700 (PDT) Date: Sat, 28 Sep 2019 23:37:27 +0100 From: "Leif Lindholm" To: Patryk Duda Cc: devel@edk2.groups.io, ard.biesheuvel@linaro.org, mw@semihalf.com, jsd@semihalf.com Subject: Re: [edk2-platforms: PATCH 1/2] Marvell/Drivers: MvSpiFlashDxe: Fix sector number obtaining Message-ID: <20190928223727.GT25504@bivouac.eciton.net> References: <20190909155212.30338-1-pdk@semihalf.com> <20190909155212.30338-2-pdk@semihalf.com> MIME-Version: 1.0 In-Reply-To: <20190909155212.30338-2-pdk@semihalf.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 09, 2019 at 05:52:11PM +0200, Patryk Duda wrote: > This commit fixes bug which was causing one sector of bytes to be > ommited. It was discovered when bytes to be written was 0 in last block, > but total count of bytes was multiplication of sector size. It turned > out that in every case one sector of data was missing. > > This bug can be fixed in various ways, but this solution fixes hypotetical > situation in which total bytes count is smaller than sector size. > > Signed-off-by: Patryk Duda Reviewed-by: Leif Lindholm Pushed as 6e58a613d9aa. Thanks! > --- > Silicon/Marvell/Drivers/Spi/MvSpiFlashDxe/MvSpiFlashDxe.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Silicon/Marvell/Drivers/Spi/MvSpiFlashDxe/MvSpiFlashDxe.c b/Silicon/Marvell/Drivers/Spi/MvSpiFlashDxe/MvSpiFlashDxe.c > index 02bc281c8b..db12adb764 100755 > --- a/Silicon/Marvell/Drivers/Spi/MvSpiFlashDxe/MvSpiFlashDxe.c > +++ b/Silicon/Marvell/Drivers/Spi/MvSpiFlashDxe/MvSpiFlashDxe.c > @@ -388,7 +388,7 @@ MvSpiFlashUpdateWithProgress ( > UINT8 *TmpBuf; > > SectorSize = Slave->Info->SectorSize; > - SectorNum = ByteCount / SectorSize; > + SectorNum = (ByteCount / SectorSize) + 1; > ToUpdate = SectorSize; > > TmpBuf = (UINT8 *)AllocateZeroPool (SectorSize); > -- > 2.21.0 >