From patchwork Wed May 25 07:13:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Warkentin X-Patchwork-Id: 815102 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4P6d7sv026848 for ; Wed, 25 May 2011 06:40:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752987Ab1EYGkf (ORCPT ); Wed, 25 May 2011 02:40:35 -0400 Received: from exprod5og111.obsmtp.com ([64.18.0.22]:40015 "EHLO exprod5og111.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752298Ab1EYGke (ORCPT ); Wed, 25 May 2011 02:40:34 -0400 Received: from il93mgrg01.am.mot-mobility.com ([144.188.21.13]) (using TLSv1) by exprod5ob111.postini.com ([64.18.4.12]) with SMTP ID DSNKTdykYb78+lVDSO48Sc62o3KUE30aQ93j@postini.com; Tue, 24 May 2011 23:40:34 PDT Received: from il93mgrg01.am.mot-mobility.com ([10.22.94.168]) by il93mgrg01.am.mot-mobility.com (8.14.3/8.14.3) with ESMTP id p4P6c9ma012488 for ; Wed, 25 May 2011 02:38:09 -0400 (EDT) Received: from mail-pv0-f170.google.com (mail-pv0-f170.google.com [74.125.83.170]) by il93mgrg01.am.mot-mobility.com (8.14.3/8.14.3) with ESMTP id p4P6XH8d010576 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 25 May 2011 02:38:09 -0400 (EDT) Received: by mail-pv0-f170.google.com with SMTP id 21so632589pvh.15 for ; Tue, 24 May 2011 23:40:33 -0700 (PDT) Received: by 10.68.44.200 with SMTP id g8mr3361818pbm.362.1306305632924; Tue, 24 May 2011 23:40:32 -0700 (PDT) Received: from localhost.localdomain (dyngate-ca119-12.motorola.com [144.189.96.12]) by mx.google.com with ESMTPS id t6sm5491975pbc.21.2011.05.24.23.40.30 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2011 23:40:31 -0700 (PDT) From: Andrei Warkentin To: linux-mmc@vger.kernel.org Cc: cjb@laptop.org, Andrei Warkentin Subject: [PATCH] MMC: SDHCI Auto-CMD23 fixes. Date: Wed, 25 May 2011 02:13:43 -0500 Message-Id: <1306307623-8610-1-git-send-email-andreiw@motorola.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 25 May 2011 06:40:35 +0000 (UTC) Fixes bugs in Auto-CMD23 feature enable decision. Auto-CMD23 shoud be enabled if host is >= v3, and SDMA is not in use. USE_ADMA | USE_SDMA | Auto-CMD23 ---------+----------+----------- 0 | 0 | 1 ---------+----------+----------- 0 | 1 | 0 ---------+----------+----------- 1 | 0 | 1 ---------+----------+----------- 1 | 1 | 1 Signed-off-by: Andrei Warkentin --- drivers/mmc/host/sdhci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index fbb1842..a4e64b0 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2498,9 +2498,9 @@ int sdhci_add_host(struct sdhci_host *host) host->flags |= SDHCI_AUTO_CMD12; /* Auto-CMD23 stuff only works in ADMA or PIO. */ - if ((host->version == SDHCI_SPEC_300) && + if ((host->version >= SDHCI_SPEC_300) && ((host->flags & SDHCI_USE_ADMA) || - !(host->flags & SDHCI_REQ_USE_DMA))) { + !(host->flags & SDHCI_USE_SDMA))) { host->flags |= SDHCI_AUTO_CMD23; printk(KERN_INFO "%s: Auto-CMD23 available\n", mmc_hostname(mmc)); } else