Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2419250rwb; Mon, 7 Nov 2022 13:05:20 -0800 (PST) X-Google-Smtp-Source: AMsMyM5y04D5i6/UfpMmEs1yUH5/L3FvMc/Io4pgQbYhSoIT1VqeBO4NU6Jk+3ikCRZ8C/ssOIUN X-Received: by 2002:a63:5109:0:b0:470:22e0:d7a4 with SMTP id f9-20020a635109000000b0047022e0d7a4mr20678109pgb.71.1667855119726; Mon, 07 Nov 2022 13:05:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667855119; cv=none; d=google.com; s=arc-20160816; b=nL5tRfzSyHAk4jWbaTDlsDIx1+BEUi0x/DNlyRDUh3QnnqKHZOrJCvJHepJOptv6Wf SCKS51Ig2sTB8qgP0bBw3K66e2rFqhsifHOfCHK2a1d4ku49zOA5bJn0If7PLpNI5xVK Cgeuvr1eKqhQLu4l4BI0cAkBZkWVqh+vKJw7JzDWT+TkjMx2KFVqdPKBnkECW15n9qbl tVlv9Cfp50EIRXsgW5xJp6B7FhiR86ubD/rK/LygoljnvPi/v6j4zBJ9a1mP13PddmeG InK3EpqGycGIVS4fJ/j/+V5c5+hDvqZR1YvcaYwsuMuBfy0zJlfI1kV7teACLs/Qg7LZ ek0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=k/CPP2cwdDGdhfrnlXwHQ/NO9Q58jsLemjM9t2jp4EA=; b=CA0efzTKpFbDxwQMc2Ie9xtW3+6EbGWmP/ufAE17j1j15lXxQJ+t/5jK+qoisQif+g 1dSAjdGzn0h0D5yG8i8XapugZcP72BFGoblSiq5uYkxHO5nUbc//1yS8WhNWOk6UlS3X HO3Eb2w0M8gVIU66o7etDnk/6leGwd9HhjMGfZaNX8rwFlnqs3T9UUTik+zr+WIXvkzm V/DypxB2J/FlJLoju9zM3NObYFPZnDIqxYKbz+c+lTARtjSfS9zN+dSkgGaFNdvUeRmE MyPoZQLpKwMPumxiBkEDWHVZIJTOki9j+eZhLeOc+ui70NNel2XENePXUAOAHFJDSnHJ GJLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x0R6EwqF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d32-20020a634f20000000b00439ce36e9d3si12318074pgb.570.2022.11.07.13.05.07; Mon, 07 Nov 2022 13:05:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x0R6EwqF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232838AbiKGUOV (ORCPT + 92 others); Mon, 7 Nov 2022 15:14:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232943AbiKGUOC (ORCPT ); Mon, 7 Nov 2022 15:14:02 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A77C2B62C for ; Mon, 7 Nov 2022 12:13:55 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id o13so2118207pgu.7 for ; Mon, 07 Nov 2022 12:13:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=k/CPP2cwdDGdhfrnlXwHQ/NO9Q58jsLemjM9t2jp4EA=; b=x0R6EwqFYarF2NtrhuhPxZzLW/aZRfANHzpmffijkvmOtNd9TFuTJdaTON3eAeuFVJ FSbBVTzqoMvnR6NCgN/+sQW/QFrgrdCTb/LEeb+mMJcHkRPe77Bk7sHwkqkTJiCgA8lX mOR/PoqFE6ygzoMN0l4xt+C1C5+0Q5kSrDuB4LKF4fwWgVqurdMpDewqv9yGUFgSQFqI 9AXom6nDsh1uAcVr/fSOmb/SvOgRWpydnALPS8N4g3TrI6i7ckwuIoqDyrrNxr6QFbdh slN11MtYCk0Rf9iFgvu1SzXXQGMp0xKRSDFWd36ulWdJLXLnfTup0CJxAsc0AzcjJJPU D+eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=k/CPP2cwdDGdhfrnlXwHQ/NO9Q58jsLemjM9t2jp4EA=; b=me2SE0by0wG4VgZeutLCCh5r8n3SQbCebX9BzYcECVpLx3AaoBry/tabPQGC1CHCH4 tANIG6INYTn/bRyMzL29zN7FVSlFzsRjvPE0qTIOKZYhkOTeAP/uH3+ATWnHbYtMiP+p YYVuuMsJNGj9slsbah7Py8V8gfTNqkM+CuFNY6PaKvQe042muRE3VbVwESBpTvInGPJ/ 7zvQY+jkiIK7PKEXz2UKw+JvysVL+JNtk/kSnu3q0wMGjnYxAvE8kXnnAwv2knhVuwYL dkk8CS8n6xltmhk1EaV/SywZ4xECLft08uOsrSfFJ6cnSU5mLKpAkF7RAkbiHAL2qjZ7 P4sg== X-Gm-Message-State: ACrzQf0AjPp3Gpu29xFGiK01H3IcdUujdG4WpYrrQvfZptQaHMUFa+1X Bcv7c31+v/SYrjMK1MQjrO0JGPUf48hJFPphrxwb0w== X-Received: by 2002:a63:464d:0:b0:441:5968:cd0e with SMTP id v13-20020a63464d000000b004415968cd0emr46115677pgk.595.1667852035052; Mon, 07 Nov 2022 12:13:55 -0800 (PST) MIME-Version: 1.0 References: <20221104095512.4068-1-chevron.li@bayhubtech.com> In-Reply-To: <20221104095512.4068-1-chevron.li@bayhubtech.com> From: Ulf Hansson Date: Mon, 7 Nov 2022 21:13:18 +0100 Message-ID: Subject: Re: [PATCH V1 1/1] mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout To: Chevron Li Cc: adrian.hunter@intel.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, shaper.liu@bayhubtech.com, xiaoguang.yu@bayhubtech.com, shirley.her@bayhubtech.com, louis.lu@bayhubtech.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 4 Nov 2022 at 10:55, Chevron Li wrote: > > The SD card is recognized failed sometimes when resume from suspend. > Because CD# debounce time too long then card present report wrong. > Finally, card is recognized failed. > > Signed-off-by: Chevron Li Applied for next, thanks! Kind regards Uffe > --- > Change in V1: > Adjust bayhub chip setting for CD# debounce time to minimum value > --- > drivers/mmc/host/sdhci-pci-o2micro.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-pci-o2micro.c b/drivers/mmc/host/sdhci-pci-o2micro.c > index ad457cd9cbaa..bca1d095b759 100644 > --- a/drivers/mmc/host/sdhci-pci-o2micro.c > +++ b/drivers/mmc/host/sdhci-pci-o2micro.c > @@ -32,6 +32,7 @@ > #define O2_SD_CAPS 0xE0 > #define O2_SD_ADMA1 0xE2 > #define O2_SD_ADMA2 0xE7 > +#define O2_SD_MISC_CTRL2 0xF0 > #define O2_SD_INF_MOD 0xF1 > #define O2_SD_MISC_CTRL4 0xFC > #define O2_SD_MISC_CTRL 0x1C0 > @@ -877,6 +878,12 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) > /* Set Tuning Windows to 5 */ > pci_write_config_byte(chip->pdev, > O2_SD_TUNING_CTRL, 0x55); > + //Adjust 1st and 2nd CD debounce time > + pci_read_config_dword(chip->pdev, O2_SD_MISC_CTRL2, &scratch_32); > + scratch_32 &= 0xFFE7FFFF; > + scratch_32 |= 0x00180000; > + pci_write_config_dword(chip->pdev, O2_SD_MISC_CTRL2, scratch_32); > + pci_write_config_dword(chip->pdev, O2_SD_DETECT_SETTING, 1); > /* Lock WP */ > ret = pci_read_config_byte(chip->pdev, > O2_SD_LOCK_WP, &scratch); > > base-commit: ee6050c8af96bba2f81e8b0793a1fc2f998fcd20 > -- > 2.25.1 >