Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1824851imu; Wed, 21 Nov 2018 02:31:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/VqwVGgJF2GOH50N9X3Lmtpu8qHDFlj8lGMcUl6J4FLdTPgP7YioXdoGkXSDIQMXp4jU9ax X-Received: by 2002:a63:e055:: with SMTP id n21mr5478327pgj.397.1542796295984; Wed, 21 Nov 2018 02:31:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542796295; cv=none; d=google.com; s=arc-20160816; b=Zi/y15rub0LH5gHrXNdb+AYDyYTTYyNCYl9h4Gf7evkwTgxuyhxAxLhUp+RN6IsbIv ODL9DLanHB47DMhORnd+mtow7EpbnaqPRRIbzQ1L3T0q9pdWkhACgv6tnPP4qOkLmtW8 AciG8DeW8BjF4RCF3jPq0zMIRNiWh3V8b9rRFWD8+zH7hgHdBJnTPwLAExSG8XJF9YcZ jyTwMgnYK7pOiaTxA0VifrDtz3hjZm4bXsmNLgD374u1tENUkDC443hRw83m7IpCZg85 g9wzfFOq8Lw+XumRYTrzDDQ58h5Ny4XDlWOHcgcCMU8WksZ0umyxj99pcOx847YISg8A rbzg== 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:dkim-signature; bh=+pjQzllsoqj/Lp/Rp2pjPsBZ7yAVWCg2dGcV3M/83SI=; b=cCaP1i9OcabvrA8zlmSFRKnTdv+/b601QPyO+/16qBlXwJ6Rpw42ApB8P2gEdI/ZWJ AEriafrlOXz+3DiVv8zsR5px91jDxi46M3vJqNpvYmsI9iQgavYhS596aGWrmtVaR3M1 9B9+8KnacGR/u0+QnQTFXweoh1YHjZIm5EfWbF3jPj3P++9BPQJ9WKKf2XC8owdFUikw DJ5ZP2xCou0MBHzVcyj8HNhIRfczUdS6b0uG2pM/KTO51Y0+HhkV5MsyK3/7oJ31qUkc cuZ1MY0+VhQaOU+tc1igdtQ5xAPJWOoaWSWJmmTRFoxDoxwyE4L3P8ExlTv6rxKto7lR Isrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="bx2+/s8Y"; 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=pass (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 v20si17074487pgk.103.2018.11.21.02.31.21; Wed, 21 Nov 2018 02:31:35 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="bx2+/s8Y"; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729781AbeKUUKI (ORCPT + 99 others); Wed, 21 Nov 2018 15:10:08 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:50228 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbeKUUKI (ORCPT ); Wed, 21 Nov 2018 15:10:08 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id wAL9aM18106750; Wed, 21 Nov 2018 03:36:22 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1542792982; bh=+pjQzllsoqj/Lp/Rp2pjPsBZ7yAVWCg2dGcV3M/83SI=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=bx2+/s8YnDfW0i0apmzKzUtYy/onBBR5WakWizthBMR/0/RXRxrNDETHD0SLibI2J lrjo9RX/gFEKfZ44Hb3dC1dNAfOCk8NRz3OlhJTzb5riDA6QmYY8z3/yC1wCp2PO4p E0xt6x5o1uD9+vGonmR55RzKZWrGAz8bYcsci4Ms= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wAL9aMpE068177 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 21 Nov 2018 03:36:22 -0600 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 21 Nov 2018 03:36:21 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 21 Nov 2018 03:36:21 -0600 Received: from [172.24.190.215] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id wAL9aJPS007135; Wed, 21 Nov 2018 03:36:20 -0600 Subject: Re: [PATCH 1/4] mmc: sdhci-omap: Fix DCRC error handling during tuning To: Kishon Vijay Abraham I , , CC: , References: <20181119111618.2745-1-faiz_abbas@ti.com> <20181119111618.2745-2-faiz_abbas@ti.com> From: Faiz Abbas Message-ID: Date: Wed, 21 Nov 2018 15:09:02 +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: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit 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 Kishon, On 20/11/18 10:23 AM, Kishon Vijay Abraham I wrote: > 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). > host->ier is modified everywhere during an mmc request. I would not expect it to hold its value after so many tuning commands. I can add a bool to check of DCRC was enabled before and only then re-enable it. Thanks, Faiz