From nobody Tue Nov 26 21:25:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+47049+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47049+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1568066826; cv=none; d=zoho.com; s=zohoarc; b=ZeH8WUhUyO/i+X1ZeL8Oi3G/p79s8qkjIrYq+HwLygL4pv5LKwrzZxyDEfLN8Eu3Nw7elMd0pQW0bOFAwi5dgVevn2iUwtv3nisAUi2h14YcdoAEawwDF0bwStNp33WxrJjsP9r8WbnlzBGEo6yf+LNLXltIQLebPPXuQrqChiE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568066826; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=0jOEkz51h/3KMmX+Vx4ZacSK5FQigglsukSZia+yX8E=; b=QWAArCY+ct0dgLtPBASiTaF/J86xC9DRoptgWngKbLys0b+uKlwpXbdPXFK1bF2Rj0//0e3vNScA9PNODAgnqaEoVBbkgsMjS74zuRL6/qLLwWpH0t5OQYqN6vh45zkTMGAVvshz/xusY/UVYkiIk6UakTAzWPb1WP5JVW0dsnQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47049+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1568066826173741.7266274272329; Mon, 9 Sep 2019 15:07:06 -0700 (PDT) Return-Path: X-Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by groups.io with SMTP; Mon, 09 Sep 2019 08:53:02 -0700 X-Received: by mail-lf1-f65.google.com with SMTP id d10so10922292lfi.0 for ; Mon, 09 Sep 2019 08:53:01 -0700 (PDT) X-Gm-Message-State: APjAAAUU3m9NyAxTRtwcoQKSjXME5fqZowVM6g4/2CuIRqbwXgC7tzVb U1yMDFSc28hRMPx6DiMytPijv0B8J+YAKA== X-Google-Smtp-Source: APXvYqxWSW5zsrngGfU+Ny8SWHhumJ/u7HllkLpV/C7LNEWuq6SjNwEWk96pX/fPYS8X5dI4aHrd4A== X-Received: by 2002:ac2:4a70:: with SMTP id q16mr16914203lfp.4.1568044380350; Mon, 09 Sep 2019 08:53:00 -0700 (PDT) X-Received: from pdkmachine.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id d8sm3221238ljj.59.2019.09.09.08.52.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:52:59 -0700 (PDT) From: Patryk Duda To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, mw@semihalf.com, jsd@semihalf.com, Patryk Duda Subject: [edk2-devel] [edk2-platforms: PATCH 1/2] Marvell/Drivers: MvSpiFlashDxe: Fix sector number obtaining Date: Mon, 9 Sep 2019 17:52:11 +0200 Message-Id: <20190909155212.30338-2-pdk@semihalf.com> In-Reply-To: <20190909155212.30338-1-pdk@semihalf.com> References: <20190909155212.30338-1-pdk@semihalf.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pdk@semihalf.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1568066824; bh=Uwk0xQ5K6Txz2BtxouLjyPQ1STMPyEOGKEYBLFarDBw=; h=Cc:Date:From:Reply-To:Subject:To; b=l9NYZGQ0PxATmO3MjlT5WzgDQn7K1LTiiD0YWzMkMGUzdO1M2uoNvvpzkBnPbL72A9s 1QRLjHNlNHmlAkW+Pl8riwwEct4qJxj4xL9P7LkgRcrBrdtnjYk/F9FG8QzmIksIQHcba 1D/9F0Kz2kBuBsBNNc1W7IzkLisP7hg4LpQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 --- 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/Si= licon/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; =20 SectorSize =3D Slave->Info->SectorSize; - SectorNum =3D ByteCount / SectorSize; + SectorNum =3D (ByteCount / SectorSize) + 1; ToUpdate =3D SectorSize; =20 TmpBuf =3D (UINT8 *)AllocateZeroPool (SectorSize); --=20 2.21.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47049): https://edk2.groups.io/g/devel/message/47049 Mute This Topic: https://groups.io/mt/34085584/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-