public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif.lindholm@linaro.org>
To: Patryk Duda <pdk@semihalf.com>
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
Date: Sat, 28 Sep 2019 23:37:27 +0100	[thread overview]
Message-ID: <20190928223727.GT25504@bivouac.eciton.net> (raw)
In-Reply-To: <20190909155212.30338-2-pdk@semihalf.com>

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 <pdk@semihalf.com>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
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
> 

  reply	other threads:[~2019-09-28 22:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 15:52 [edk2-platforms: PATCH 0/2] Armada 7k8k SPI flash driver improvements Patryk Duda
2019-09-09 15:52 ` [edk2-platforms: PATCH 1/2] Marvell/Drivers: MvSpiFlashDxe: Fix sector number obtaining Patryk Duda
2019-09-28 22:37   ` Leif Lindholm [this message]
2019-09-09 15:52 ` [edk2-platforms: PATCH 2/2] Marvell/Drivers: MvSpiFlashDxe: Implement progress bar Patryk Duda
2019-09-28 22:47   ` Leif Lindholm
2019-09-10  6:23 ` [edk2-platforms: PATCH 0/2] Armada 7k8k SPI flash driver improvements Marcin Wojtas
2019-09-27 14:48   ` Patryk Duda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190928223727.GT25504@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox