diff mbox series

[<PATCH,v1>,1/9] mmc: core: Add a cap to use long discard size

Message ID 628141610bd44235b0cea04ff110dd4c67027aba.1576540907.git.nguyenb@codeaurora.org (mailing list archive)
State New, archived
Headers show
Series SD card bug fixes | expand

Commit Message

Bao D. Nguyen Dec. 17, 2019, 2:50 a.m. UTC
Add MMC_CAP2_MAX_DISCARD_SIZE cap which allows setting the max
discard size value if needed.
Setting a high value for the max discard size is to fix an issue where
some SD cards take a long time to perform the card format.

Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
---
 include/linux/mmc/host.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Ulf Hansson Dec. 17, 2019, 7:09 a.m. UTC | #1
On Tue, 17 Dec 2019 at 03:52, Bao D. Nguyen <nguyenb@codeaurora.org> wrote:
>
> Add MMC_CAP2_MAX_DISCARD_SIZE cap which allows setting the max
> discard size value if needed.
> Setting a high value for the max discard size is to fix an issue where
> some SD cards take a long time to perform the card format.

Can you please explain elaborate on why the SD card takes a long time
to "format"? What goes on and what takes time, etc.

In any case, it looks wrong to add a host cap to solve this problem.

Kind regards
Uffe


>
> Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
> ---
>  include/linux/mmc/host.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index ba70338..f1a767d 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -348,6 +348,7 @@ struct mmc_host {
>  #define MMC_CAP2_FULL_PWR_CYCLE        (1 << 2)        /* Can do full power cycle */
>  #define MMC_CAP2_HS200_1_8V_SDR        (1 << 5)        /* can support */
>  #define MMC_CAP2_HS200_1_2V_SDR        (1 << 6)        /* can support */
> +#define MMC_CAP2_MAX_DISCARD_SIZE (1 << 8)      /* use max discard, ignoring max_busy_timeout parameter */
>  #define MMC_CAP2_HS200         (MMC_CAP2_HS200_1_8V_SDR | \
>                                  MMC_CAP2_HS200_1_2V_SDR)
>  #define MMC_CAP2_CD_ACTIVE_HIGH        (1 << 10)       /* Card-detect signal active high */
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
diff mbox series

Patch

diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index ba70338..f1a767d 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -348,6 +348,7 @@  struct mmc_host {
 #define MMC_CAP2_FULL_PWR_CYCLE	(1 << 2)	/* Can do full power cycle */
 #define MMC_CAP2_HS200_1_8V_SDR	(1 << 5)        /* can support */
 #define MMC_CAP2_HS200_1_2V_SDR	(1 << 6)        /* can support */
+#define MMC_CAP2_MAX_DISCARD_SIZE (1 << 8)      /* use max discard, ignoring max_busy_timeout parameter */
 #define MMC_CAP2_HS200		(MMC_CAP2_HS200_1_8V_SDR | \
 				 MMC_CAP2_HS200_1_2V_SDR)
 #define MMC_CAP2_CD_ACTIVE_HIGH	(1 << 10)	/* Card-detect signal active high */