From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40783C05027 for ; Wed, 8 Feb 2023 09:03:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DE21A85E65; Wed, 8 Feb 2023 10:03:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="t52J//DH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4694685E65; Wed, 8 Feb 2023 10:03:21 +0100 (CET) Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 94FFB858BF for ; Wed, 8 Feb 2023 10:03:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@samsung.com Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20230208090312epoutp036e9131d0a956bf9449a378189c2cc669~BzfXvkou91414114141epoutp03K for ; Wed, 8 Feb 2023 09:03:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20230208090312epoutp036e9131d0a956bf9449a378189c2cc669~BzfXvkou91414114141epoutp03K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1675846992; bh=cc1uBPQECZOxGl6eUmANiD1AJ+yhTHndvfLweesrCQo=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=t52J//DHVg0VMCmZZFy9ngEwA5urDibT264ugfcGOWhvbPG34uZuyvxwT6xV9bi40 ud4Sf1m0fH8+i0/nmWaRi/N8FDlh1ot85ng9ZlQbhYvruaifado3VuVXPWIk3RlHUk eUycsp1IcEpbC6Aw0SDlKrEU1OoBzezXlfLlihG4= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20230208090312epcas1p42cdb36d9753763c537a92219f2d55067~BzfXiaX_90746307463epcas1p4F; Wed, 8 Feb 2023 09:03:12 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.38.237]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4PBYtl2c7Gz4x9Pw; Wed, 8 Feb 2023 09:03:11 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 8E.2B.55531.F4563E36; Wed, 8 Feb 2023 18:03:11 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20230208090311epcas1p44dc9c627f540e3f030f6bd89f662702c~BzfWYXDMX0793807938epcas1p4N; Wed, 8 Feb 2023 09:03:11 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230208090311epsmtrp2e95cda85ad6efa19ef57b17f0aa1c122~BzfWXpedf3170831708epsmtrp2L; Wed, 8 Feb 2023 09:03:11 +0000 (GMT) X-AuditID: b6c32a35-d9fff7000000d8eb-39-63e3654fe18f Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 0C.CC.05839.E4563E36; Wed, 8 Feb 2023 18:03:10 +0900 (KST) Received: from jh80chung01 (unknown [10.113.111.84]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230208090310epsmtip1e698d07bcfcd19a5106d955748e95e86~BzfWKhVJx1693816938epsmtip1w; Wed, 8 Feb 2023 09:03:10 +0000 (GMT) From: "Jaehoon Chung" To: "'Loic Poulain'" Cc: , , In-Reply-To: Subject: RE: [PATCH v2 2/3] mmc: erase: Use TRIM erase when available Date: Wed, 8 Feb 2023 18:03:10 +0900 Message-ID: <000001d93b9c$2b1e8e20$815baa60$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQNZ9M8D2p33qchsmUm9Zn37MaiP6gJUkl5rAY8hsg4C2fqHXQGh2pjEq4BRUPA= Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphk+LIzCtJLcpLzFFi42LZdljTQNc/9XGywcJrQha/N21mtPix6gur xbct2xgt3u7tZHdg8ZjdcJHF4861PWweZ+/sYPTY+G4HUwBLVLZNRmpiSmqRQmpecn5KZl66 rZJ3cLxzvKmZgaGuoaWFuZJCXmJuqq2Si0+ArltmDtBOJYWyxJxSoFBAYnGxkr6dTVF+aUmq QkZ+cYmtUmpBSk6BaYFecWJucWleul5eaomVoYGBkSlQYUJ2xvXFb9kKbopW7J2b38D4XaCL kZNDQsBEYuOVu+xdjFwcQgI7GCV2LJnCAuF8YpSY9uAGE4TzjVGi5Wg/I0zL01V/WCESexkl 1lzbAdX/klHi7tUvzCBVbAJ6Ev8XLQSyOThEgOyle11BwswCThJ/e3+xgYQ5BQIlvj0qBAkL C7hK9HRtZgexWQRUJA5u2Ac2hVfAUuL3oi0sELagxMmZT1ggxshLbH87hxniHgWJn0+XsYLY IgJ+Etvuv2CHqBGRmN3ZxgxymoTAT3aJtoNTmSAaXICG9rBB2MISr45vYYewpSQ+v9vLBtHQ z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1Cwko2YhGTULScsCRpZVjJKp BcW56bnFhgWGeanlesWJucWleel6yfm5mxjBEaKluYNx+6oPeocYmTgYDzFKcDArifCaHniQ LMSbklhZlVqUH19UmpNafIhRmoNFSZz3QtfJeCGB9MSS1OzU1ILUIpgsEwenVAOTr+9W080r uiKqjdWqJQKvCHpO230iaer3w44v44/+OTrTwtghSMv+5iWzoIfNR7bcrgh+1zHDQlxWPOpW wBHbSS9PPThoIag050dv/+y6jN/L3GP0Jb7pysxKdHIVWH1z9vOt9ifOTjmSM2Fr1L2dvnsm X9ql+uXqteviIcYH9O/9W+16eucjt4ydB48tUy/KvTRnmfq9AFfO818iVpXwNV9SMZv62X93 5sf3Jfu1zlqtLpf+7pF8pNZqQw2ntfn5s1vbyi4//7Alg8VC3mBFhydL6UJRc44ZG5WExBar O506Yrzj5ZEc7jd85yNu7AthbvKov/ogrvaQQ1Nk3mSxSROYt884vCTKcWO4klFGsRJLcUai oRZzUXEiALUQyon/AgAA X-CMS-MailID: 20230208090311epcas1p44dc9c627f540e3f030f6bd89f662702c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230126092432epcas1p1d2769d648de1f55fc772d40ad87901cc References: <20230126092419.534514-1-loic.poulain@linaro.org> <20230126092419.534514-2-loic.poulain@linaro.org> <006701d939e8$93980630$bac81290$@samsung.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi Loic, > -----Original Message----- > From: Loic Poulain > Sent: Wednesday, February 8, 2023 5:09 PM > To: Jaehoon Chung > 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 wrote: > > > > Hi, > > > > > -----Original Message----- > > > From: Loic Poulain > > > 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 > > > 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 > > > --- > > > 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 > > > #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