Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5301966imm; Tue, 26 Jun 2018 09:01:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJT3osvzyaF9Q9FDbvXYPdAVZDIOYUjh11bDMAOyZhTH5S16xWXajUWpLowVdb1PVy65dDE X-Received: by 2002:a17:902:5991:: with SMTP id p17-v6mr2198513pli.191.1530028889728; Tue, 26 Jun 2018 09:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530028889; cv=none; d=google.com; s=arc-20160816; b=Wb8aScRg/UHHVTdq7jAKsO+7yZ7+2L6nKJj74LMAqnlgSnffWhmYa9N5qZtKU1JXgF SmCmeK6zTfYYeix2mspKlpWLHTFTZp4LGe89LGV4NlCT7cEBToFHvvcrWO19XswU7gRf Yysr41pgBJaEbnm2EcsUbT13HaPwvJgRofmTVzmCYANzZtPOeb9rQ1C9pdWeGcef/lMQ lqiRAnA2kdO1sqFG99AsgKqXTy+PZRr0gG3fNZqnir0P0LyAUUAzsbAqYxSd23K7CzMY IwS+X4tDLSnsTMFPBCFDMC+8aIvFb0xjvhuOEy8+yI7HKiP5UN346NKkiB/NJMWpoBu3 NZbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=9GxP77a/HT1dinUR07gQ7KErhE3Vh8p3vBOZ39TUFFE=; b=tBWNfQBn86hnLJ8605XbEFZM7erf3fRFmiACPoMYIsQuzSzQk5bcC43IqynuWhkbes iR8rmtOgmJfFF8XVd6eNmDdwefsLDZcPuq1jTC30ODG2uq/MZmRE2s4a332lcY5WQ+Xx RaWOM8nqZoyQiXDmdF0zhFg4oyJQVCoEwUV6vlVY4KeZexXTDLBtGPaf9O9jX3uiDgi1 QQ6Goc72KeEYil3OWJPBePCd4OYzSZ0G8GPm2RXGUlrvxVum4cqqv6i/7yKujGBFTqcE janUdm4RK95go6OCIfxXIlTQRTwF/2CMFPlIHAD/Hb84mdR2HZE4l90s1+gTDSZhpbt9 /mng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=h1c+bfwh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6-v6si1703858pgm.306.2018.06.26.09.01.14; Tue, 26 Jun 2018 09:01:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=h1c+bfwh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965773AbeFZOBD (ORCPT + 99 others); Tue, 26 Jun 2018 10:01:03 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:35947 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965453AbeFZOBB (ORCPT ); Tue, 26 Jun 2018 10:01:01 -0400 Received: by mail-ed1-f65.google.com with SMTP id t3-v6so1071937eds.3 for ; Tue, 26 Jun 2018 07:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=9GxP77a/HT1dinUR07gQ7KErhE3Vh8p3vBOZ39TUFFE=; b=h1c+bfwhKoAnhRrUP/YICjPJ7RHytTqHGF8RxjhmcW1ws33rBW72yeCoiwW/4K5Me+ ixsj1mj99CbUDPKi8Dg1/jn9VE+kPoTBjF63iCgiZlLnv8w1sMv3fPRkiDs+jWd79/BP yHIFbxCIaVLCqbVkRL0zkalczFtj2EIe1GVZk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=9GxP77a/HT1dinUR07gQ7KErhE3Vh8p3vBOZ39TUFFE=; b=PeAG7EGZpU7OOrU+UFbjPQsP9sfqh6kPncJdwlkVqGgjr1b7qmhzObswwMeswetQzZ hTtSVs4I5lcyBX3RiarRprtUYUQgqDgmhhV+IfIS3XsARvzD+zMwRMGr9pjjSuQXkiyA xuULQkLv3BbCCQ6smmXS3ff8cw/KL9fVQFx4YOCRJ6XE5CWdsIJGwMWPIVrSEdLXADGr zwdxFRUqlEP5ooOuhz90YkkB2Yf4LGZwW/mlPT9FT/doTx9dO2Np5W4Q08rUBl0LmcUx HAYKL0G+Pn7ozswEhoOAVo62Yebssy/mdFcFqRmEvrG77TjjBg2RIti8jEvHj3juiqUd 1pIg== X-Gm-Message-State: APt69E3IqfsdXhjLz9gTnJMOcWwJ5JvQJlHguSIsqXo1MyAy55gEMuT1 qvNF1L025kSjHBblMZCglh7GTQ== X-Received: by 2002:a50:bdc7:: with SMTP id z7-v6mr1966136edh.84.1530021659639; Tue, 26 Jun 2018 07:00:59 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id b32-v6sm954483edd.85.2018.06.26.07.00.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jun 2018 07:00:58 -0700 (PDT) Date: Tue, 26 Jun 2018 16:00:55 +0200 From: Daniel Vetter To: Hans de Goede Cc: Bartlomiej Zolnierkiewicz , Petr Mladek , Sergey Senozhatsky , linux-fbdev@vger.kernel.org, Steven Rostedt , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] fbcon: Call WARN_CONSOLE_UNLOCKED() where applicable Message-ID: <20180626140055.GB13978@phenom.ffwll.local> Mail-Followup-To: Hans de Goede , Bartlomiej Zolnierkiewicz , Petr Mladek , Sergey Senozhatsky , linux-fbdev@vger.kernel.org, Steven Rostedt , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20180626135535.2990-1-hdegoede@redhat.com> <20180626135535.2990-3-hdegoede@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180626135535.2990-3-hdegoede@redhat.com> X-Operating-System: Linux phenom 4.16.0-2-amd64 User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 26, 2018 at 03:55:34PM +0200, Hans de Goede wrote: > Replace comments about places where the console lock should be held with > calls to WARN_CONSOLE_UNLOCKED() to assert that it is actually held. > > Signed-off-by: Hans de Goede > --- > Changes in v3: > -New patch in v3 of this patchset For patches 1&2: Reviewed-by: Daniel Vetter > --- > drivers/video/fbdev/core/fbcon.c | 18 +++++++++++------- > 1 file changed, 11 insertions(+), 7 deletions(-) > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > index c910e74d46ff..ac2cbdf710ee 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -817,8 +817,6 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info, > * > * Maps a virtual console @unit to a frame buffer device > * @newidx. > - * > - * This should be called with the console lock held. > */ > static int set_con2fb_map(int unit, int newidx, int user) > { > @@ -828,6 +826,8 @@ static int set_con2fb_map(int unit, int newidx, int user) > struct fb_info *oldinfo = NULL; > int found, err = 0; > > + WARN_CONSOLE_UNLOCKED(); > + > if (oldidx == newidx) > return 0; > > @@ -3039,11 +3039,12 @@ static inline int fbcon_unbind(void) > } > #endif /* CONFIG_VT_HW_CONSOLE_BINDING */ > > -/* called with console_lock held */ > static int fbcon_fb_unbind(int idx) > { > int i, new_idx = -1, ret = 0; > > + WARN_CONSOLE_UNLOCKED(); > + > if (!fbcon_has_console_bind) > return 0; > > @@ -3089,11 +3090,12 @@ static int fbcon_fb_unbind(int idx) > return ret; > } > > -/* called with console_lock held */ > static int fbcon_fb_unregistered(struct fb_info *info) > { > int i, idx; > > + WARN_CONSOLE_UNLOCKED(); > + > idx = info->node; > for (i = first_fb_vc; i <= last_fb_vc; i++) { > if (con2fb_map[i] == idx) > @@ -3127,10 +3129,12 @@ static int fbcon_fb_unregistered(struct fb_info *info) > return 0; > } > > -/* called with console_lock held */ > static void fbcon_remap_all(int idx) > { > int i; > + > + WARN_CONSOLE_UNLOCKED(); > + > for (i = first_fb_vc; i <= last_fb_vc; i++) > set_con2fb_map(i, idx, 0); > > @@ -3172,11 +3176,12 @@ static inline void fbcon_select_primary(struct fb_info *info) > } > #endif /* CONFIG_FRAMEBUFFER_DETECT_PRIMARY */ > > -/* called with console_lock held */ > static int fbcon_fb_registered(struct fb_info *info) > { > int ret = 0, i, idx; > > + WARN_CONSOLE_UNLOCKED(); > + > idx = info->node; > fbcon_select_primary(info); > > @@ -3325,7 +3330,6 @@ static int fbcon_event_notify(struct notifier_block *self, > ret = fbcon_fb_unregistered(info); > break; > case FB_EVENT_SET_CONSOLE_MAP: > - /* called with console lock held */ > con2fb = event->data; > ret = set_con2fb_map(con2fb->console - 1, > con2fb->framebuffer, 1); > -- > 2.17.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch