Return-Path: Received: from wolverine01.qualcomm.com ([199.106.114.254]:42688 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687Ab0LHGEy (ORCPT ); Wed, 8 Dec 2010 01:04:54 -0500 Subject: Re: [PATCH 1/5] mmc: msm_sdcc: Fix possible circular locking dependency warning From: Sahitya Tummala In-Reply-To: <1291745753.8000.3.camel@c-dwalke-linux.qualcomm.com> References: <1291719316-23948-1-git-send-email-stummala@codeaurora.org> <1291745753.8000.3.camel@c-dwalke-linux.qualcomm.com> Content-Type: text/plain Date: Wed, 08 Dec 2010 11:34:44 +0530 Message-Id: <1291788284.21924.32.camel@stummala-linux.in.qualcomm.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: Daniel Walker Cc: cjb@laptop.org, linux-mmc@vger.kernel.org, san@google.com, linux-arm-msm@vger.kernel.org Hi Daniel, On Tue, 2010-12-07 at 10:15 -0800, Daniel Walker wrote: > Can you provide and example of the warning ? Not in the commit, but in > this thread. This patch fixes the following warning - ======================================================= [ INFO: possible circular locking dependency detected ] 2.6.37-rc2-g7559620 #58 ------------------------------------------------------- init/1 is trying to acquire lock: (&(&host->lock)->rlock){-.....}, at: [] msmsdcc_dma_complete_func+0x20/0x26c but task is already holding lock: (msm_dmov_lock){-.....}, at: [] msm_datamover_irq_handler +0x14/0x594 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (msm_dmov_lock){-.....}: [] lock_acquire+0x88/0x9c [] _raw_spin_lock_irqsave+0x48/0x5c [] msm_dmov_enqueue_cmd+0x14/0x1ac [] msmsdcc_start_data+0x3a4/0x4d8 [] msmsdcc_request+0x15c/0x20c [] mmc_wait_for_req+0x148/0x164 [] mmc_app_sd_status+0xec/0x10c [] mmc_sd_setup_card+0xc4/0x304 [] mmc_sd_init_card+0x130/0x1d4 [] mmc_attach_sd+0x110/0x198 [] mmc_rescan+0x298/0x314 [] process_one_work+0x254/0x408 [] worker_thread+0x1b8/0x2d8 [] kthread+0x84/0x8c [] kernel_thread_exit+0x0/0x8 -> #0 (&(&host->lock)->rlock){-.....}: [] __lock_acquire+0x1118/0x1838 [] lock_acquire+0x88/0x9c [] _raw_spin_lock_irqsave+0x48/0x5c [] msmsdcc_dma_complete_func+0x20/0x26c [] msm_datamover_irq_handler+0x1dc/0x594 [] handle_IRQ_event+0x24/0xe8 [] handle_level_irq+0xc0/0x140 [] asm_do_IRQ+0x74/0x98 [] __irq_svc+0x50/0x98 [] lock_acquire+0x94/0x9c [] down_read+0x48/0x5c [] sys_newuname+0x10/0x78 [] ret_fast_syscall+0x0/0x3c other info that might help us debug this: 2 locks held by init/1: #0: (uts_sem){.+.+..}, at: [] sys_newuname+0x10/0x78 #1: (msm_dmov_lock){-.....}, at: [] msm_datamover_irq_handler+0x14/0x594 stack backtrace: [] (unwind_backtrace+0x0/0xec) from [] (print_circular_bug+0xc8/0xe0) [] (print_circular_bug+0xc8/0xe0) from [] (__lock_acquire+0x1118/0x1838) [] (__lock_acquire+0x1118/0x1838) from [] (lock_acquire+0x88/0x9c) [] (lock_acquire+0x88/0x9c) from [] (_raw_spin_lock_irqsave+0x48/0x5c) [] (_raw_spin_lock_irqsave+0x48/0x5c) from [] (msmsdcc_dma_complete_func+0x20/0x26c) [] (msmsdcc_dma_complete_func+0x20/0x26c) from [] (msm_datamover_irq_handler+0x1dc/0x594) [] (msm_datamover_irq_handler+0x1dc/0x594) from [] (handle_IRQ_event+0x24/0xe8) [] (handle_IRQ_event+0x24/0xe8) from [] (handle_level_irq+0xc0/0x140) [] (handle_level_irq+0xc0/0x140) from [] (asm_do_IRQ +0x74/0x98) [] (asm_do_IRQ+0x74/0x98) from [] (__irq_svc +0x50/0x98) Exception stack(0xc7823ef8 to 0xc7823f40) 3ee0: 00000001 000000db 3f00: c08158e0 c7821240 00000000 60000013 c7822000 00000000 00000000 00000001 3f20: 00000000 c02e7360 c7821658 c7823f40 c006157c c0061624 80000013 ffffffff [] (__irq_svc+0x50/0x98) from [] (lock_acquire +0x94/0x9c) [] (lock_acquire+0x94/0x9c) from [] (down_read +0x48/0x5c) [] (down_read+0x48/0x5c) from [] (sys_newuname +0x10/0x78) [] (sys_newuname+0x10/0x78) from [] (ret_fast_syscall+0x0/0x3c) mmc0: host does not support reading read-only switch. assuming write-enable. mmc0: new high speed SDHC card at address 0007 mmcblk0: mmc0:0007 SD8GB 7.63 GiB mmcblk0: p1 Thanks, Sahitya. -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.