From patchwork Thu Aug 15 14:32:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 2845194 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DC4A8BF546 for ; Thu, 15 Aug 2013 14:33:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B10220348 for ; Thu, 15 Aug 2013 14:33:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91CFF2030D for ; Thu, 15 Aug 2013 14:33:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757776Ab3HOOc5 (ORCPT ); Thu, 15 Aug 2013 10:32:57 -0400 Received: from ns.mm-sol.com ([212.124.72.66]:52475 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757088Ab3HOOcF (ORCPT ); Thu, 15 Aug 2013 10:32:05 -0400 Received: from mms.int.mm-sol.com (unknown [172.18.0.3]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 8366DC697; Thu, 15 Aug 2013 17:32:04 +0300 (EEST) From: Georgi Djakov To: cjb@laptop.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Georgi Djakov , Venkat Gopalakrishnan , Asutosh Das , Sahitya Tummala Subject: [PATCH 1/5] mmc: sdhci: add quirk for R/W Transfer Active EOT Date: Thu, 15 Aug 2013 17:32:16 +0300 Message-Id: <1376577140-2652-2-git-send-email-gdjakov@mm-sol.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1376577140-2652-1-git-send-email-gdjakov@mm-sol.com> References: <1376577140-2652-1-git-send-email-gdjakov@mm-sol.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Initial version of Qualcomm SDHC has a hardware issue. This patch adds a quirk SDHCI_QUIRK2_RDWR_TX_ACTIVE_EOT to enable a workaround. Hardware issue: Read Transfer Active/ Write Transfer Active may be not de-asserted after end of transaction. Software workaround: Set Software Reset for DAT line in Software Reset Register (Bit 2). CC: Venkat Gopalakrishnan CC: Asutosh Das CC: Sahitya Tummala Signed-off-by: Georgi Djakov --- drivers/mmc/host/sdhci.c | 3 +++ include/linux/mmc/sdhci.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index a78bd4f..57659fb 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2155,6 +2155,9 @@ static void sdhci_tasklet_finish(unsigned long param) controllers do not like that. */ sdhci_reset(host, SDHCI_RESET_CMD); sdhci_reset(host, SDHCI_RESET_DATA); + } else { + if (host->quirks2 & SDHCI_QUIRK2_RDWR_TX_ACTIVE_EOT) + sdhci_reset(host, SDHCI_RESET_DATA); } host->mrq = NULL; diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index e3c6a74..3783f4c 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -98,6 +98,8 @@ struct sdhci_host { #define SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON (1<<4) /* Controller has a non-standard host control register */ #define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5) +/* Controller cannot de-assert Read/Write Transfer Active after transaction */ +#define SDHCI_QUIRK2_RDWR_TX_ACTIVE_EOT (1<<6) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */