Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp6742547ioo; Thu, 2 Jun 2022 12:42:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTYlJt9/FEsfZlAcmEaWij2iei/9LyemVe4HEKwJ0rdA3RS9utDhhjNEi2lK65gtlX+ePh X-Received: by 2002:a17:902:c7d1:b0:163:bb03:d5f0 with SMTP id r17-20020a170902c7d100b00163bb03d5f0mr6194041pla.167.1654198947976; Thu, 02 Jun 2022 12:42:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654198947; cv=pass; d=google.com; s=arc-20160816; b=lZ7Vh9y7mswSwWqAmBQKytJicjiN8kdZMA9sBYCPMNX8n9px414Z1o7gzFu3hqWGxA IqqngN19mbs5tnT1ju0dGnUBO4ZjN5b5w+Xa5i0T3NJ66LxdiFIyvA8h1cEa2Ruxqr6d 4DA9IIBYzWMwVU1LZsasRTAxh2rDFv2XDCGzwb33VWhQ6MG8KIDKkxgghPPeW7JPSIUK 7N14qBOsvX4w8ymR97RfsS0/AbeaXnuIsoDXSN0+H0O+x95RPo8m9CiJVFpO5YlLpq/r mDg3plxbhJVXZn0dB0mGkPZKww0mXI2HrwuN1UNkJ/YpGfBmC+6kXZfSmMiClFi45UX4 j3Fg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=K0yn7LcnAQenuZbXMMkAlVyheQfRtZkhhxqtiUKf0Bk=; b=VuLwdSHK0JONaTL1Ix0zNfKkIvae2/bbOPWdBN+5qTewAVtIo1aU/SMLMWx2rtGfzr qPwrflKOzacbMCQRh0kKRQMIsSCucY6/ahzstFMYkHHXh4bRf6c2cgMM96WN+ZhCXp6V BolR69M5C3+bZu+8CxO4e+cQYQwmtE7BooQx4Q0xVXYnfIRXK0kCkFWgmffZk54Duns8 KCSZbuNWUMO7kmS8DUzzgWsko1L+nTidSLh/lnOBumUARA7lXz5TlgyOhHZOmGyDnnC/ 6Vw4icNFlo0ygZzP7Rrm/QF5GVXeelvaCLqnfUisqIwuGsAJ/5Pptc2w4pFT6E9PdGRS rgbg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@towerbridgetechnology.onmicrosoft.com header.s=selector2-towerbridgetechnology-onmicrosoft-com header.b=DTD0rPAg; arc=pass (i=1 spf=pass spfdomain=bayhubtech.com dkim=pass dkdomain=bayhubtech.com dmarc=pass fromdomain=bayhubtech.com); 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pf4-20020a17090b1d8400b001e66ea39810si6712481pjb.37.2022.06.02.12.42.14; Thu, 02 Jun 2022 12:42:27 -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=@towerbridgetechnology.onmicrosoft.com header.s=selector2-towerbridgetechnology-onmicrosoft-com header.b=DTD0rPAg; arc=pass (i=1 spf=pass spfdomain=bayhubtech.com dkim=pass dkdomain=bayhubtech.com dmarc=pass fromdomain=bayhubtech.com); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235312AbiFBN0C (ORCPT + 99 others); Thu, 2 Jun 2022 09:26:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231926AbiFBN0B (ORCPT ); Thu, 2 Jun 2022 09:26:01 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2115.outbound.protection.outlook.com [40.107.93.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC21A28CE84; Thu, 2 Jun 2022 06:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PPzyCXlM3BmiaQupQ2UEy7KdQzQKZAJKkYByqx/J6NzXZV9cnbFG+N1MvNhCLU30pSZqvzSMngNthiRBncbYRb9wxWnDuaL9bmx73fBZM1rUdJ4wZq1VkF+njdacegTnyP7NDmaB75sssrW14zOYZhEBXN/5MKjMW5pHd2mA3D6Ci34nKNToiacuyEBB8I3VMki7iS+xhg0s8iew7ST53GT+jb9DbZJIEZeiQkvvGWBCgHSPnZakLp+Sa2qcOhSM4HjKg2u+6ETnKu6Q/k2n0o2YzlTq0lWCMbW8PwBITjBPtIFH/UTxS5qHLyDuEa4VEYTgVs9wZv7jaQr6eahapQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K0yn7LcnAQenuZbXMMkAlVyheQfRtZkhhxqtiUKf0Bk=; b=SsMPNVMIUhOaEC0W4H78lWvaVc78Pt5l26qHKMCJEdXKnTG5REFOFzmUBVUwCFQcL0vpmwlj8hjQqXthR4Lof46VkAWhAdKWAGKUbmq/eyATxrStODvBOKHi6DI5rSRGnNcbKRDPiAkwFsSxUEEMZQ9kzaKfzDO4NplGmUi9ye1lrRmLhzRBP6HOxxB44OIstozY/Yy9v+3JhXTAcSf3VP80eYeM+WpaR1ifcbssJVtYkq8+G7a+w2EZfLF2rvOYhxjWydlxuskeH30A/zzZfr/sOJ4ScDw0mYS5z544YlShJmy4+Zg6R0R+h0vqEoA3ZtYh6eUeXUhv5f9ftr9psQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bayhubtech.com; dmarc=pass action=none header.from=bayhubtech.com; dkim=pass header.d=bayhubtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=towerbridgetechnology.onmicrosoft.com; s=selector2-towerbridgetechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K0yn7LcnAQenuZbXMMkAlVyheQfRtZkhhxqtiUKf0Bk=; b=DTD0rPAgvelDDM9bb9sLxvARuA3aVPqhDbtzcQC1JLwyKnC10q+rVdcOuUQkjQOKH0XnPysdCf8uSbtpmH2Y94ReQ4XPeLm0ZYSM88n5YUI2Nx3/POaADaL1J6zqHkU3vdzVAmhniWskB7FOctIwwtdg0qbRYBls03yKnJnhnw4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=bayhubtech.com; Received: from PH0PR16MB4248.namprd16.prod.outlook.com (2603:10b6:510:4c::16) by BLAPR16MB3681.namprd16.prod.outlook.com (2603:10b6:208:27f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Thu, 2 Jun 2022 13:25:56 +0000 Received: from PH0PR16MB4248.namprd16.prod.outlook.com ([fe80::e0e1:6026:e3dc:5425]) by PH0PR16MB4248.namprd16.prod.outlook.com ([fe80::e0e1:6026:e3dc:5425%7]) with mapi id 15.20.5314.013; Thu, 2 Jun 2022 13:25:56 +0000 From: Chevron Li To: adrian.hunter@intel.com, ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: shaper.liu@bayhubtech.com, chevron.li@bayhubtech.com, xiaoguang.yu@bayhubtech.com, shirley.her@bayhubtech.com, fred.ai@bayhubtech.com Subject: [PATCH V1 1/1] mmc:sdhci-pci-o2micro:fix card detect issue because card detect debouncing isn't done Date: Thu, 2 Jun 2022 06:25:43 -0700 Message-Id: <20220602132543.596-1-chevron.li@bayhubtech.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: HK2PR02CA0201.apcprd02.prod.outlook.com (2603:1096:201:20::13) To PH0PR16MB4248.namprd16.prod.outlook.com (2603:10b6:510:4c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23cccf78-a567-4dd1-b92e-08da449b6c91 X-MS-TrafficTypeDiagnostic: BLAPR16MB3681:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fBmVCWxqwi/dD6hVDTgEdXJ9RJzIDGL7uaKalZA3Df5aaXXWxuo0Wcpd6uo12Y3mvjkcvn3om/SpkZJiJ/MLdvL7DKyzWP/9pVCAr/7FjGd9EzrD4/FGiGMJJxFZdvFieP/WxNAojwtInOXAK8xCudlkyqiQwCZs2GBmPylPFIYqKOZ8lrDXkGc5K8fbweS8pRT9lF2No/nkaPhEWks2vMLr+6h1nsnfHXvI/+EvTT9tN/DkwLQENHvcEGdirz3EVd7oAsq0wJZJ2DW23IiweTy71VR/y/f5IyKRUiBciRtcDKK1CyDeIYqknS4Nu/GUGCGU8hT/doj9wCT9/SMuO4a6wtlYK3rCqo6/VhyjrkNugwpDJiuYWVDFCNQkJnzIj5FG4PVR/zwvU96D3a6YpUAjIRrIcNPOm/qxueeL1ROh1V5UrZzgPy+wHwxRbNiiGPTPBx1ky2r6Vh8pEDaqtPMwhShU6Tdi4NFDyxx9v/4nSIOKKc1OA+d3Wb0d4gDnoFvGuUiVWFLbhkCfAiotE4hvDeZa+wt92jjpnhD13gtj8S+3TnrbeUUJSVMTSRdATxK4zW3GBn5Hy+aSA5JzchPjo6PpqsmlIYpCBnvX8vSWViRqUPy9YSYBhIvK4+NoOne8NxHdIA2NKoq/fDskCA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR16MB4248.namprd16.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(396003)(136003)(376002)(39830400003)(346002)(366004)(66946007)(66556008)(38100700002)(52116002)(36756003)(4326008)(6506007)(6666004)(8676002)(316002)(86362001)(6512007)(66476007)(8936002)(186003)(41300700001)(1076003)(107886003)(2616005)(508600001)(5660300002)(2906002)(4744005)(44832011)(83380400001)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?r7w3HvXes87AFUlCA9IeZBpEsgkVRH2jO5atFd8LHHXfYxg/lpueXBQhGHtc?= =?us-ascii?Q?fGxJNEGPsiRl6pnOVDA1xGDniUZhoE8Wz8xqDFFGaVgwwylyQpz6UD+wnckS?= =?us-ascii?Q?hi9tCqwymxwMkVdHfvGztq/4Bq1jgSQo0eDxQdbnkKmMq+aLwHsq9WraeAe4?= =?us-ascii?Q?wEB5As/gjfgbIu6aVK3jBVL/9Xqf/hLkjmMa7ThgozUOJmd4ssf7bHuMkI/Y?= =?us-ascii?Q?J9JvXZosw/ZWmhzCwopvk4d7T6WbygvAVY9EYjuv0TgIFaxkuqAt+w/gDQ1A?= =?us-ascii?Q?O2XSj4vVCBDsVZJYgAISV1vsGxRjirKuocdRdO45o2eGNEKL/m4+p+eZyG50?= =?us-ascii?Q?KMhjlIdpM0OcB0OEBRHowRyk4zRI6KP6knSnA3wqKAfbbjxOmpeJ3WRazXi9?= =?us-ascii?Q?wlD70N+CeYYlsfAnHSNA5N3r8+thmF3IkixTSgjpG5A+6m5ueYr8xyovHH5w?= =?us-ascii?Q?ZDRrpbShiHpZuXas9ynyILzyCyEtLvUaLFiZ/OYzeJaPrunf+QUgoRg/Ly2F?= =?us-ascii?Q?bluGmb9HaFbaOh2N7yKoJcibjTYv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BmeowUSQ78+hY1SHI4lNo8ijMn3ZDPJpoPIYD/Xcn/cDOhnjmx+7FU?= =?us-ascii?Q?5g+6eQjDxarj/ciWgUUBpDNX+tCPL0cEKXz5smPuiNNeba0j+GZAiFLb8nQi?= =?us-ascii?Q?gaAMm4V40aR9Un8WLLKp8NitSqQFerKnysGc3I1kAFepbeB4QeTr1F+zA6qc?= =?us-ascii?Q?8k2SpL3pvqqlI+W8FUGH5ZIpr64Xnheme0QUF3aV1sy4zOigzxACSEgBk6dD?= =?us-ascii?Q?QbGB/G4D8qGss1EW+zZ/aTeSmjXqQm0Bnki1iOaAXXFkY8fc/ZgUzuTOOUgj?= =?us-ascii?Q?EeL0mqZen56sYIJk5s6lUvWGcxlGV/teur2FDxlAxelC50En2HltIWSQEvCC?= X-MS-Exchange-AntiSpam-MessageData-1: 8hjg61+eX3tFvwVsbOLTtwt0yvQ9kEmBlVzryayYC7SeOWp6mbhY0kJq X-OriginatorOrg: bayhubtech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23cccf78-a567-4dd1-b92e-08da449b6c91 X-MS-Exchange-CrossTenant-AuthSource: PH0PR16MB4248.namprd16.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 13:25:56.1747 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0a7aae2b-8f2e-44df-ba2f-42de7f93c642 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: E2trXap54wGcwaeI5pS5lHhy12poU8aIJj+P+rdd/2R7yQO/y81o1t+sjVj2gYCe1ktIHXsky8+1gx2aHSBd8nhJUYG+5v41RzOOXh3W5qg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR16MB3681 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 get_cd result is uncorrect during card detect debouncing we need to wait card detect stable before return get_cd result Signed-off-by: Chevron Li --- change in V1: add wait card detect stable logical before return card detect result. --- drivers/mmc/host/sdhci-pci-o2micro.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/host/sdhci-pci-o2micro.c b/drivers/mmc/host/sdhci-pci-o2micro.c index 92c20cb8074a..0d4d343dbb77 100644 --- a/drivers/mmc/host/sdhci-pci-o2micro.c +++ b/drivers/mmc/host/sdhci-pci-o2micro.c @@ -152,6 +152,8 @@ static int sdhci_o2_get_cd(struct mmc_host *mmc) 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); } base-commit: d1dc87763f406d4e67caf16dbe438a5647692395 -- 2.32.0