public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Jaehoon Chung" <jh80.chung@samsung.com>
To: "'Loic Poulain'" <loic.poulain@linaro.org>
Cc: <sjg@chromium.org>, <peng.fan@nxp.com>, <u-boot@lists.denx.de>
Subject: RE: [PATCH v2 2/3] mmc: erase: Use TRIM erase when available
Date: Wed, 8 Feb 2023 18:03:10 +0900	[thread overview]
Message-ID: <000001d93b9c$2b1e8e20$815baa60$@samsung.com> (raw)
In-Reply-To: <CAMZdPi9fNfJ59yF=4HCHz1NX9Efb3CUEfkKsRwEubWj4-MBkFQ@mail.gmail.com>

Hi Loic,

> -----Original Message-----
> From: Loic Poulain <loic.poulain@linaro.org>
> Sent: Wednesday, February 8, 2023 5:09 PM
> To: Jaehoon Chung <jh80.chung@samsung.com>
> Cc: sjg@chromium.org; peng.fan@nxp.com; u-boot@lists.denx.de
> Subject: Re: [PATCH v2 2/3] mmc: erase: Use TRIM erase when available
> 
> Hi Jaehoon,
> 
> On Mon, 6 Feb 2023 at 06:05, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> >
> > Hi,
> >
> > > -----Original Message-----
> > > From: Loic Poulain <loic.poulain@linaro.org>
> > > Sent: Thursday, January 26, 2023 6:24 PM
> > > To: sjg@chromium.org; peng.fan@nxp.com; jh80.chung@samsung.com
> > > Cc: u-boot@lists.denx.de; Loic Poulain <loic.poulain@linaro.org>
> > > Subject: [PATCH v2 2/3] mmc: erase: Use TRIM erase when available
> > >
> > > The default erase command applies on erase group unit, and
> > > simply round down to erase group size. When the start block
> > > is not aligned to erase group size (e.g. erasing partition)
> > > it causes unwanted erasing of the previous blocks, part of
> > > the same erase group (e.g. owned by other logical partition,
> > > or by the partition table itself).
> > >
> > > To prevent this issue, a simple solution is to use TRIM as
> > > argument of the Erase command, which is usually supported
> > > with eMMC > 4.0, and allow to apply erase operation to write
> > > blocks instead of erase group
> > >
> > > Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> > > ---
> > > v2: Add mmc unit test change to the series
> > >
> > >  drivers/mmc/mmc_write.c | 34 +++++++++++++++++++++++-----------
> > >  1 file changed, 23 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c
> > > index 5b7aeeb012..a6f93380dd 100644
> > > --- a/drivers/mmc/mmc_write.c
> > > +++ b/drivers/mmc/mmc_write.c
> > > @@ -15,7 +15,7 @@
> > >  #include <linux/math64.h>
> > >  #include "mmc_private.h"
> > >
> > > -static ulong mmc_erase_t(struct mmc *mmc, ulong start, lbaint_t blkcnt)
> > > +static ulong mmc_erase_t(struct mmc *mmc, ulong start, lbaint_t blkcnt, u32 args)
> > >  {
> > >       struct mmc_cmd cmd;
> > >       ulong end;
> > > @@ -52,7 +52,7 @@ static ulong mmc_erase_t(struct mmc *mmc, ulong start, lbaint_t blkcnt)
> > >               goto err_out;
> > >
> > >       cmd.cmdidx = MMC_CMD_ERASE;
> > > -     cmd.cmdarg = MMC_ERASE_ARG;
> > > +     cmd.cmdarg = args ? args : MMC_ERASE_ARG;
> >
> > It there any case to pass by other value?
> 
> Not at the moment, but it can be used to support eMMC 'Secure Erase' arg.

I had mis-read. I had read the MMC_TRIM_ARG as MMC_ERASE_ARG. Thanks for kindly explanation. :)

Best Regards,
Jaehoon Chung

> 
> Regards,
> Loic


  reply	other threads:[~2023-02-08  9:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230126092431epcas1p49aa1d01605df7cfcf0d2f2a4e5e8600c@epcas1p4.samsung.com>
2023-01-26  9:24 ` [PATCH v2 1/3] mmc: Check support for TRIM operations Loic Poulain
2023-01-26  9:24   ` [PATCH v2 2/3] mmc: erase: Use TRIM erase when available Loic Poulain
2023-01-28 22:01     ` Simon Glass
2023-02-01 11:39       ` Loic Poulain
2023-02-06  5:05     ` Jaehoon Chung
2023-02-08  8:08       ` Loic Poulain
2023-02-08  9:03         ` Jaehoon Chung [this message]
2023-03-10  2:31     ` Jaehoon Chung
2023-01-26  9:24   ` [PATCH v2 3/3] test: dm: mmc: Check block erasing boundaries Loic Poulain
2023-01-27 14:30     ` Simon Glass
2023-02-08  8:13       ` Loic Poulain
2023-03-10  2:32     ` Jaehoon Chung
2023-01-28 22:01   ` [PATCH v2 1/3] mmc: Check support for TRIM operations Simon Glass
2023-02-06  4:54   ` Jaehoon Chung
2023-03-10  2:31   ` Jaehoon Chung

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-all 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='000001d93b9c$2b1e8e20$815baa60$@samsung.com' \
    --to=jh80.chung@samsung.com \
    --cc=loic.poulain@linaro.org \
    --cc=peng.fan@nxp.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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