From patchwork Wed Sep 19 11:21:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martin X-Patchwork-Id: 1476801 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id BC043DF280 for ; Wed, 19 Sep 2012 11:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752910Ab2ISLVW (ORCPT ); Wed, 19 Sep 2012 07:21:22 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:40672 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752232Ab2ISLVW (ORCPT ); Wed, 19 Sep 2012 07:21:22 -0400 Received: by weyx8 with SMTP id x8so513629wey.19 for ; Wed, 19 Sep 2012 04:21:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=pi2HxZRVXpErMN6kUc0cpATNZVQHfTInkvpeV8YYEdU=; b=SeHoTtSex6lm1p+IxVLY2t06SrvIB9B341Ca2IniflhWEKrJZya8vvvgRIgX+LFp6T YO2Kofe2i+tY1nc3/jlLH7SpuWv3wj7zhPanD3iQ+1njdylIBKhIyWm3Yxk7kDoTEA4Q Z3QoPQgQ/tyVDtxGpGmfgm/dDIR31Zajvf6SqrkjawYJ+evnkQim1BSobKt57+0e4bw+ lM70/FQTCxi0uk4oa+LPOw1JEsqbriqfcE2rwx4qNm3GW3DIenUY6IK/qR4LbsDqb7FH oaAtcZ3wmkl5Rr5mxqebvzC1sXQIPx1uv7MJbL4N+SxB+bYS4MndtQOAzTzCg1rQ0VdU 1MrA== Received: by 10.180.105.6 with SMTP id gi6mr6161657wib.4.1348053680762; Wed, 19 Sep 2012 04:21:20 -0700 (PDT) Received: from piscis.vsilicon.net (122.251.106.212.dynamic.jazztel.es. [212.106.251.122]) by mx.google.com with ESMTPS id hv8sm31935170wib.0.2012.09.19.04.21.17 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Sep 2012 04:21:18 -0700 (PDT) From: Javier Martin To: linux-mmc@vger.kernel.org Cc: viresh.linux@gmail.com, g.liakhovetski@gmx.de, vinod.koul@linux.intel.com, s.hauer@pengutronix.de, cjb@laptop.org, Javier Martin Subject: [PATCH] mmc: mxcmmc: fix SD cards not being detected sometimes. Date: Wed, 19 Sep 2012 13:21:07 +0200 Message-Id: <1348053667-10389-1-git-send-email-javier.martin@vista-silicon.com> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQnoR3CsywfCvwo7g88UbUfoBxdbFdYzYhmz/2xNChdiljcs8xkxhmFTGZYuWSWr7TyMrFXG Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org When a SD card is initialized some data transfers of 64 and 8 bytes are issued. It seems the DMA has some problems dealing with these kind of "short" transfers, leading sometimes to the SD card not being detected. In order to solve this problem, do not use DMA for transfer sizes lower than the sector size. Signed-off-by: Javier Martin --- drivers/mmc/host/mxcmmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index fc42a2e..a09637f 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -240,7 +240,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data) return 0; for_each_sg(data->sg, sg, data->sg_len, i) { - if (sg->offset & 3 || sg->length & 3) { + if (sg->offset & 3 || sg->length < 512) { host->do_dma = 0; return 0; }