linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Jaehoon Chung <jh80.chung@samsung.com>,
	Puthikorn Voravootivat <puthik@chromium.org>
Cc: Chris Ball <chris@printf.net>,
	Seungwon Jeon <tgih.jun@samsung.com>,
	MMC list <linux-mmc@vger.kernel.org>,
	Gwendal Grignou <gwendal@chromium.org>,
	Grant Grundler <grundler@chromium.org>
Subject: Re: [PATCH] dw-mmc: enable trim in eMMC device
Date: Mon, 10 Feb 2014 10:41:06 +0100	[thread overview]
Message-ID: <CAPDyKFpm3+rHVcW05aPdUhjpKj69EXpi0uzyf1aFqEBE_P-a-A@mail.gmail.com> (raw)
In-Reply-To: <52F8507A.4030904@samsung.com>

On 10 February 2014 05:07, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> Hi,
>
> On 02/08/2014 03:39 AM, Puthikorn Voravootivat wrote:
>> Force host to have erase capacity to enable trim or
>> discard feature in supported eMMC device.
>>
>> Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
>> ---
>> In mmc_init_queue() before setting up the discard function, mmc driver
>> will call mmc_can_erase() which will always return 0 because the host
>> erase capacity is not set anywhere. So to enable discard function, we
>> need to add erase capacity to the host.
>>
>>  drivers/mmc/host/dw_mmc.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 55cd110..f47f1c1 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -55,6 +55,8 @@
>>  #define DW_MCI_FREQ_MAX      200000000       /* unit: HZ */
>>  #define DW_MCI_FREQ_MIN      400000          /* unit: HZ */
>>
>> +#define DW_MCI_DEFAULT_CAPS (MMC_CAP_ERASE)
>> +
>
> This define didn't need.
>
>>  #ifdef CONFIG_MMC_DW_IDMAC
>>  #define IDMAC_INT_CLR                (SDMMC_IDMAC_INT_AI | SDMMC_IDMAC_INT_NI | \
>>                                SDMMC_IDMAC_INT_CES | SDMMC_IDMAC_INT_DU | \
>> @@ -2371,6 +2373,8 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
>>               return ERR_PTR(-ENOMEM);
>>       }
>>
>> +     pdata->caps |= DW_MCI_DEFAULT_CAPS;
>> +
> I didn't want to enable by default. If it's possible, how about using dt-file?
> Well, if need to enable by default, just use the "pdata->caps |= MMC_CAPS_ERASE;"

Why not push this one step further; remove MMC_CAPS_ERASE and make it
default enabled for all hosts?

Kind regards
Ulf Hansson

>
> Best Regards,
> Jaehoon Chung
>>       /* find out number of slots supported */
>>       if (of_property_read_u32(dev->of_node, "num-slots",
>>                               &pdata->num_slots)) {
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-02-10  9:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 18:39 [PATCH] dw-mmc: enable trim in eMMC device Puthikorn Voravootivat
2014-02-10  4:07 ` Jaehoon Chung
2014-02-10  9:41   ` Ulf Hansson [this message]
2014-02-10  9:53     ` Jaehoon Chung
2014-02-10 19:53       ` Puthikorn Voravootivat
2014-02-10 22:54 ` [PATCH v2] mmc: " Puthikorn Voravootivat
2014-02-11  2:48   ` 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=CAPDyKFpm3+rHVcW05aPdUhjpKj69EXpi0uzyf1aFqEBE_P-a-A@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=chris@printf.net \
    --cc=grundler@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=jh80.chung@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=puthik@chromium.org \
    --cc=tgih.jun@samsung.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).