From patchwork Fri Nov 21 06:39:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 5353131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BC5BA9F2F1 for ; Fri, 21 Nov 2014 06:44:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1E3F201C7 for ; Fri, 21 Nov 2014 06:43:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 245492018E for ; Fri, 21 Nov 2014 06:43:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xrhum-0001xp-7X; Fri, 21 Nov 2014 06:41:56 +0000 Received: from mail-pd0-f179.google.com ([209.85.192.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XrhtZ-0000gi-Dj for linux-arm-kernel@lists.infradead.org; Fri, 21 Nov 2014 06:40:41 +0000 Received: by mail-pd0-f179.google.com with SMTP id w10so4675432pde.10 for ; Thu, 20 Nov 2014 22:40:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DicLTE7po5B+G9yBZMiLKX8ca64tMEgIERhpzHZ/afI=; b=LECGTqJhYXvhjDNlIGhehe+ykbrro0qj4YCrbYmCECd0cbrP29rMjZZ7ZyJcX6p8FY 9pmr5NY0x5sx9texO18ZvMQOmyDydq9h5DX1OGyiuIoU70XG861qSUy15cEhu/vib0qm 7FywiGkA3AaJ+eHgRBvTG/nfBmXXwiHn9bznmdIyyB5W79gK7/hsJXIN1Sgx+tj18s+M h15FGwqtX3ne2yLv7UVoctgudoXxde7fUa8P5vaKhWdE9d3eOGrTZmCRqWKaVGr6Hc1R TmdcD5TO042YWKZ50SdvCC6NHrJdIUAhi0EBAUeUIBv+DuUcPt4eW34n/WmHiREsZ35w GX+A== X-Gm-Message-State: ALoCoQk+I6Ol+Bxnh6pAonyJVGUdSeCMl7fOYKx/sELBhnD8E7k74WKG1JGBtEjpupcoX1lu8K2Q X-Received: by 10.68.98.131 with SMTP id ei3mr3589233pbb.127.1416552013513; Thu, 20 Nov 2014 22:40:13 -0800 (PST) Received: from localhost.localdomain ([180.107.5.182]) by mx.google.com with ESMTPSA id ip1sm3813300pbc.0.2014.11.20.22.39.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Nov 2014 22:40:12 -0800 (PST) From: Shawn Guo To: linux-mmc@vger.kernel.org Subject: [PATCH] mmc: dw_mmc: fix card read threshold for PIO mode Date: Fri, 21 Nov 2014 14:39:10 +0800 Message-Id: <1416551950-8277-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141120_224041_497391_6307CD99 X-CRM114-Status: GOOD ( 11.19 ) X-Spam-Score: -0.7 (/) Cc: Ulf Hansson , Seungwon Jeon , Chris Ball , stable@vger.kernel.org, Jaehoon Chung , Shawn Guo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Commit f1d2736c8156 ("mmc: dw_mmc: control card read threshold") introduces a regression for use case where PIO mode is used, i.e. CONFIG_MMC_DW_IDMAC is not disabled. It stops kernel from booting like below. dw_mmc 9408000.dwmmc: fifo-depth property not found, using value of FIFOTH register as default dw_mmc 9408000.dwmmc: Using PIO mode. dw_mmc 9408000.dwmmc: Version ID is 210a dw_mmc 9408000.dwmmc: DW MMC controller at irq 72, 32 bit host data width, 32 deep fifo dw_mmc 9408000.dwmmc: 1 slots initialized ... Waiting for root device /dev/mmcblk0p2... mmc_host mmc0: Bus speed (slot 0) = 52000000Hz (slot req 50000000Hz, actual 26000000HZ div = 1) mmc0: new high speed SDHC card at address b368 mmcblk0: mmc0:b368 AF UD 3.84 GiB Rather than clearing read threshold bits, the best thing that function dw_mci_ctrl_rd_thld() should do is leaving the bits untouched, in case that card read threshold setup is not needed. The patch fixes the regression by changing dw_mci_ctrl_rd_thld() a bit to do nothing in case card read threshold bits setup is not needed. Signed-off-by: Shawn Guo Fixes: f1d2736c8156 ("mmc: dw_mmc: control card read threshold") Cc: # 3.13+ --- drivers/mmc/host/dw_mmc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 69f0cc68d5b2..52c04ba69970 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -628,13 +628,13 @@ static void dw_mci_ctrl_rd_thld(struct dw_mci *host, struct mmc_data *data) if (host->timing != MMC_TIMING_MMC_HS200 && host->timing != MMC_TIMING_UHS_SDR104) - goto disable; + return; blksz_depth = blksz / (1 << host->data_shift); fifo_depth = host->fifo_depth; if (blksz_depth > fifo_depth) - goto disable; + return; /* * If (blksz_depth) >= (fifo_depth >> 1), should be 'thld_size <= blksz' @@ -644,9 +644,6 @@ static void dw_mci_ctrl_rd_thld(struct dw_mci *host, struct mmc_data *data) thld_size = blksz; mci_writel(host, CDTHRCTL, SDMMC_SET_RD_THLD(thld_size, 1)); return; - -disable: - mci_writel(host, CDTHRCTL, SDMMC_SET_RD_THLD(0, 0)); } static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data)