From patchwork Wed Jun 17 18:05:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 6627531 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D21F0C0020 for ; Wed, 17 Jun 2015 18:11:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A1D620654 for ; Wed, 17 Jun 2015 18:11:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 25C8A2085A for ; Wed, 17 Jun 2015 18:11:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5Hlc-000782-TQ; Wed, 17 Jun 2015 18:08:52 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5HlC-0006y2-MJ for linux-arm-kernel@bombadil.infradead.org; Wed, 17 Jun 2015 18:08:26 +0000 Received: from mail-bn1bbn0108.outbound.protection.outlook.com ([157.56.111.108] helo=na01-bn1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5HlA-0005Sh-Gs for linux-arm-kernel@lists.infradead.org; Wed, 17 Jun 2015 18:08:25 +0000 Received: from CY1PR03MB1423.namprd03.prod.outlook.com (10.163.17.145) by CY1PR03MB1453.namprd03.prod.outlook.com (10.163.17.150) with Microsoft SMTP Server (TLS) id 15.1.190.14; Wed, 17 Jun 2015 18:08:01 +0000 Received: from BLUPR0301CA0038.namprd03.prod.outlook.com (10.162.113.176) by CY1PR03MB1423.namprd03.prod.outlook.com (10.163.17.145) with Microsoft SMTP Server (TLS) id 15.1.190.14; Wed, 17 Jun 2015 18:07:59 +0000 Received: from BN1AFFO11FD041.protection.gbl (2a01:111:f400:7c10::193) by BLUPR0301CA0038.outlook.office365.com (2a01:111:e400:5259::48) with Microsoft SMTP Server (TLS) id 15.1.195.15 via Frontend Transport; Wed, 17 Jun 2015 18:07:59 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; lists.infradead.org; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD041.mail.protection.outlook.com (10.58.52.252) with Microsoft SMTP Server (TLS) id 15.1.190.9 via Frontend Transport; Wed, 17 Jun 2015 18:07:58 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t5HI7jAb003611; Wed, 17 Jun 2015 11:07:53 -0700 From: Dong Aisheng To: Subject: [PATCH 1/6] mmc: sdhci-esdhc-imx: fix cd regression for dt platform Date: Thu, 18 Jun 2015 02:05:32 +0800 Message-ID: <1434564337-24720-2-git-send-email-aisheng.dong@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434564337-24720-1-git-send-email-aisheng.dong@freescale.com> References: <1434564337-24720-1-git-send-email-aisheng.dong@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD041; 1:VOUnNAO00thdsjgZU+19Nf+lIxafe/0W0nqEikIpOeCFzhrjAfmu40dkMk1d68OnZbt+SmtQFnojERqUDX+U/kVtmhG61QFd/62pAlI1Kxc9Tf2tDDqvQXUdEuU3GvnzRnwi2GBbynII98JAKWbNMeZIqv4hOp3bDsUYULqsPDCKOMugZ9h62olhRLNnJ40AyXi5ehHI+CM60l6J3SiZix7AUQCGtb3D5DJz9Qgqz1y+7fM9eK8yR3l6GrwmmUvxWxVxv8QRJRv0gWKb1trVZZ9IpyHRTEyw1JdcSiZttvE8oIE5YzUlrArUxUwkl66ZvRxMcKPBDxmy4xJm4lQPwlcb3CYzdXpZVIgGvEX8AeU= X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(6806004)(47776003)(2950100001)(77096005)(85426001)(105606002)(50986999)(92566002)(104016003)(33646002)(76176999)(229853001)(2351001)(106466001)(50466002)(77156002)(62966003)(87936001)(19580405001)(19580395003)(48376002)(575784001)(86362001)(230783001)(5001960100002)(50226001)(46102003)(189998001)(110136002)(36756003)(5001920100001)(81156007); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR03MB1423; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB1423; 2:1kIXfZGZZaYrmxetDEWSRKpek01IT+XTlKEy8omY6p54agJoblf3044MaKPNzKix; 2:2Wbpb6z2au2Az/yQVVmbevEbcFyr+uI3eJcXTNCcWuLlCfo7ugcxFWlb6mOYUCf1gInU6OG6G0Dj4hYOTzu6XOGIyVw3yPVxvjd6l8nUSnc7vOpCRupbHnp7kwsLi2Tl4XyxrYamGYvYXvQ5EWBdge/M9lOELDe8jV3Kl35PR0kYk3YlhSLKSQi4MTZkVnyKn0StciMCtneodcQ3NvxNciVAGkeNdlQkTzJdEDkAbcM=; 6:aQzci9gVKvKp/nOLL1qwJOJJAAZ+MKv4fRZJur0h1wawrAIPBmBG5VauQhWfBt7MauITfl1CL4ZFw7Snjj/ii+r1ONIL0PfpJXQ67TSxetYUA4JF4egDscQ6rzcMuY7CXLUPaLqXoBGuP4qUAW2u9JwRBK3gtcgr2DGW6M3dH0mozj5NxgfMaa635co+7AEjBBDbZHNe8ndZOA7bb1K8nTTUoP79xoesVUqsXgEA5DZ7878Qq+1ShaIMRg2/Ntad+fdTw9SNHB322ldKpA2pKmulDJlqxO21U8429T+6lxXwZ8Qb5zP5usgYDW70W0hOv+kgJpHPom/G/6otYkRJ1w==; 3:yh2H6td1xjXOO4YX7IxmBv0ZIEd2Ond0M8PrEz349KgPFs7FD/ch/9It7m8OU4YsNTrLAi4W8V0VJz2FNik3p5awlCwCiqH0r1YmvZ8NA488pvwLrUbgK8uHyH6l0RY35tt5MHCZITYCr5hO2kA7fe3BJL9fhaYpey2OZXIZhI/nIrusdzhvGRCEFI4/v9+ioFlXMiQwtQT2VKExQIAo9OC8tTUwJqAJUECWf6aMQgUjKMUiqubkJymWRQ/JS5e9Pn+y1TX6J2u9KVrcz4XIT0at2ge4NXN2L0g+SghyBPsjL+PIMS5atNLM36I3hWAR X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:CY1PR03MB1423; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:CY1PR03MB1453; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(520003)(5005006)(3002001); SRVR:CY1PR03MB1423; BCL:0; PCL:0; RULEID:; SRVR:CY1PR03MB1423; X-Forefront-PRVS: 0610D16BBE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB1423; 9:CfUX2G6RzS8Pnc1yCdrjmr3ycQ33m8sXrQeHX3RPY9?= =?us-ascii?Q?59LzLpW/LY1gx2w8pM/Ut3ytNfFJaCmhANUsnqkDSzgds3ateMLT9MBHadJ5?= =?us-ascii?Q?SWVMs55U4qqbS3WNRs38zAUY+XfA/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 1; CY1PR03MB1423; 3:epOv4S9wQbUAy0NaCK/bvBuCOxj539jUb8aiRL640eGaYZwjo9XvBh/HFhGFzVQ3B9chQv2o4fGp7olel1DMc8gQwde2USU830E8aIvF2MAfAcxqJ8RgIuDxkwWRM8QSNRrQ4ZvCb1ex8LjwivjgNQ==; 10:I9KIn+pNY/dk4tLkq8xv7rInonDMdatqOVUwbGKV3OG/r65QKf2xDPxE2SmkYccDj/rWl+d2J0dRZGC3cZVUH4z7CHPlqcQjaDj8+2R+2v0=; 6:WY2pbrccthsZce+QzWY+RFfOsIrGMGn7lozT5zZ1HOZh79gkT41JtYoDjdlvzS8y X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2015 18:07:58.9830 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1423 X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB1453; 2:yX2ajbROJkt60F2PNzFRRqx0RrtCJW7in2OynIRG2WBt91QcSKdsdCCgaFGdwref; 2:o87VH1N9VuDMOX5e0Lx5UV9KsLDT/d3pZ4lou33Ob1yTWbvSNnAbbIcb8Pd298+ltW6eVFRcn5n+7cxp6yopXBmdIHzhZxg5nvH3tfRcrKHxutaihJgeck8SdvQdHgM4LehDpaMEeYpcVnE1IGw5kEAT3xZJlvPKPfitlycbk79NQfOlJDAjIDRVWVq5NBEO5iHuClSzP994YKzZKB1jSVJ0X0NZSW+5/WyBrgwfoC4=; 9:uHx5kI1MsejgTniIOBW192LcklfiZ95SqjIJLRlBtnGBw+mpHE4U67T+F049GwHXv+WoX3F/KR9zJTEi4sB6IuAQlY0cvyIPXL0PkYe3qEsonytFebtrQNQvQ7b7dhGd8m7RqcIkUIxI8D+3MoSoww== X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150617_140824_729987_4FB61A8B X-CRM114-Status: GOOD ( 11.12 ) X-Spam-Score: -1.9 (-) Cc: fabio.estevam@freescale.com, marex@denx.de, ulf.hansson@linaro.org, s.trumtrar@pengutronix.de, smoch@web.de, linux-arm-kernel@lists.infradead.org, robertcnelson@gmail.com, s.hauer@pengutronix.de, chris@printf.net, rabeeh@solid-run.com, troy.kisky@boundarydevices.com, lisovy@gmail.com, hs@denx.de, gwenhael.goavec-merou@armadeus.com, p.zabel@pengutronix.de, rmk+kernel@arm.linux.org.uk, shawn.guo@linaro.org, b29396@freescale.com, tharvey@gateworks.com, LW@KARO-electronics.de, ipaton0@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Current card detect probe process is that when driver finds a valid ESDHC_CD_GPIO, it will clear the quirk SDHCI_QUIRK_BROKEN_CARD_DETECTION which is set by default for all esdhc/usdhc controllers. Then host driver will know there's a valid card detect function. Commit 8d86e4fcccf6 ("mmc: sdhci-esdhc-imx: Call mmc_of_parse()") breaks GPIO CD function for dt platform that it will return directly when find ESDHC_CD_GPIO for dt platform which result in the later wrongly to keep SDHCI_QUIRK_BROKEN_CARD_DETECTION for all dt platforms. Then MMC_CAP_NEEDS_POLL will be used instead even there's a valid GPIO card detect. This patch adds back this function and follows the original approach to clear the quirk if find an valid CD GPIO for dt platforms. Fixes: 8d86e4fcccf6 ("mmc: sdhci-esdhc-imx: Call mmc_of_parse()") Signed-off-by: Dong Aisheng --- drivers/mmc/host/sdhci-esdhc-imx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index faf0cb9..4815391 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -881,6 +881,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, struct esdhc_platform_data *boarddata) { struct device_node *np = pdev->dev.of_node; + int ret; if (!np) return -ENODEV; @@ -917,7 +918,14 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, mmc_of_parse_voltage(np, &host->ocr_mask); /* call to generic mmc_of_parse to support additional capabilities */ - return mmc_of_parse(host->mmc); + ret = mmc_of_parse(host->mmc); + if (ret) + return ret; + + if (!IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc))) + host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; + + return 0; } #else static inline int