Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2909116iog; Mon, 27 Jun 2022 05:33:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tjFfKogpz+slDuRUOEfPDqBJH+eGF3Ac3Lu3jmfpUuc3LMhjiXmIn3hvZqVhF7v3p6aWkZ X-Received: by 2002:a17:907:7747:b0:6f3:ead4:abcb with SMTP id kx7-20020a170907774700b006f3ead4abcbmr12640763ejc.296.1656333230683; Mon, 27 Jun 2022 05:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333230; cv=none; d=google.com; s=arc-20160816; b=xRKWAft61+bf1KufSRxWtIzAae6vaFIbf4yLHOo4ELnX4jY6t2JRbL/ChQO/TmgASm LHgAOnO7pvyB0wtptAtS603QES8KtlxaN9btHmB/dqXBBR4x87rbls88n+wDgpeJxs8K pyMPXYbaWISDvRpdMwPctAwtU0H/YNnuAqdR5ZO+7+Dp051WNWF+LU1CvqoB4mWnEc8Q nqxeBoUkOgH0b23RlXyoHk2EigrUZGHaQIqZa66Xiev0NhPCK7bOxkHCsZ0AnRS/O+sG MZ8YT4p8BESKVc2gn4bX3CgvzFtg51poKYfqJqofvmrseR2eblgIj0yGsMOedi6MTqvz +ZOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=S47yH5gPNLwKv4Pa8OdxzQHaprFYjUnFPhmWfuBWVA8=; b=cK11Maw7XtWC3670D/6nQzG92XpqV0uAhZrDq87TcFbK9r8kP4pzkVDo4WDLsVV2U9 ItI9pdRQae/nzd/g/LD4vQQ2Hztq4DPHsjSwX7bWlvQiE6J9UkRl5tIJpt4lqfNITprC AnMHWAFQlbvy44G7l0p6CuvX4Z+mdJ8yWCe65Zq3gzPK2ueNHdfJM3E8/F7+CAwcv/1u oHHgo+IvW4GW5RdDdnZY8NKdUd7jH5OZjbAoffdSdq26QriYS+ddPHmMv7+1VBAhNFPH oROk8ezsTp3gxwYwGIgxB0tImuwwhcGu0EQmZ/Vha+oGm09utFgWBQNUh88rRi5mYu70 HiHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jC6X9ntV; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7-20020a170906654700b00722ea534186si10676514ejn.248.2022.06.27.05.33.24; Mon, 27 Jun 2022 05:33:50 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=jC6X9ntV; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234567AbiF0LXK (ORCPT + 99 others); Mon, 27 Jun 2022 07:23:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234549AbiF0LXH (ORCPT ); Mon, 27 Jun 2022 07:23:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9469BDE8; Mon, 27 Jun 2022 04:23:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3246061451; Mon, 27 Jun 2022 11:23:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46C64C341CD; Mon, 27 Jun 2022 11:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656328985; bh=uCms7sCXhbllyuq1NDeao1p5ydnZQ1Te9CfA6z5pYAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jC6X9ntV+n2FsVYwnvnBa25DB7XZHKjPHAiz/YTCx6UmauwuYEsq5raliCzfhZO+U SIgJLb+CM14R7vzKEgkFj97GCwYOQVm4FK33V2DJ2Rsi4hlyIZ4ug+LUvrLoCJrT5/ URsjnQlRnju4ikSAY0YafK2SAE4uPphDQjDOIwlE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chevron Li , Ulf Hansson Subject: [PATCH 5.10 013/102] mmc: sdhci-pci-o2micro: Fix card detect by dealing with debouncing Date: Mon, 27 Jun 2022 13:20:24 +0200 Message-Id: <20220627111933.859519094@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111933.455024953@linuxfoundation.org> References: <20220627111933.455024953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Chevron Li commit e591fcf6b4e39335c9b128b17738fcd2fdd278ae upstream. The result from ->get_cd() may be incorrect as the card detect debouncing isn't managed correctly. Let's fix it. Signed-off-by: Chevron Li Fixes: 7d44061704dd ("mmc: sdhci-pci-o2micro: Fix O2 Host data read/write DLL Lock phase shift issue") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220602132543.596-1-chevron.li@bayhubtech.com [Ulf: Updated the commit message] Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-pci-o2micro.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/mmc/host/sdhci-pci-o2micro.c +++ b/drivers/mmc/host/sdhci-pci-o2micro.c @@ -147,6 +147,8 @@ static int sdhci_o2_get_cd(struct mmc_ho if (!(sdhci_readw(host, O2_PLL_DLL_WDT_CONTROL1) & O2_PLL_LOCK_STATUS)) sdhci_o2_enable_internal_clock(host); + else + sdhci_o2_wait_card_detect_stable(host); return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT); }