Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5493335imm; Tue, 26 Jun 2018 12:13:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcnqGP1EU2RdIC3EAQ8BD05r7Nesy2ScdJ/MdPQJLIkxALwqWhmcgk1uY6xfCrgS8grUJgh X-Received: by 2002:a62:2253:: with SMTP id i80-v6mr2739567pfi.11.1530040435714; Tue, 26 Jun 2018 12:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530040435; cv=none; d=google.com; s=arc-20160816; b=eZZCx5D7W/ypxrHrUMuq4Lykmg9lbIgXmtsRHNTP/FbrHyM5uyoqrNYCY4i2P6Mq+7 QEwjAS6NMiAIBvgHqHZQc0Z/A1hhX9u8P2uXmeNzlhILm/fQM01VLnTWEPpaULnAWruk I8YSbgPr9/n46DGrb1ZXbN3N3Fj2bbBJyxRRsDt3D4a4fL8Bs1VhT6MgMz7JCQgMhAXs XODw5IthOnZSUCHVaxcY8t6nJZRv9hmE4TzqeL9pL1Q+x5QfObmjvL/he+eGy+JFnIuX LmuWr/LGMM6OvUd3hizQGDH/sDBuiuXWp2JHFiBF5aQ2+OwUg7nQEXfAKkr3xB+6D17w wjlg== 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=viAztfLdSgfa/L2/Yl0MiuuiKyk1lR1hcPlTP2f6CSE=; b=QXAx0+zLFH44C4DglB455L4QA1grWFd8plQT4BCx3bQYOpgkBSG8Sv0rBeVerOJPVj DuIU5t4t6k045qhqZnJCQq80Ywv/H/81JmH56ueYoV1sLoiqTFaciHcFKxUQOLcBOJpr gedaWd+q98eian2YDIatuS2dr7PneBxyNXU9cY48jiMPff8liPTWZ5UhOjTqtFy3V80E ei3wdiooo9t0LjOemcEd3il839VerOgeh8zSW/1eIzoN5yabI54Zkf/lstyjWd5CLL0W Q66sslx+1cmBRfqnBR7TN1XLfG6XY7taXiEivYIbIG11hNhNx4zKUyzyTHY1U/O80Msm ikaw== 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 d7-v6si2192358pfl.122.2018.06.26.12.13.41; Tue, 26 Jun 2018 12:13:55 -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 S1754947AbeFZSgW (ORCPT + 99 others); Tue, 26 Jun 2018 14:36:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38618 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754938AbeFZSgS (ORCPT ); Tue, 26 Jun 2018 14:36:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C958402178A; Tue, 26 Jun 2018 18:36:18 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id D61D3111763E; Tue, 26 Jun 2018 18:36:16 +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 v3 2/3] fbcon: Call WARN_CONSOLE_UNLOCKED() where applicable Date: Tue, 26 Jun 2018 20:36:11 +0200 Message-Id: <20180626183612.321-3-hdegoede@redhat.com> In-Reply-To: <20180626183612.321-1-hdegoede@redhat.com> References: <20180626183612.321-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 26 Jun 2018 18:36:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 26 Jun 2018 18:36:18 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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. Reviewed-by: Daniel Vetter 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