Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3345619imu; Mon, 28 Jan 2019 03:16:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN78uLC+8DwZj1onfHIVQoxMxvD2rBB5sMvSXk0R1DR3Di7sD74sNb0QQe5MUg8YDu7Irdkt X-Received: by 2002:a62:46d0:: with SMTP id o77mr21707783pfi.172.1548674217745; Mon, 28 Jan 2019 03:16:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548674217; cv=none; d=google.com; s=arc-20160816; b=nqPaOYXk9XfedKp5pGBQpBYGdqaxpPM/KuMvmlCH+uiZFnmJgWv6p+YrkR6JYujYNh 87FaVErNxRxgZXA+0qBbauvn80Izgo8JF8KSfrJgzF+CWvPo2qpS4mLJ0l40qj4mNSZj K4nIYrI3Wcmc7Y9cL0jkzs0UB7xUKRY2x00ihbCapHs569JS+w+Ioj1GcQE8ecgmsehf YRoPy3uW9dQvlD2DaxbTZU3Cz9NZZbYNKHOS7wytyJOmZkZ/Y33jJHa6Cl+TnLtE0ZUN sw4CZObzUw54F9cyoFm5wPOO8A7DL+0Rfk6sZ6czaJ0+ZxMu+Tcapq260BWQVTD9H0U1 BBmw== 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=kOnXROCcOfTZQvSiyMmTbZICo0hQwvnfd3wKXaMZnWY=; b=cT0EHUsMvf0tFotBZwt6HP0S24b9XG0rlwJ3tO/3be3o5Ozo39DB6EIx/bCR1Lah+c xc+iWYdM1ckDErOIFKoaV4FZDs4q9Z4YHi7VL7GVBxoT+vj7LYlE3j14yvVwriDxwjZP OiToOKCCbQ/eTAVRFXH0SGj6V15Ub2krwInwB/k9sK6QF44X3dMFtZBYHJ9IJLjgB/Lw uRhHvYeWgga1B1xHzd0uKP/E+9Rypi1745ZoRUHE0Rf9D8nkllOADfliZxha40xGb6XL HCjG3lfhrUjgwD6eUMrjHwDlYesLNOx2ozJCJJxvcJKWapYCj7RmcjHPL4vFCpost6JN yQQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ayTiuiqs; 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 135si31829476pge.572.2019.01.28.03.16.42; Mon, 28 Jan 2019 03:16:57 -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=ayTiuiqs; 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 S1726713AbfA1LQh (ORCPT + 99 others); Mon, 28 Jan 2019 06:16:37 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:57848 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726415AbfA1LQg (ORCPT ); Mon, 28 Jan 2019 06:16:36 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0SBGUDW027824; Mon, 28 Jan 2019 05:16:30 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1548674190; bh=kOnXROCcOfTZQvSiyMmTbZICo0hQwvnfd3wKXaMZnWY=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=ayTiuiqs3EDmIzk4D0Au2goOhYB3LuxUNtdu40MwUpM4uFjJ6E6XRH7NmQzIDwCjd LjjKx337fxkMHFIJaJY4NP2wzWSa6GYzJe1PWagtaEBTAOzm+UQmrjUdl2E75r6YvA sZI74K7NuE8IT2kcIPtriEFieslugUIc7fqV7pHo= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0SBGUIl129636 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 28 Jan 2019 05:16:30 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 28 Jan 2019 05:16:29 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 28 Jan 2019 05:16:29 -0600 Received: from [172.24.190.215] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0SBGQjs013666; Mon, 28 Jan 2019 05:16:27 -0600 Subject: Re: [PATCH 4/7] mmc: sdhci: Add quirk for disabling DTO during erase command To: Adrian Hunter , , , CC: , , , , References: <20190111110851.6805-1-faiz_abbas@ti.com> <20190111110851.6805-5-faiz_abbas@ti.com> <8c5875db-016c-c416-7356-d7a26d8d2a0e@intel.com> From: Faiz Abbas Message-ID: <3ca3f7d3-cc75-f616-4c13-b044c8e52d4d@ti.com> Date: Mon, 28 Jan 2019 16:49:20 +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: <8c5875db-016c-c416-7356-d7a26d8d2a0e@intel.com> Content-Type: text/plain; charset="utf-8" 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 Adrian, On 24/01/19 5:38 PM, Adrian Hunter wrote: > On 11/01/19 1:08 PM, Faiz Abbas wrote: >> Some controllers might prematurely issue a data timeout during an erase >> command. Add a quirk to disable the interrupt when an erase command is >> issued. > > I might have already asked this, but would it be possible to use the > existing SDHCI_QUIRK2_DISABLE_HW_TIMEOUT quirk? This looks promising. Let me look into this. In any case, I should probably move this to something like sdhci_set_timeout and use sdhci_set_data_timeout_irq(). I was following 93caf8e69eac ("omap_hsmmc: add erase capability") for adding this. Thanks, Faiz > >> >> Signed-off-by: Faiz Abbas >> --- >> drivers/mmc/host/sdhci.c | 8 ++++++++ >> drivers/mmc/host/sdhci.h | 2 ++ >> 2 files changed, 10 insertions(+) >> >> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c >> index 4a9044c06e21..cfd716aee552 100644 >> --- a/drivers/mmc/host/sdhci.c >> +++ b/drivers/mmc/host/sdhci.c >> @@ -1560,6 +1560,14 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) >> /* Initially, a command has no error */ >> cmd->error = 0; >> >> + if (cmd->opcode == MMC_ERASE && >> + (host->quirks2 & SDHCI_QUIRK2_DISABLE_DTO_FOR_ERASE)) { >> + mask = sdhci_readl(host, SDHCI_INT_ENABLE); >> + mask &= ~SDHCI_INT_DATA_TIMEOUT; >> + sdhci_writel(host, mask, SDHCI_INT_ENABLE); >> + sdhci_writel(host, mask, SDHCI_SIGNAL_ENABLE); >> + } >> + >> if ((host->quirks2 & SDHCI_QUIRK2_STOP_WITH_TC) && >> cmd->opcode == MMC_STOP_TRANSMISSION) >> cmd->flags |= MMC_RSP_BUSY; >> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h >> index 7a52823ebef4..d0c6d4fe5371 100644 >> --- a/drivers/mmc/host/sdhci.h >> +++ b/drivers/mmc/host/sdhci.h >> @@ -479,6 +479,8 @@ struct sdhci_host { >> * block count. >> */ >> #define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18) >> +/* Controller needs to disable DTO for erase command */ >> +#define SDHCI_QUIRK2_DISABLE_DTO_FOR_ERASE (1<<19) >> >> int irq; /* Device IRQ */ >> void __iomem *ioaddr; /* Mapped address */ >> >