Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757495Ab3FFH3E (ORCPT ); Thu, 6 Jun 2013 03:29:04 -0400 Received: from mga02.intel.com ([134.134.136.20]:18329 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754539Ab3FFH3B (ORCPT ); Thu, 6 Jun 2013 03:29:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,813,1363158000"; d="scan'208";a="345654681" Date: Thu, 6 Jun 2013 15:28:56 +0800 From: Fengguang Wu To: Maarten Lankhorst Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [vt_console_print/cirrus_dirty_update] WARNING: at kernel/mutex.c:858 mutex_trylock() Message-ID: <20130606072856.GA32274@localhost> References: <20130606013518.GA9092@localhost> <51B038E3.30800@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51B038E3.30800@canonical.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5218 Lines: 103 Hi Maarten, Thanks for the patch! I'll queue it for the tests. Thanks, Fengguang On Thu, Jun 06, 2013 at 09:23:15AM +0200, Maarten Lankhorst wrote: > Hey, > > Op 06-06-13 03:35, Fengguang Wu schreef: > > Greetings, > > > > I got the below dmesg and the first bad commit is > > > > commit 3d71c6ed43d838e593538176a9a59debe228cfb0 > > Author: Maarten Lankhorst > > Date: Tue Apr 2 12:33:01 2013 +0200 > > > > drm/ttm: convert to the reservation api > > > > Now that the code is compatible in semantics, flip the switch. > > Use ww_mutex instead of the homegrown implementation. > > > > Signed-off-by: Maarten Lankhorst > > > > [ 13.044298] printing local APIC contents on CPU#0/0: > > [ 13.044313] ------------[ cut here ]------------ > > [ 13.044367] WARNING: at /c/kernel-tests/src/tip/kernel/mutex.c:858 mutex_trylock+0x87/0x220() > > [ 13.044378] DEBUG_LOCKS_WARN_ON(in_interrupt()) > > [ 13.044378] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.0-rc4-00296-ga2963dd #20 > > [ 13.044379] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007 > > [ 13.044390] 0000000000000009 ffff88000de039f8 ffffffff81fc86d5 ffff88000de03a38 > > [ 13.044395] ffffffff810d511b ffff880000000018 ffff88000f33c690 0000000000000001 > > [ 13.044398] 00000000000003f0 ffff88000f4677c8 0000000000000000 ffff88000de03a98 > > [ 13.044400] Call Trace: > > [ 13.044412] [] dump_stack+0x19/0x1b > > [ 13.044441] [] warn_slowpath_common+0x6b/0x90 > > [ 13.044445] [] warn_slowpath_fmt+0x46/0x50 > > [ 13.044448] [] mutex_trylock+0x87/0x220 > > [ 13.044482] [] cirrus_dirty_update+0x1cd/0x330 > > [ 13.044486] [] cirrus_imageblit+0x38/0x50 > > [ 13.044506] [] soft_cursor+0x22e/0x240 > > [ 13.044510] [] bit_cursor+0x581/0x5b0 > > [ 13.044525] [] ? vsnprintf+0x124/0x670 > > [ 13.044529] [] ? get_color.isra.16+0x43/0x130 > > [ 13.044532] [] fbcon_cursor+0x18a/0x1d0 > > [ 13.044535] [] ? update_attr.isra.2+0xa0/0xa0 > > [ 13.044556] [] hide_cursor+0x32/0xa0 > > [ 13.044565] [] vt_console_print+0x103/0x3b0 > > [ 13.044569] [] ? print_time+0x9c/0xb0 > > [ 13.044576] [] ? print_prefix+0xa0/0xc0 > > [ 13.044580] [] call_console_drivers.constprop.6+0x146/0x1f0 > > [ 13.044593] [] ? do_raw_spin_unlock+0xc8/0x100 > > [ 13.044597] [] console_unlock+0x2f7/0x460 > > [ 13.044600] [] vprintk_emit+0x59a/0x5e0 > > [ 13.044615] [] printk+0x4d/0x4f > > [ 13.044650] [] print_local_APIC+0x28/0x41c > > [ 13.044672] [] generic_smp_call_function_single_interrupt+0x145/0x2b0 > > [ 13.044688] [] smp_call_function_single_interrupt+0x27/0x40 > > [ 13.044697] [] call_function_single_interrupt+0x72/0x80 > > [ 13.044707] [] ? native_safe_halt+0x6/0x10 > > [ 13.044717] [] ? trace_hardirqs_on+0xd/0x10 > > [ 13.044738] [] default_idle+0x59/0x120 > > [ 13.044742] [] arch_cpu_idle+0x18/0x40 > > [ 13.044754] [] cpu_startup_entry+0x235/0x410 > > [ 13.044763] [] rest_init+0xd1/0xe0 > > [ 13.044766] [] ? rest_init+0x5/0xe0 > > [ 13.044778] [] start_kernel+0x425/0x493 > > [ 13.044781] [] ? repair_env_string+0x5e/0x5e > > [ 13.044786] [] x86_64_start_reservations+0x2a/0x2c > > [ 13.044789] [] x86_64_start_kernel+0xf1/0x100 > > [ 13.044799] ---[ end trace 113ad28772af4058 ]--- > Thanks for catching this, I'm uncertain how to proceed here. Can you try below patch? > > diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c > index 3541b56..b27e956 100644 > --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c > +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c > @@ -25,7 +25,7 @@ static void cirrus_dirty_update(struct cirrus_fbdev *afbdev, > struct cirrus_bo *bo; > int src_offset, dst_offset; > int bpp = (afbdev->gfb.base.bits_per_pixel + 7)/8; > - int ret; > + int ret = -EBUSY; > bool unmap = false; > bool store_for_later = false; > int x2, y2; > @@ -39,7 +39,8 @@ static void cirrus_dirty_update(struct cirrus_fbdev *afbdev, > * then the BO is being moved and we should > * store up the damage until later. > */ > - ret = cirrus_bo_reserve(bo, true); > + if (!in_interrupt()) > + ret = cirrus_bo_reserve(bo, true); > if (ret) { > if (ret != -EBUSY) > return; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/