From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C440C43381 for ; Wed, 27 Mar 2019 18:36:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6374F2082F for ; Wed, 27 Mar 2019 18:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553711776; bh=N2D3tRTCEJe65RgguQNsfrN0M4cgYkispMOAjYJ+6Os=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Yqvlqx8JD27Va6sscxKgsBZcOKuPu3BSHV/dC2Rb1C9TFpFU8/ppKVRx3abgt7GJ8 8N0s8Y3l0kecjoNf6ahCW29//U4giH6D5RJdFlrfnotGX16ha/L2KZ/2BSTbHX4pcH Ug8Pn3j8Pa7CdN+R6MlrePJ3noJiIz3AKDHW6JYw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391834AbfC0SgO (ORCPT ); Wed, 27 Mar 2019 14:36:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389437AbfC0SYF (ORCPT ); Wed, 27 Mar 2019 14:24:05 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F40542063F; Wed, 27 Mar 2019 18:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553711044; bh=N2D3tRTCEJe65RgguQNsfrN0M4cgYkispMOAjYJ+6Os=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=prhFooA6Uf10Uime07wk/doNI+OJwZvvbuRaTN6fGCxnknGWL4cvsspa2EFLa2PI6 9ahaACZXTQ46zZANMHHYgOim/OBC8sw5ipkQ2fHoeQu2+U+N0kWUSssqNZLt7Vq6Kv SljzLFL4Y+Bh/jWTP9XXIY/qn+zTM4Ki9hPMQ4Ss= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Aaro Koskinen , Ulf Hansson , Sasha Levin , linux-omap@vger.kernel.org, linux-mmc@vger.kernel.org Subject: [PATCH AUTOSEL 4.4 24/63] mmc: omap: fix the maximum timeout setting Date: Wed, 27 Mar 2019 14:22:44 -0400 Message-Id: <20190327182323.18577-24-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182323.18577-1-sashal@kernel.org> References: <20190327182323.18577-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aaro Koskinen [ Upstream commit a6327b5e57fdc679c842588c3be046c0b39cc127 ] When running OMAP1 kernel on QEMU, MMC access is annoyingly noisy: MMC: CTO of 0xff and 0xfe cannot be used! MMC: CTO of 0xff and 0xfe cannot be used! MMC: CTO of 0xff and 0xfe cannot be used! [ad inf.] Emulator warnings appear to be valid. The TI document SPRU680 [1] ("OMAP5910 Dual-Core Processor MultiMedia Card/Secure Data Memory Card (MMC/SD) Reference Guide") page 36 states that the maximum timeout is 253 cycles and "0xff and 0xfe cannot be used". Fix by using 0xfd as the maximum timeout. Tested using QEMU 2.5 (Siemens SX1 machine, OMAP310), and also checked on real hardware using Palm TE (OMAP310), Nokia 770 (OMAP1710) and Nokia N810 (OMAP2420) that MMC works as before. [1] http://www.ti.com/lit/ug/spru680/spru680.pdf Fixes: 730c9b7e6630f ("[MMC] Add OMAP MMC host driver") Signed-off-by: Aaro Koskinen Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 5bcf4f45f8b4..20d422558fa3 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -921,7 +921,7 @@ static inline void set_cmd_timeout(struct mmc_omap_host *host, struct mmc_reques reg &= ~(1 << 5); OMAP_MMC_WRITE(host, SDIO, reg); /* Set maximum timeout */ - OMAP_MMC_WRITE(host, CTO, 0xff); + OMAP_MMC_WRITE(host, CTO, 0xfd); } static inline void set_data_timeout(struct mmc_omap_host *host, struct mmc_request *req) -- 2.19.1