From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Mike Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>,
linux-clk <linux-clk@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Rob Herring <robh+dt@kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Ziji Hu <huziji@marvell.com>, Jimmy Xu <zmxu@marvell.com>,
Jisheng Zhang <jszhang@marvell.com>, Nadav Haklai <nadavh@marvel>
Subject: Re: [PATCH v5 06/12] mmc: sdhci-xenon: Add Marvell Xenon SDHC core functionality
Date: Sat, 28 Jan 2017 10:16:46 +0200 [thread overview]
Message-ID: <00e8d2dc-bc07-addc-a5d9-8604f143627f@intel.com> (raw)
In-Reply-To: <CAPDyKFqbjeKCHp40PALydquxdF-qBk156+iOS9TYYsquJ7fK7w@mail.gmail.com>
On 27/01/2017 5:12 p.m., Ulf Hansson wrote:
> On 26 January 2017 at 13:39, Adrian Hunter <adrian.hunter@intel.com> wrote:
>> On 26/01/17 12:50, Ulf Hansson wrote:
>>> On 11 January 2017 at 18:19, Gregory CLEMENT
>>> <gregory.clement@free-electrons.com> wrote:
>>>> + priv->init_card_type = MMC_TYPE_MMC;
>>>> + mmc->caps |= MMC_CAP_NONREMOVABLE;
>>>> +
>>>> + /*
>>>> + * Force to clear BUS_TEST to
>>>> + * skip bus_test_pre and bus_test_post
>>>> + */
>>>> + mmc->caps &= ~MMC_CAP_BUS_WIDTH_TEST;
>>>> + mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ |
>>>
>>> This cap is a bit strange. It was added several years ago by Adrian
>>> Hunter, but I am wondering about the reason to why it's needed.
>>>
>>
>> MMC_CAP2_HC_ERASE_SZ relates to EXT-CSD ERASE_GROUP_DEF.
>>
>> I think it was added to enable people to choose whether they wanted a large
>> or small erase granularity. That probably doesn't matter if the card
>> supports TRIM.
>>
>
> Huh, the erase/trim/discard code in the mmc core is really hairy. :-)
>
> In mmc_calc_max_discard() the following code/comment exists:
>
> /*
> * Without erase_group_def set, MMC erase timeout depends on clock
> * frequence which can change. In that case, the best choice is
> * just the preferred erase size.
> */
> if (mmc_card_mmc(card) && !(card->ext_csd.erase_group_def & 1))
> return card->pref_erase;
>
>
> This makes me wonder.
>
> So, when we haven't enabled the high capacity erase groups in the
> EXT_CSD register (ext_csd.erase_group_def), we will use the pref_erase
> size.
>
> In the other case, as when having MMC_CAP2_HC_ERASE_SZ set (which will
> set ext_csd.erase_group_def), we will instead do some calculations
> to find out the max discards.
>
> Are you saying that these calculations doesn't matter much - or are
> you saying that we always want to do them?
No, I was saying that if you have TRIM then TRIM is preferred to ERASE so
the erase group size does not come into play when discarding, since ERASE
granularity is erase groups whereas TRIM granularity is sectors.
However ERASE_GROUP_DEF also affects the size of write protect groups.
next prev parent reply other threads:[~2017-01-28 8:16 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-11 17:19 [PATCH v5 00/12] mmc: Add support to Marvell Xenon SD Host Controller Gregory CLEMENT
2017-01-11 17:19 ` [PATCH v5 01/12] clk: apn806: Add eMMC clock to system controller driver Gregory CLEMENT
2017-01-21 0:16 ` Stephen Boyd
2017-01-11 17:19 ` [PATCH v5 02/12] mmc: sdhci: Export sdhci_set_ios() from sdhci.c Gregory CLEMENT
2017-01-11 17:19 ` [PATCH v5 03/12] mmc: sdhci: Export sdhci_start_signal_voltage_switch() in sdhci.c Gregory CLEMENT
2017-01-11 17:19 ` [PATCH v5 04/12] mmc: sdhci: Export sdhci_enable_sdio_irq() from sdhci.c Gregory CLEMENT
2017-01-11 17:19 ` [PATCH v5 05/12] dt: bindings: Add bindings for Marvell Xenon SD Host Controller Gregory CLEMENT
2017-01-13 20:16 ` Rob Herring
2017-01-26 10:49 ` Ulf Hansson
2017-01-27 10:04 ` Gregory CLEMENT
[not found] ` <87fuk4yg1i.fsf-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-01-27 15:36 ` Ulf Hansson
2017-01-27 17:25 ` Gregory CLEMENT
[not found] ` <cover.8527229dae6c124f24c5e637430c2cdc86f80392.1484154449.git-series.gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-01-11 17:19 ` [PATCH v5 06/12] mmc: sdhci-xenon: Add Marvell Xenon SDHC core functionality Gregory CLEMENT
2017-01-26 10:50 ` Ulf Hansson
2017-01-26 12:39 ` Adrian Hunter
2017-01-27 15:12 ` Ulf Hansson
2017-01-28 8:16 ` Adrian Hunter [this message]
2017-01-30 9:10 ` Ulf Hansson
2017-01-30 9:40 ` Adrian Hunter
2017-01-30 10:15 ` Ulf Hansson
2017-01-27 16:39 ` Ziji Hu
2017-01-30 8:41 ` Ulf Hansson
2017-01-30 15:12 ` Ziji Hu
2017-01-11 17:19 ` [PATCH v5 07/12] mmc: sdhci-xenon: Add support to PHYs of Marvell Xenon SDHC Gregory CLEMENT
2017-01-26 11:29 ` Ulf Hansson
2017-01-27 17:10 ` Ziji Hu
2017-01-11 17:19 ` [PATCH v5 08/12] mmc: sdhci-xenon: Add SoC PHY PAD voltage control Gregory CLEMENT
2017-01-11 17:19 ` [PATCH v5 09/12] MAINTAINERS: add entry for Marvell Xenon MMC Host Controller drivers Gregory CLEMENT
2017-01-11 17:19 ` [PATCH v5 10/12] arm64: dts: marvell: add eMMC support for Armada 37xx Gregory CLEMENT
2017-01-11 17:19 ` [PATCH v5 11/12] arm64: dts: marvell: add sdhci support for Armada 7K/8K Gregory CLEMENT
2017-01-11 17:19 ` [PATCH v5 12/12] arm64: configs: enable SDHCI driver for Xenon Gregory CLEMENT
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=00e8d2dc-bc07-addc-a5d9-8604f143627f@intel.com \
--to=adrian.hunter@intel.com \
--cc=andrew@lunn.ch \
--cc=devicetree@vger.kernel.org \
--cc=gregory.clement@free-electrons.com \
--cc=huziji@marvell.com \
--cc=jason@lakedaemon.net \
--cc=jszhang@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=nadavh@marvel \
--cc=robh+dt@kernel.org \
--cc=sboyd@codeaurora.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=ulf.hansson@linaro.org \
--cc=zmxu@marvell.com \
/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;
as well as URLs for NNTP newsgroup(s).