public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jun Nie <jun.nie@linaro.org>
To: Hao Wu <hao.a.wu@intel.com>, edk2-devel@lists.01.org
Cc: Ruiyu Ni <ruiyu.ni@intel.com>, Star Zeng <star.zeng@intel.com>
Subject: Re: [PATCH] MdeModulePkg/EmmcDxe: Use Trim instead of Erase for EraseBlocks
Date: Thu, 10 Aug 2017 11:38:31 +0800	[thread overview]
Message-ID: <6f76e319-ebdb-9300-8224-3b5417e6cc6d@linaro.org> (raw)
In-Reply-To: <20170808020438.14540-1-hao.a.wu@intel.com>

On 2017年08月08日 10:04, Hao Wu wrote:
> The current implementation of the Erase Block Protocol service
> EraseBlocks() uses the erase command. According to spec eMMC Electrical
> Standard 5.1, Section 6.6.9:
> 
> The erasable unit of the eMMC is the "Erase Group"; Erase group is
> measured in write blocks that are the basic writable units of the Device.
> 
> However, code logic in function EmmcEraseBlocks() does not check whether
> the starting logical block address to be erased and/or the size in bytes
> to be erased is aligned with the erase group. Missing such checks will
> erase the data on additional blocks on an eMMC device.
> 
> This commit will use the Trim command instead to perform the block erase
> for eMMC devices. Unlike the Erase command, according to spec eMMC
> Electrical Standard 5.1, Section 6.6.10:
> 
> The Trim operation is similar to the default erase operation described in
> 6.6.9. The Trim function applies the erase operation to write blocks
> instead of erase groups.
> 
> Also, the Trim operation is mandatory for eMMC devices according to spec
> eMMC Electrical Standard 5.1, Chapter 11, Table 220.
> 
> Cc: Star Zeng<star.zeng@intel.com>
> Cc: Ruiyu Ni<ruiyu.ni@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Hao Wu<hao.a.wu@intel.com>

Reviewed-by: Jun Nie <jun.nie@linaro.org>


      reply	other threads:[~2017-08-10  3:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08  2:04 [PATCH] MdeModulePkg/EmmcDxe: Use Trim instead of Erase for EraseBlocks Hao Wu
2017-08-10  3:38 ` Jun Nie [this message]

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=6f76e319-ebdb-9300-8224-3b5417e6cc6d@linaro.org \
    --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