Re: [PATCH v4] mmc: core: don't set limits.discard_granularity as 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);
>  }

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.

-- 
Martin K. Petersen	Oracle Linux Engineering



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux