From patchwork Wed Apr 20 16:51:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 8893121 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A67729F39A for ; Wed, 20 Apr 2016 16:59:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD00F20114 for ; Wed, 20 Apr 2016 16:59:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1B6520211 for ; Wed, 20 Apr 2016 16:59:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751231AbcDTQ7K (ORCPT ); Wed, 20 Apr 2016 12:59:10 -0400 Received: from mail-bl2on0096.outbound.protection.outlook.com ([65.55.169.96]:30104 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751889AbcDTQ7I (ORCPT ); Wed, 20 Apr 2016 12:59:08 -0400 Received: from BN3PR0301CA0048.namprd03.prod.outlook.com (10.160.152.144) by DM2PR0301MB0720.namprd03.prod.outlook.com (10.160.97.140) with Microsoft SMTP Server (TLS) id 15.1.466.19; Wed, 20 Apr 2016 16:59:06 +0000 Received: from BN1BFFO11FD016.protection.gbl (2a01:111:f400:7c10::1:188) by BN3PR0301CA0048.outlook.office365.com (2a01:111:e400:401e::16) with Microsoft SMTP Server (TLS) id 15.1.466.19 via Frontend Transport; Wed, 20 Apr 2016 16:59:06 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD016.mail.protection.outlook.com (10.58.144.79) with Microsoft SMTP Server (TLS) id 15.1.472.8 via Frontend Transport; Wed, 20 Apr 2016 16:59:05 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u3KGws5Z023885; Wed, 20 Apr 2016 09:59:02 -0700 From: Dong Aisheng To: CC: , , , , , , , Subject: [PATCH 3/3] mmc: core: support hs speed mode if hs200 mode fails Date: Thu, 21 Apr 2016 00:51:32 +0800 Message-ID: <1461171092-30631-3-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461171092-30631-1-git-send-email-aisheng.dong@nxp.com> References: <1461171092-30631-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131056451459308949; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(81166005)(2906002)(47776003)(2950100001)(575784001)(2351001)(50466002)(4326007)(87936001)(48376002)(77096005)(85426001)(92566002)(86362001)(33646002)(5008740100001)(50986999)(76176999)(19580395003)(105606002)(19580405001)(50226001)(36756003)(5003940100001)(106466001)(1096002)(1220700001)(11100500001)(104016004)(110136002)(229853001)(189998001)(6806005)(586003)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0720; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD016; 1:JeCIZvfMVfsuxnGs20abLdYc5/ywIdlqqx3gGHwql3WCIhNkWfWox3+tG7U+EPQkM+I/6Sftgw1OLDqxlefyvgQySIYTFA+Lbs83FAGJuG6aUyRG190z3oUnbBpYJ1aOJdFllhI76cxvb1EHp8l3bS9KIvhTepeu7q+mAysydP836Q4j2WWtWUrbRxPy7mD5fnjV5tlQpSQG3leS9jCUJB6RrsR7/57kgRCxUtqmY36d50S67GMyQE/utroEIiQ8H6FGPy+97JAJzTVNJe31Er6EhkWqGh5kCh0sY+Vgrn7DZTe/ekRVMzfROP+YWqoBZkT2RIY8Ntww/60naPiOubc+19BeT8jQO9eeU6lhZQzn9x1RFY7HYZ281NG7BujdoCd7cugp/P7iO86BQ6tGln9uENGkQWAedV4di7FMsrt/gsvwbjq2WXfj7OZuztQ5v1h3F/ijtotxZUGXUCVY47QgycvvP+jJXB0wHLVsLlt7RDPViMiWba2xTjL9KIfN8mtXn2ZutY8XAMgXPe96EesaFTeD7ma7rvf64/e9s8bR743S/zjd2lb2Qcifckn03JjNWL7WqH1kp4xP4n1g4/d/14fLxILvwzZRRZ3j4/Mt0xC02dy+lXQmZEMBtZ0m MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 3cf8ae32-f7ac-467c-528d-08d3693d1525 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0720; 2:tReLVdrj54TzPCkHLKM1pwzRv2FbLEFaefn2ialpvqHPzlsbzkghGh2vHuU8vrE//MHlvm5q8+ckQT9Scb4kZCQ/Y12kV8qEl+CwxiU2C2rJXir/jl/S834n5R+kcHihFYlwP/KKYtvnbMyEBGFuJgpfK2fhHxoTuOhyihqMUJMAyvzCF5pibMLZVBw3+C6o; 3:ni2VfYUxeDx7ceJ/XWH07hnc4p1FRc8bYYNrRaMnqhoF8TGnavqvR3fR4ios5Yp+oqxcPbq24ortgft7lswv+ZDn4HUAL9lg75CpIlrJ/VBMnKa/niG1+6wbcrQeHlM4JLYHrFopgTlDkjnaMaze2Vbl71tdYUVa3ujj8kgZifzmcOsbVDRzLy+jpqLpYxJoBTQLHip9kUZBlcm0uxeNpPuE34psszyoGKxWjkLgWik= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0720; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0720; 25:8Rxk0R7y1ZwQaoqY/pY0AqYXwzM7y8XKkjk7wefwhcnPm+zleOLQCsmpZx1N8z+UNIkIOwfnohBKIbYdu642H6RBnh7u+ulP8C11J3hVIGPKdoOxCuQSNaRnxLiHq21lIfGe/eLrFWYM+yrYxGeQw0RUSGEGck5gcVpKbGW5BJoJWuWZMdVdNBWmfDlk0+sHWfJrN0uILqA7P1kvQpLV5AX5N/eA1Fwi2uHThuT0kr/6JLTIQrheYqGQi8WI4o3YvhDJ1AzaCT5Zv0WFBJmdoYsTjg/NoyJfMAOEXpfWvkE/RXmO4Zp54mamoGqmYS0zyTnJ2djpEbpu1FReOK7uk5nba3Av4dQzg6Di7+bgt3rFrTbNNaUtVlP8kZveMR7Xi0asAczhn1xuukd5KkXcE9E2+HFGdOl2p3eG0ZS3uKoCjgbG7O9WT2HvS3XRRr0q6Js/LUKwX3iqk4y0k1j1W34+wfHBPBcPPPnTQhn6rDB8tTlOlZUQN2COMBvJ8uGEnwepO0rG+wBRCuCYkM177dm5L1Jt7SvTpor+0y+EJVmdnxHUtgpRFlDV16d3N4UnBGCF0XMcUadivm3dN6NEiLG7BcYhd6PJkw3QpU/xOsP6Z2yzB8ZgQRSKTYF48/dQoZGMsGE90fITRvAcjLtqxQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13017025)(5005006)(13015025)(8121501046)(13024025)(13023025)(3002001)(10201501046)(6055026); SRVR:DM2PR0301MB0720; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0720; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0720; 4:ZpLwCBnZF4Fx9hrcbF67U8agRxWF5sn9wNgQh+ZO382p9SqlqqvOUlD0UovKJzU2+6MdCoFx/682OGyZ9sarOmrrtgOiT90FXhG8Txf0yXcGhCHX1rmnFR8bcizjf0uI7z2eO6hRYMtv14CUpaZYNYVZkobDKUIHUWaXxPgYfEkoxqSHOnV7mo2o64j2N27oVIz8iFq7iGrWuHMluRsCvF8011n04YujzZ+pLu+txRWWFs2oyjtTWW8zmdxBU3PnFtv0xc+EF3uZ8for6p/Avk51rUA5TXn4M099ma7pXur3I7xCeBJ/IHdUwGHj6/NvFaqRo0Hk3HWPD9rQwPaAqIsVkmcn/Luo0pT2EptS8bfZWp3F9iSP1nPU7kc/hNn4FhEiSQSGAi6zQmwY4GGhB02vH76lmmh1oQxR/qC9ljd39fu38HQpnCKC3i1zf/uQtlFpS8Ywr+XchrRe3qcRJQ8531H4ZO6p04pNdcsBsLE= X-Forefront-PRVS: 0918748D70 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0720; 23:vUdOPbgm6TsuvPki3Ph1ObVETbGTpnsMnDoeZkM?= =?us-ascii?Q?auX40kh48vfnUNd1212CGESVc1rvQ5UBAum0JTg81kR6LyQ5Hk3gNj6uV0U3?= =?us-ascii?Q?cDidoEfTDTga67snb9mVq0xadLnS+VqsfuWc8vuJBCJcxfk3sWyQaU2VyYIl?= =?us-ascii?Q?LyUnlTfRWVpWUlFi+J3SQ6STRVtKEB3WABF6aJujNck+V3JriwouuxDS8+4c?= =?us-ascii?Q?k0JnMNYSeD4auDjBft1KB3TsVmX1mtMm1f91XCTi81iJiDrBo7RG7m5iPRLn?= =?us-ascii?Q?7fGpbp050y47uCyL3x+oIVXsj7R9oafWbVgOAt9zWKXkoGeYY6OwpZaz+BG3?= =?us-ascii?Q?BZ3NUuBXK5RJdms/VcWeiGVUh5O48tL9rVyg1mp2iqHGoJzoS7jIMLPo2yNT?= =?us-ascii?Q?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mk0KmnhNO8jNwpveZCYzR8ziNwT+Esj0kNIfx5CzFFsvzYRg==; 24:+5IIquyTq1AogOiFB0dFW3YZntquEus8MUUFDYcK5UGXP1rflHwDJVZ70CBzMtEuIxsVcFaxbXeQzGRI06DubbyHt6/iHLPzyTZD68Q+St4=; 7:z8c+0Gwqg+a6G0tLo1nzF9wnTjLLta4ks9DN0S1iFd0/VSlIgSu8ldK/OwRYRLVoQ2FvFBdwiUIGqPcDWQeIdsiiTF3LgIghsxObafiCKZbLFPm/UW9tgYqWCmw7AjuwCjrQqBwp6sj7u19JK0n2PPUxL/cp+MJrjWYMdnn62KpzTzgyiSKfoaYN84I8Q0N0QKExP5eeuZYTBXUhVGr8H3qflOsMBRnhCf/q42q4v2k= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2016 16:59:05.6032 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0720 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Currently if mmc_select_hs200 mode switch fails, MMC core can only use legacy mode to run the card. Let's retry HS speed mode if HS200 fails. Before the fix: mmc0: mmc_select_hs200 failed, error -74 : switch to mmc0 failed mmc0: new MMC card at address 0001 mmcblk0: mmc0:0001 Q2J55L 7.12 GiB mmcblk0boot0: mmc0:0001 Q2J55L partition 1 2.00 MiB mmcblk0boot1: mmc0:0001 Q2J55L partition 2 2.00 MiB mmcblk0rpmb: mmc0:0001 Q2J55L partition 3 4.00 MiB mmcblk0: p1 p2 After the fix: mmc0: mmc_select_hs200 failed, error -74 mmc0: new DDR MMC card at address 0001 mmcblk0: mmc0:0001 Q2J55L 7.12 GiB mmcblk0boot0: mmc0:0001 Q2J55L partition 1 2.00 MiB mmcblk0boot1: mmc0:0001 Q2J55L partition 2 2.00 MiB mmcblk0rpmb: mmc0:0001 Q2J55L partition 3 4.00 MiB mmcblk0: p1 p2 Signed-off-by: Dong Aisheng --- drivers/mmc/core/mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 55c8201..b573dc7 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1315,7 +1315,8 @@ static int mmc_select_timing(struct mmc_card *card) if (card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS200) err = mmc_select_hs200(card); - else if (card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS) + + if (err && (card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS)) err = mmc_select_hs(card); if (err && err != -EBADMSG)