From a8d84f405e84d7d1c3f9b1ea38b037244a28f106 Mon Sep 17 00:00:00 2001 From: tinno18 Date: Fri, 15 Apr 2022 15:53:11 +0800 Subject: [PATCH] Hawaii+ OLED: sim1+sim2+sd fast plugging cause phone hang [Cause of problem] Accoring to the factory's stress test,the system will hang when the sim1+sim2+sd card in quickly insert and remove. the system willreturn to normall after long press in boot keyboard. [Solution] The jitter of Cato is analyzed ,it is found that 200ms dedithering time set in the original is too little We change to 1.5S . after testing, It was found that the change decreased to one in ten thousand. [Side-effect] If you insert the sdcard, will longer 1.3s than old config to see the sdcard icon Change-Id: Iddebb64fcd18e13552ddcd63c2ced79f12693476 Signed-off-by: tinno18 Reviewed-on: https://gerrit.mot.com/2243800 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Ying Shen Reviewed-by: Zonghua Liu Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- drivers/mmc/core/Kconfig | 3 +++ drivers/mmc/core/slot-gpio.c | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/Kconfig b/drivers/mmc/core/Kconfig index 7124b2ba3fa8..a6b06e6967c0 100644 --- a/drivers/mmc/core/Kconfig +++ b/drivers/mmc/core/Kconfig @@ -108,3 +108,6 @@ config MMC_CRYPTO Enabling this makes it possible for the kernel to use the crypto capabilities of the MMC device (if present) to perform crypto operations on data being transferred to/from the device. +config SD_INSERT_DEBOUNCE_DELAY_LONGER + bool "add the debounce time when sdcard insert" + default n diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index f41fec57a7ee..2d8cd55ae2d5 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c @@ -43,7 +43,17 @@ static irqreturn_t mmc_gpio_cd_irqt(int irq, void *dev_id) mmc_hostname(host), present, present?"INSERT":"REMOVAL"); host->trigger_card_event = true; - mmc_detect_change(host, msecs_to_jiffies(ctx->cd_debounce_delay_ms)); + + #ifdef CONFIG_SD_INSERT_DEBOUNCE_DELAY_LONGER + if(present){ + mmc_detect_change(host, msecs_to_jiffies(1500)); + } + else{ + mmc_detect_change(host, msecs_to_jiffies(ctx->cd_debounce_delay_ms)); + } + #else //other project not use this function + mmc_detect_change(host, msecs_to_jiffies(ctx->cd_debounce_delay_ms)); + #endif return IRQ_HANDLED; }