From patchwork Tue Jan 15 14:47:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 1979101 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4936CDF2E5 for ; Tue, 15 Jan 2013 14:47:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756494Ab3AOOrW (ORCPT ); Tue, 15 Jan 2013 09:47:22 -0500 Received: from cantor2.suse.de ([195.135.220.15]:56260 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753800Ab3AOOrU (ORCPT ); Tue, 15 Jan 2013 09:47:20 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id F1DB5A5207; Tue, 15 Jan 2013 15:47:18 +0100 (CET) Date: Tue, 15 Jan 2013 15:47:18 +0100 Message-ID: From: Takashi Iwai To: Andrew Morton Cc: sedat.dilek@gmail.com, Jiri Kosina , linux-fbdev@vger.kernel.org, LKML , alan@lxorguk.ukuu.org.uk Subject: Re: 3.8-rc2 lockdep complains about console_lock vs. fb_notifier_list.rwsem In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org At Tue, 15 Jan 2013 15:25:18 +0100, Takashi Iwai wrote: > > At Sat, 5 Jan 2013 13:13:27 +0100, > Sedat Dilek wrote: > > > > Hi Jiri, > > > > ...known issue (see thread in [1]), please feel free to test patches > > from Alan and Andrew (see [1], [2] and [3]) and report. > > > > Regards, > > - Sedat - > > > > [1] http://marc.info/?t=135309396400003&r=1&w=2 > > [2] http://ozlabs.org/~akpm/mmots/broken-out/fb-rework-locking-to-fix-lock-ordering-on-takeover.patch > > [3] http://ozlabs.org/~akpm/mmots/broken-out/fb-rework-locking-to-fix-lock-ordering-on-takeover-fix.patch > > [4] http://ozlabs.org/~akpm/mmots/broken-out/fb-rework-locking-to-fix-lock-ordering-on-takeover-fix-2.patch > > I've hit this bug and tried the patch [2] ([3] and [4] are gone). > Unfortunately the deadlock is still reported, as seen below. > > A similar fix for fbcon_unbind(), splitting an unlocked version of > unbind_con_driver() and call it? > > (BTW, the patch [2] contains strange characters in the comments, and > has a few coding issues easily detected by checkpatch.pl.) The fix patch for coding issue is below. Feel free to fold into the original patch. Takashi === From: Takashi Iwai Subject: [PATCH] fb: Fix coding style and remove stray non-ascii chars Signed-off-by: Takashi Iwai --- drivers/tty/vt/vt.c | 4 ++-- drivers/video/console/fbcon.c | 3 +-- drivers/video/fbmem.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index f307196..1db1c8d 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -3653,7 +3653,7 @@ int do_take_over_console(const struct consw *csw, int first, int last, int deflt /* * If we get an busy error we still want to bind the console driver * and return success, as we may have unbound the console driver -  * but not unregistered it. + * but not unregistered it. */ if (err == -EBUSY) err = 0; @@ -3679,7 +3679,7 @@ int take_over_console(const struct consw *csw, int first, int last, int deflt) /* * If we get an busy error we still want to bind the console driver * and return success, as we may have unbound the console driver -  * but not unregistered it. + * but not unregistered it. */ if (err == -EBUSY) err = 0; diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index c75f8ce..4bd7820 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -546,9 +546,8 @@ static int do_fbcon_takeover(int show_logo) fbcon_is_default); if (err) { - for (i = first_fb_vc; i <= last_fb_vc; i++) { + for (i = first_fb_vc; i <= last_fb_vc; i++) con2fb_map[i] = -1; - } info_idx = -1; } else { fbcon_has_console_bind = 1; diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 564ebe9..d8d9831 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -1650,9 +1650,9 @@ static int do_register_framebuffer(struct fb_info *fb_info) event.info = fb_info; if (!lock_fb_info(fb_info)) return -ENODEV; - console_lock(); + console_lock(); fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); - console_unlock(); + console_unlock(); unlock_fb_info(fb_info); return 0; }