From patchwork Sat Apr 8 20:20:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 9671237 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 B88DB6037D for ; Sat, 8 Apr 2017 20:20:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6BF62843C for ; Sat, 8 Apr 2017 20:20:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B04228445; Sat, 8 Apr 2017 20:20:24 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham 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 46C1828445 for ; Sat, 8 Apr 2017 20:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752288AbdDHUUW (ORCPT ); Sat, 8 Apr 2017 16:20:22 -0400 Received: from sauhun.de ([88.99.104.3]:55481 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751505AbdDHUUV (ORCPT ); Sat, 8 Apr 2017 16:20:21 -0400 Received: from localhost (p54B3369C.dip0.t-ipconnect.de [84.179.54.156]) by pokefinder.org (Postfix) with ESMTPSA id F35772C3053; Sat, 8 Apr 2017 22:20:17 +0200 (CEST) From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Yoshihiro Shimoda , Ulf Hansson , Wolfram Sang Subject: [RFC PATCH v2 0/2] mmc: core: process ECC errors raised in stop cmds Date: Sat, 8 Apr 2017 22:20:04 +0200 Message-Id: <20170408202006.27276-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 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 Here is the second RFC for handling ECC errors flagged in the stop command after a multiblock transfer. It is still RFC because I could only test it by inducing ECC errors in software (see patch for TMIO below). Shimoda-san, can you try this series with the SD tester again? That would be very kind. Other than that, I hope the patch descriptions and comments explain the single steps. Looking forward for thoughts. Kind regards, Wolfram Changes since RFC v1: * rebased to mmc/next as of today * reworded commit message for patch 1 * added tested-tag from Shimoda-san for patch 1 * added patch 2 Wolfram Sang (2): mmc: core: check also R1 response for stop commands mmc: core: for data errors, take response of stop cmd into account drivers/mmc/core/block.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) Patch to simulate ECC errors: diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index a2d92f10501bdd..9773c7e5e4d154 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -553,6 +553,8 @@ void tmio_mmc_do_data_irq(struct tmio_mmc_host *host) } if (stop) { + static unsigned int induce_cnt = 0; + if (stop->opcode != MMC_STOP_TRANSMISSION || stop->arg) dev_err(&host->pdev->dev, "unsupported stop: CMD%u,0x%x. We did CMD12,0\n", stop->opcode, stop->arg); @@ -560,6 +562,9 @@ void tmio_mmc_do_data_irq(struct tmio_mmc_host *host) /* fill in response from auto CMD12 */ stop->resp[0] = sd_ctrl_read16_and_16_as_32(host, CTL_RESPONSE); + if (induce_cnt++ % 100 == 0) + stop->resp[0] |= R1_CARD_ECC_FAILED; + sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0); }