Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7484942imm; Thu, 28 Jun 2018 04:42:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcLbDnebRsP1lQgb356HhKy/TtAOiLGcZp5i3NBDYuhUqK3uB6uMTUCx5Tkz2EwI9T5PWg5 X-Received: by 2002:a65:4c87:: with SMTP id m7-v6mr8466575pgt.98.1530186156829; Thu, 28 Jun 2018 04:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530186156; cv=none; d=google.com; s=arc-20160816; b=ZsTHOG6agT2ZfuNGHumyC2reIIKUBJpvTGEtpBXiVod5Kg42XuzvpY2d9FcJYdrkkY alFPpb1JP0UvZemMBilsyByi8Bo95GqFtBbJFDEcjFn0nVuC0iAro5Ro10g9EFwnKHh2 H+XXnX5QjX4izeCCv57o6DzsfepAW8eGtqXDI+akp4t+/+Mv6yWwWALS2fDe2XAbPebi NhkNfmd60vYUVhgA9DeLNEV5YjJyDVK1nFcBnSxPINBZGZE3lAswO1uA/Ig5pFXljtkx Raa128+vwiw+S3Pam2CEsW3tmmf89weuObpCN5lsIXaMC0ANsDxEuMu1MAUAgwsMJz9V 5kUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=TV4dO9CdRprHf1lfaQyotRyhycoAV0bU9GYTlGUzAxc=; b=VTxWtmZAhJHjygdWg1jPJVAwI9Axc3kLc9ab2NkyYqB/hPyxa59XStvY0QBy7ss4D9 hVGiWnSbeJcnNJZXjHyIr1rG+rz8GiQ1We2oSYibk6U64VW2Yy5W3vlamA/toyTbU2Pu Hs82SrGStGGaNK80Cqp/FtvvNtA3k2oWFtATztfpZ9goRqj/ncMNFbPbaDFUvwQnqEQK TGNgfEF3O9N5CSdKrX8S39uCX5yAPvcI0dma/r6TyBVQ4tzeG3o4H5lK44/gpj4YMKbY Udf3GmcMWA20wlME+Abo9qgHRgL3mnqlBeiCTl+xWX2Z1XprNgP1Rb5pDALTqcaayWDm NF5g== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k184-v6si5747068pge.209.2018.06.28.04.42.19; Thu, 28 Jun 2018 04:42:36 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934442AbeF1JEe (ORCPT + 99 others); Thu, 28 Jun 2018 05:04:34 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36031 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932262AbeF1JD5 (ORCPT ); Thu, 28 Jun 2018 05:03:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F0C9C401B3C4; Thu, 28 Jun 2018 09:03:56 +0000 (UTC) Received: from shalem.localdomain.com (unknown [10.36.118.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id D05DA2026D69; Thu, 28 Jun 2018 09:03:55 +0000 (UTC) From: Hans de Goede To: Bartlomiej Zolnierkiewicz , Petr Mladek , Sergey Senozhatsky Cc: Hans de Goede , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Steven Rostedt , linux-kernel@vger.kernel.org Subject: [PATCH v5 2/3] fbcon: Call WARN_CONSOLE_UNLOCKED() where applicable Date: Thu, 28 Jun 2018 11:03:50 +0200 Message-Id: <20180628090351.15581-3-hdegoede@redhat.com> In-Reply-To: <20180628090351.15581-1-hdegoede@redhat.com> References: <20180628090351.15581-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 28 Jun 2018 09:03:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 28 Jun 2018 09:03:57 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'hdegoede@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace comments about places where the console lock should be held with calls to WARN_CONSOLE_UNLOCKED() to assert that it is actually held. Acked-by: Steven Rostedt (VMware) Reviewed-by: Daniel Vetter Reviewed-by: Sergey Senozhatsky Signed-off-by: Hans de Goede --- Changes in v3: -New patch in v3 of this patchset Changes in v4: -Keep the comments about which fbcon functions need locks in place --- drivers/video/fbdev/core/fbcon.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index c910e74d46ff..cd8d52a967aa 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -828,6 +828,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; @@ -3044,6 +3046,8 @@ static int fbcon_fb_unbind(int idx) { int i, new_idx = -1, ret = 0; + WARN_CONSOLE_UNLOCKED(); + if (!fbcon_has_console_bind) return 0; @@ -3094,6 +3098,8 @@ 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) @@ -3131,6 +3137,9 @@ static int fbcon_fb_unregistered(struct fb_info *info) 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); @@ -3177,6 +3186,8 @@ static int fbcon_fb_registered(struct fb_info *info) { int ret = 0, i, idx; + WARN_CONSOLE_UNLOCKED(); + idx = info->node; fbcon_select_primary(info); -- 2.17.1