Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp205755imu; Mon, 19 Nov 2018 20:54:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/UrQk7kYR5urn8BZgtlB2dOwghaZe0HPr6b/vQhBPuVtiETpCLzkqrVi1HytwZo5tIOyRCL X-Received: by 2002:a63:cf08:: with SMTP id j8mr574200pgg.113.1542689642556; Mon, 19 Nov 2018 20:54:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542689642; cv=none; d=google.com; s=arc-20160816; b=sWA+aIrn1x/E0Ajufsd1tzQC0IEQwfsxri/XgbvtY+uO482BWPqp6AYBXhjaeuFCEs kWpA6dFCLC8K8pC6s0oK5cagwbCdep2JAU8gsqXnIPZDV9CN0H1x8Fu9CXDBTgmL+MVq 1gOPHgtRMn2PQpT5kjfP79gzsvdLWev/iJo/phoWvbV6co63PY+vk5ZQtj9/6MEItwh+ HX5kLNFm2HduP8IF8pguIPI2wkn8inVQBAJYMX+FHSyCRCEzXA9mr0vmkHW6OvJKDy2S y99A8E8F3J/kdrbQjaGO0suBo0/iY3i5JmiNjhZsedr2HjENzTOiwMLmv3x8RwctTGda l4Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Eg5BPYtto0KX80xVKbrlB0zbTrzXojAqn7O/YZeKQeY=; b=ryox2uyXx+Z7xDFDZoxZRhvSl3mcfcHwIhk6tNlxGeJYeA18E/E9KlFXnT1/sUUe6Y 7GB2DmSm8qFu6qnX2DiZ1G7NLmN+oDGWeI2vA8z8An+yHrtPupYOsByfw1/9vD2UpZba WIjIjk8sjlG0i41zowG+Es/7qQLzgdP+aDMzeva737HIlqWg5Z+hLc0lbtneO39Y3m3g v2gCTjJQnobDPnsigFbE5m2U7sCwxgZYLX+G+pCg52Bw1ALmTqSXAm+sUfsMdstyHwxh ctoVnSgitT7TATaYwNED9GMo3GwwpMRy65cfqfa6RkL3B+PcjlLhqmbpx3lb1y0yg+Lt f5EA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2si18070966pgh.474.2018.11.19.20.53.47; Mon, 19 Nov 2018 20:54:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730890AbeKTPUU (ORCPT + 99 others); Tue, 20 Nov 2018 10:20:20 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:46384 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730276AbeKTPUU (ORCPT ); Tue, 20 Nov 2018 10:20:20 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id wAK4r8XR113701; Mon, 19 Nov 2018 22:53:08 -0600 Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wAK4r8Ec086979 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 19 Nov 2018 22:53:08 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 19 Nov 2018 22:53:08 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 19 Nov 2018 22:53:08 -0600 Received: from [172.24.190.233] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id wAK4r6pB015006; Mon, 19 Nov 2018 22:53:07 -0600 Subject: Re: [PATCH 1/4] mmc: sdhci-omap: Fix DCRC error handling during tuning To: Faiz Abbas , , CC: , References: <20181119111618.2745-1-faiz_abbas@ti.com> <20181119111618.2745-2-faiz_abbas@ti.com> From: Kishon Vijay Abraham I Message-ID: Date: Tue, 20 Nov 2018 10:23:03 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181119111618.2745-2-faiz_abbas@ti.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 19/11/18 4:46 PM, Faiz Abbas wrote: > Commit 7d33c3581536 ("mmc: sdhci-omap: Workaround for Errata i802") > disabled DCRC interrupts during tuning. This write to the interrupt > enable register gets overwritten in sdhci_prepare_data() and the > interrupt is not in fact disabled. Fix this by disabling the interrupt > in the host->ier variable. > > Signed-off-by: Faiz Abbas > --- > drivers/mmc/host/sdhci-omap.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c > index 88347ce78f23..87138067e334 100644 > --- a/drivers/mmc/host/sdhci-omap.c > +++ b/drivers/mmc/host/sdhci-omap.c > @@ -290,7 +290,6 @@ static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode) > u32 start_window = 0, max_window = 0; > u8 cur_match, prev_match = 0; > u32 length = 0, max_len = 0; > - u32 ier = host->ier; > u32 phase_delay = 0; > int ret = 0; > u32 reg; > @@ -317,9 +316,7 @@ static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode) > * during the tuning procedure. So disable it during the > * tuning procedure. > */ > - ier &= ~SDHCI_INT_DATA_CRC; > - sdhci_writel(host, ier, SDHCI_INT_ENABLE); > - sdhci_writel(host, ier, SDHCI_SIGNAL_ENABLE); > + host->ier &= ~SDHCI_INT_DATA_CRC; > > while (phase_delay <= MAX_PHASE_DELAY) { > sdhci_omap_set_dll(omap_host, phase_delay); > @@ -366,6 +363,8 @@ static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode) > > ret: > sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); > + /* Reenable forbidden interrupt */ > + host->ier |= SDHCI_INT_DATA_CRC; It's better to have a backup of host->ier and restore the value here (in case DATA_CRC is disabled for other cases). Thanks Kishon