Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1107119pxb; Wed, 15 Sep 2021 23:02:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzldL9H3NclBSyX5YP039EyxUR/HKyjWC71HguESADh3/Pwp3CpMqWkNo4Po8UC0OjdWpxk X-Received: by 2002:aa7:c0ca:: with SMTP id j10mr4494560edp.146.1631772170116; Wed, 15 Sep 2021 23:02:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631772170; cv=none; d=google.com; s=arc-20160816; b=IvlllaK06cDiBx1jNSkaslK/khEyV5y+FWnhykvU+kNUcE1D24UhwX10bUyFaMtXND AOfVB2T72KOEmcEyIr+/ozQV71gkhn8ChnzPJZ+5pztxcL+ORU7/QTxTwUi9lDyoIl7S yq+0Ez5LYJsZBHHuPJ/UaxkDDM+AWQHORVzSmKu9PORs1bb3GFymF0z5lXdLldjVuyu/ B3qjq3xERPPzZyU2OTSMLrZ0i1+ZEnVsGq9Cd7kULw68eG7Ii3FbZkYlYf2KP6fPREiN ryos1kbKRXOE6gqwm9yVaO5D0Z5X2vhlOiHDm80aJ8s0tHjKeBr+BT3OCEpJMxxHBcUO 1Z3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:to:from; bh=s5UVjqUZh0BkQjfi0q77glzMmtMTjU09fZWd0jrMkdg=; b=HzkPgDw45srFUQE6uqlJX7GsSST13T3SeyUjW3znyhhzngJUFLuvXl7HBgPg6hYCr/ 9QY1HKlsOLcfG/BaBrKK/iqXYJ76yj5IsmupkHj82KFsQfwrDHkEqnteOvw8sLq9oC4c Am9P+X6CouqhyomLXKMbflwot+4tQLxbryJ9UCdGt5Wb+1R2HIubnuPPlmiVD0CsOBEh XnoUHgaf90BIST8AuDjoZYvVXr525S9Nof6c8tqVEity2SQEj3yvC/1pkOgZ91bVSP8P C8ww7RhYU+qsZiG1tQ3PtidqQ0lVBRrIQowce5NfGRnnRN0uW/rMDKU8zDv+ELRIwPbz XPPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hyperstone.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi17si2475021edb.228.2021.09.15.23.02.26; Wed, 15 Sep 2021 23:02:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hyperstone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234460AbhIPGAn convert rfc822-to-8bit (ORCPT + 99 others); Thu, 16 Sep 2021 02:00:43 -0400 Received: from mail3.swissbit.com ([176.95.1.57]:52816 "EHLO mail3.swissbit.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231281AbhIPGAm (ORCPT ); Thu, 16 Sep 2021 02:00:42 -0400 Received: from mail3.swissbit.com (localhost [127.0.0.1]) by DDEI (Postfix) with ESMTP id DBC1C462660; Thu, 16 Sep 2021 07:59:20 +0200 (CEST) Received: from mail3.swissbit.com (localhost [127.0.0.1]) by DDEI (Postfix) with ESMTP id C4BC6462579; Thu, 16 Sep 2021 07:59:20 +0200 (CEST) X-TM-AS-ERS: 10.149.2.84-127.5.254.253 X-TM-AS-SMTP: 1.0 ZXguc3dpc3NiaXQuY29t Y2xvZWhsZUBoeXBlcnN0b25lLmNvbQ== X-DDEI-TLS-USAGE: Used Received: from ex.swissbit.com (SBDEEX02.sbitdom.lan [10.149.2.84]) by mail3.swissbit.com (Postfix) with ESMTPS; Thu, 16 Sep 2021 07:59:20 +0200 (CEST) Received: from sbdeex02.sbitdom.lan (10.149.2.84) by sbdeex02.sbitdom.lan (10.149.2.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Thu, 16 Sep 2021 07:59:20 +0200 Received: from sbdeex02.sbitdom.lan ([fe80::e0eb:ade8:2d90:1f74]) by sbdeex02.sbitdom.lan ([fe80::e0eb:ade8:2d90:1f74%8]) with mapi id 15.02.0792.015; Thu, 16 Sep 2021 07:59:20 +0200 From: =?iso-8859-1?Q?Christian_L=F6hle?= To: "jh80.chung@samsung.com" , "ulf.hansson@linaro.org" , =?iso-8859-1?Q?Christian_L=F6hle?= , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] mmc: dw_mmc: Dont wait for DRTO on Write RSP error Thread-Topic: [PATCH] mmc: dw_mmc: Dont wait for DRTO on Write RSP error Thread-Index: AQHXqhYa44rwKgBqC0+dHpZHhUAChw== Date: Thu, 16 Sep 2021 05:59:19 +0000 Message-ID: Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.154.1.4] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-TMASE-Version: DDEI-5.1-8.6.1018-26410.005 X-TMASE-Result: 10--2.949200-10.000000 X-TMASE-MatchedRID: ge9e+QLSeax0/jNwxBmuZv3HILfxLV/9VCGp3g4/hjvzlv7FEwWOy4y+ AfTlDGN11vhRvynnwhEO7ndyUgsX1eKym8zE8AgF0H8ihGEHNUfYUDvAr2Y/1zyovSwnwFVARiM 0r5DoZkA8jxJmnRLIc1CmJTAZcDrb0bQcZcDDFnw/ApMPW/xhXkyQ5fRSh265NfN1rpdRutC/L6 hUiqxuRE27R9Vxkzq+cIzt2e36YsNoMCLywE0ygQtuKBGekqUpbGVEmIfjf3vnPXrQtxZA4oamh VxhQjTYKwPdlty0plE4Syw8HpzJwi6AmL2SZCUC X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-TMASE-INERTIA: 0-0;;;; X-TMASE-XGENCLOUD: 71df0c4c-c9f1-49fc-bef3-3aecdd4d99e6-0-0-200-0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only wait for DRTO on reads, otherwise the driver hangs. The driver prevents sending CMD12 on response errors like CRCs. According to the comment this is because some cards have problems with this during the UHS tuning sequence. Unfortunately this workaround currently also applies for any command with data. On reads this will set the drto timer which then triggers after a while. On writes this will not set any timer and the tasklet will not be scheduled again. I cannot attest for the UHS workarounds need, but even if so, it should at most apply to reads. I have observed many hangs when CMD25 response contained a CRC error. This patch fixes this without touching the actual UHS tuning workaround. Signed-off-by: Christian Loehle --- drivers/mmc/host/dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 6578cc64ae9e..22cf13dc799b 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2081,7 +2081,8 @@ static void dw_mci_tasklet_func(struct tasklet_struct *t) * delayed. Allowing the transfer to take place * avoids races and keeps things simple. */ - if (err != -ETIMEDOUT) { + if (err != -ETIMEDOUT && + host->dir_status == DW_MCI_RECV_STATUS) { state = STATE_SENDING_DATA; continue; } -- 2.32.0 Hyperstone GmbH | Line-Eid-Strasse 3 | 78467 Konstanz Managing Directors: Dr. Jan Peter Berns. Commercial register of local courts: Freiburg HRB381782