From patchwork Wed Mar 15 02:54:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 9624737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC8C460522 for ; Wed, 15 Mar 2017 02:54:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE35028503 for ; Wed, 15 Mar 2017 02:54:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2CBC285EC; Wed, 15 Mar 2017 02:54:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C78328527 for ; Wed, 15 Mar 2017 02:54:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751121AbdCOCyO (ORCPT ); Tue, 14 Mar 2017 22:54:14 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:28319 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751036AbdCOCyN (ORCPT ); Tue, 14 Mar 2017 22:54:13 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 15 Mar 2017 11:54:10 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 7C74C6DDA2; Wed, 15 Mar 2017 11:54:10 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 50BBF48014; Wed, 15 Mar 2017 11:54:10 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 4F900480A8; Wed, 15 Mar 2017 11:54:10 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id MAB08169; Wed, 15 Mar 2017 11:54:10 +0900 X-IronPort-AV: E=Sophos;i="5.36,166,1486393200"; d="scan'208";a="237538017" Received: from mail-sg2apc01lp0239.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.239]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 15 Mar 2017 11:54:09 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3Wika83e61VRovJcBDMqM6QX5XNY4KHNCVwtD6/21nY=; b=RYKY8ww53hhwO/ff2YZw8Uu/LJSSQomeZvMrBOTWuNb0rdRBzZfi23CNdOKD5W9Ysn8J37dlvMpaI21JVsHYvDXBJZGPNQzjorl9NS0WFNXqcnspfaSI2oMBlbZ0UMi8y3wjbzCau/lIJPmOU5gQPZzXUn9OXQbPtU4IJHfXnUI= Received: from PS1PR06MB1692.apcprd06.prod.outlook.com (10.167.53.14) by PS1PR06MB1691.apcprd06.prod.outlook.com (10.167.53.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.17; Wed, 15 Mar 2017 02:54:07 +0000 Received: from PS1PR06MB1692.apcprd06.prod.outlook.com ([10.167.53.14]) by PS1PR06MB1692.apcprd06.prod.outlook.com ([10.167.53.14]) with mapi id 15.01.0961.022; Wed, 15 Mar 2017 02:54:07 +0000 From: Yoshihiro Shimoda To: Wolfram Sang CC: Wolfram Sang , "linux-mmc@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , Simon Horman Subject: RE: [PATCH] mmc: core: check also R1 response for stop commands Thread-Topic: [PATCH] mmc: core: check also R1 response for stop commands Thread-Index: AQHSnKvoq0/QKIkZ+0qbDmRdeNFVk6GUI3gQgAAEYQCAAQpEsA== Date: Wed, 15 Mar 2017 02:54:06 +0000 Message-ID: References: <20170314101501.25463-1-wsa+renesas@sang-engineering.com> <20170314104904.4ig62cy2w6fkpqzm@ninjato> In-Reply-To: <20170314104904.4ig62cy2w6fkpqzm@ninjato> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: the-dreams.de; dkim=none (message not signed) header.d=none; the-dreams.de; dmarc=none action=none header.from=renesas.com; x-originating-ip: [211.11.155.141] x-ms-office365-filtering-correlation-id: 400a448a-208a-4028-e613-08d46b4e8c59 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:PS1PR06MB1691; x-microsoft-exchange-diagnostics: 1; PS1PR06MB1691; 7:O4Dg0Q/VnzWov1fKYEqwQlxr8QkWAML6m7KWTuuxAzHVgCncKbRrHb8fsOh+mvWlBg9WIOOLQsJx3FMwClT0oy1zkQr175LgG+0+aw0mRpauyOmpE+8jCV0kZyr1ktvnEUbQucz795hcWSgOvk0s2zT81fllggIXSJMZ7RfFsczYkbXZULbwQdvZ3zAw0BJcapVYGAJYqD+ocvU5yHJCs6KI0Kx38TY+YPdXuAErT5RmW+crZJZlCqgs444VNERNPA0RU0bCXkKN33sSJj1aT5Z5m2IJR19n1PNdUCqMLtZ5vcwZZOH+CEGeLI6VfvfilmjXugyTMdCQGV11C2UK/w==; 20:QUwqXuTlRQSmLI2GUWDeJOBT6EoyK3JYsv0+XcadjL5NDOeI5S9hBNPyIOTGEjwYvglQxID3p/Sc9wyDhGXJqBlSOsgXZ0W5500MqRYLUGmgx3YgoBwH8P6sN3kdQFY+irAC0gWwkxO2sREtaFJ4+EHsYufNdQ2qLpJfIag+sGQ= x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123558025)(20161123562025)(6072148); SRVR:PS1PR06MB1691; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1691; x-forefront-prvs: 02475B2A01 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39450400003)(39840400002)(39860400002)(39850400002)(76104003)(52314003)(45984002)(377454003)(74316002)(6506006)(6246003)(5660300001)(54906002)(25786008)(99286003)(110136004)(7696004)(54356999)(53936002)(6436002)(76176999)(9686003)(50986999)(77096006)(4326008)(33656002)(38730400002)(55016002)(229853002)(3660700001)(8936002)(66066001)(2906002)(3280700002)(189998001)(305945005)(7736002)(8676002)(81166006)(122556002)(3846002)(6116002)(102836003)(86362001)(2900100001)(2950100002)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1691; H:PS1PR06MB1692.apcprd06.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2017 02:54:07.0061 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1691 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Wolfram-san, > From: Wolfram Sang, Sent: Tuesday, March 14, 2017 7:49 PM > > > > So, since I got no complaints about the RFC, I'll declare it a PATCH now :) > > > Shimoda-san, is it possible for you to test it with the SD tester you once had > > > access to? I could only test it by setting the ECC bit in the driver manually. > > > > Sure. I am able to bring the SD tester from other department tomorrow. > > So, I will check this patch tomorrow. > > Good news, thank you very much! I tested this patch with the SD tester. After I applied this patch, when the R1_CARD_ECC_FAILED is set, the following message appeared: mmcblk1: error -5 sending stop command, original cmd response 0x900, card status 0x900 However, I have a question about "ecc_err" in both mmc_blk_err_check() and mmc_blk_cmd_recovery(). Anyway, I tested this patch. And the mmc core said some error happened. I think this is suitable behavior. So, Tested-by: Yoshihiro Shimoda < Question > In mmc_blk_cmd_recovery(), if "brq->stop.resp[0] & R1_CARD_ECC_FAILED" is true, ecc_err is set to true. However, in mmc_blk_err_check(), ecc_err is only referred when brq->data.error is true. So, I guess we need a patch like below as another patch. What do you think? After that, the mmc core also output the following message: mmcblk1: error 0 transferring data, sector 0, nr 128, cmd response 0x900, card status 0x200b00 mmcblk1: retrying using single block read Best regards, Yoshihiro Shimoda --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 0e838b0..99c937b 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1374,7 +1374,7 @@ static enum mmc_blk_status mmc_blk_err_check(struct mmc_ca return MMC_BLK_RETRY; } - if (brq->data.error) { + if (brq->data.error || ecc_err) { if (need_retune && !brq->retune_retry_done) { pr_debug("%s: retrying because a re-tune was needed\n", req->rq_disk->disk_name);