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: 2400901 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1039C3FD40 for ; Sat, 6 Apr 2013 06:14:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752516Ab3DFGON (ORCPT ); Sat, 6 Apr 2013 02:14:13 -0400 Received: from fallback3.mail.ru ([94.100.176.58]:60261 "EHLO fallback3.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358Ab3DFGOM (ORCPT ); Sat, 6 Apr 2013 02:14:12 -0400 Received: from smtp13.mail.ru (smtp13.mail.ru [94.100.176.90]) by fallback3.mail.ru (mPOP.Fallback_MX) with ESMTP id 3B737DD1F7B9 for ; Sat, 6 Apr 2013 10:14:06 +0400 (MSK) 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 Cc: linux-arm-kernel@lists.infradead.org, Javier Martin , Chris Ball , Sascha Hauer , Arnd Bergmann , Alexander Shiyan 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 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.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: