From patchwork Sat Apr 6 06:13:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 2400911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id D3C6B3FD40 for ; Sat, 6 Apr 2013 06:14:19 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UOMNx-0001sK-Af; Sat, 06 Apr 2013 06:13:57 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UOMNu-0006Uo-Vo; Sat, 06 Apr 2013 06:13:54 +0000 Received: from smtp13.mail.ru ([94.100.176.90]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UOMNq-0006US-9B for linux-arm-kernel@lists.infradead.org; Sat, 06 Apr 2013 06:13:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Message-Id:Date:Subject:Cc:To:From; bh=eF7ZrWqDzuw7pmhD0LTrecNieli9SynpZn8fCcacUiY=; b=ob9be+oOkutJjLwScG9idd0qsOodsuIZc2Q3sixc11XF2jxzxz5ApBgbNo0sp0WK6GIrUKHnta7hMi9eulmdTzvvYbRhxLTKNfizrV+Pi1ra+uQk4ebHynJp9FFT7WAIzBzzveuWpbCqc8FQHoZjDLHyUMBXEuZNUjzjDEvXg1k=; Received: from [188.134.40.128] (port=23791 helo=shc.zet) by smtp13.mail.ru with esmtpa (envelope-from ) id 1UOMNj-0002qr-E7; Sat, 06 Apr 2013 10:13:43 +0400 From: Alexander Shiyan To: linux-mmc@vger.kernel.org Subject: [PATCH] mmc: mxcmmc: Fix bug when card is present during boot Date: Sat, 6 Apr 2013 10:13:31 +0400 Message-Id: <1365228811-10928-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 X-Spam: Not detected X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130406_021350_800937_D204A406 X-CRM114-Status: GOOD ( 13.62 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (shc_work[at]mail.ru) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [94.100.176.90 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Alexander Shiyan , Arnd Bergmann , Sascha Hauer , Javier Martin , Chris Ball , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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 This patch fixes bug when card is present during boot. Bug was introduced due commit "mmc: mxcmmc: fix bug that may block a data transfer forever". When a card is present "mxcmci_setup_data" function is executed, but the timer is not initialized. ... i.MX SDHC driver mmc0: SD Status: Invalid Allocation Unit size. mmc0: new SD card at address b368 mmcblk0: mmc0:b368 SDC 1.91 GiB ------------[ cut here ]------------ kernel BUG at kernel/timer.c:729! Internal error: Oops - BUG: 0 [#1] PREEMPT ARM CPU: 0 Not tainted (3.9.0-rc5-next-20130404 #2) PC is at mod_timer+0x168/0x198 LR is at mxcmci_request+0x21c/0x328 pc : [] lr : [] psr: 60000013 sp : c7933df0 ip : 00001000 fp : 00000001 r10: c0012edc r9 : c7920400 r8 : c014f92c r7 : c7920600 r6 : ffff8f8f r5 : ffff8f8f r4 : c79206a4 r3 : 00000000 r2 : 00000000 r1 : ffff8f8f r0 : c79206a4 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 0005317f Table: a0004000 DAC: 00000017 Process mmcqd/0 (pid: 450, stack limit = 0xc79321b8) Stack: (0xc7933df0 to 0xc7934000) 3de0: c78260f8 00000000 00000001 c78dcce0 3e00: c78dcc2c 00000200 c7920600 c014f92c c0012edc c0261928 00000003 00000000 3e20: 00000000 c7874210 c78dc800 00000002 c790f720 c78dcc2c c7920400 00000001 3e40: c78dcd20 00000001 c7933ee4 00000000 c78dcc2c c02504f0 00000000 c7920400 3e60: 00000000 c0251588 c7a60138 c7920000 c78dcc2c c78dcc04 c78dcc00 00000000 3e80: 00000000 c025de34 c78dcc04 c7a60138 c78dcc28 c78dcc04 c7920000 c7a60138 3ea0: c7920400 c78dcc00 c78dcc2c c025ed3c c7933f44 00000000 c78dcc00 00000000 3ec0: 00000000 c0037af0 00000000 c7932000 40000013 c0250d50 c7933f6c 00000000 3ee0: c78cb6c0 c003f6b8 00100100 c7920000 c7a60138 c78dcc04 c78dcc00 120d0000 3f00: c7920400 c78dcc00 c78dcc0c c025f918 c7847d34 00000001 c7847d40 00000000 3f20: c7933f54 c78dcc04 c7a60138 c7932000 00000000 120d0000 c7996b80 00000001 3f40: c78dcc0c c0260410 00000000 c7847d2c 00000000 c78dcc04 c0260358 00000000 3f60: 00000000 00000000 00000000 c0037094 00000000 00000000 2d656761 c78dcc04 3f80: 00000000 c7933f84 c7933f84 00000000 c7933f90 c7933f90 c7933fac c7847d2c 3fa0: c0036ff0 00000000 00000000 c000e210 00000000 00000000 00000000 00000000 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 7ffff1e5 ef7b8ff9 [] (mod_timer+0x168/0x198) from [] (mxcmci_request+0x21c/0x328) [] (mxcmci_request+0x21c/0x328) from [] (mmc_start_request+0xc4/0xe8) [] (mmc_start_request+0xc4/0xe8) from [] (mmc_start_req+0x2d0/0x380) [] (mmc_start_req+0x2d0/0x380) from [] (mmc_blk_issue_rw_rq+0xb4/0xaf0) [] (mmc_blk_issue_rw_rq+0xb4/0xaf0) from [] (mmc_blk_issue_rq+0x1a0/0x4ec) [] (mmc_blk_issue_rq+0x1a0/0x4ec) from [] (mmc_queue_thread+0xb8/0x150) [] (mmc_queue_thread+0xb8/0x150) from [] (kthread+0xa4/0xb0) [] (kthread+0xa4/0xb0) from [] (ret_from_fork+0x14/0x24) Code: e0065015 eaffffb3 e3a0a001 eaffffea (e7f001f2) ---[ end trace 29f2f8ea54d9d99e ]--- Signed-off-by: Alexander Shiyan Acked-by: Sascha Hauer --- drivers/mmc/host/mxcmmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index a72936e..28e527e 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -1052,12 +1052,12 @@ static int mxcmci_probe(struct platform_device *pdev) goto out_free_irq; } - mmc_add_host(mmc); - init_timer(&host->watchdog); host->watchdog.function = &mxcmci_watchdog; host->watchdog.data = (unsigned long)mmc; + mmc_add_host(mmc); + return 0; out_free_irq: