All of lore.kernel.org
 help / color / mirror / Atom feed
From: Coly Li <colyli@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org, Vicente Bergas <vicencb@gmail.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH v4] mmc: core: don't set limits.discard_granularity as 0
Date: Fri, 2 Oct 2020 21:35:01 +0800	[thread overview]
Message-ID: <f9386314-f95b-5c66-32f7-0e6be42030b8@suse.de> (raw)
In-Reply-To: <yq1pn60g5r4.fsf@ca-mkp.ca.oracle.com>

On 2020/10/2 20:57, Martin K. Petersen wrote:
> 
> Coly,
> 
>> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
>> index 6c022ef0f84d..350d0cc4ee62 100644
>> --- a/drivers/mmc/core/queue.c
>> +++ b/drivers/mmc/core/queue.c
>> @@ -190,7 +190,7 @@ static void mmc_queue_setup_discard(struct request_queue *q,
>>  	q->limits.discard_granularity = card->pref_erase << 9;
>>  	/* granularity must not be greater than max. discard */
>>  	if (card->pref_erase > max_discard)
>> -		q->limits.discard_granularity = 0;
>> +		q->limits.discard_granularity = SECTOR_SIZE;
>>  	if (mmc_can_secure_erase_trim(card))
>>  		blk_queue_flag_set(QUEUE_FLAG_SECERASE, q);
>>  }
> 

Hi Martin,

> The granularity should probably be set to the logical block size instead
> of SECTOR_SIZE. However, looking at mmc_setup_queue() it doesn't appear
> the logical block size is read from the CSD until after discard has been
> configured. So that will require a bit of code shuffling.
> 

Copied, then let me try to modify mmc_setup_queue() too, and set the
discard_granularity from SECTOR_SIZE to logical block size.

Thanks for the hint.

Coly Li



  reply	other threads:[~2020-10-02 13:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02  1:38 [PATCH v4] mmc: core: don't set limits.discard_granularity as 0 Coly Li
2020-10-02 12:57 ` Martin K. Petersen
2020-10-02 13:35   ` Coly Li [this message]
2020-10-09  6:28 ` Ulf Hansson

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=f9386314-f95b-5c66-32f7-0e6be42030b8@suse.de \
    --to=colyli@suse.de \
    --cc=adrian.hunter@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ulf.hansson@linaro.org \
    --cc=vicencb@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.