Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1766049ybi; Sat, 25 May 2019 08:39:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxv5QAsHMzdDzPtP0sjjwi6tukhbTDlyD0+oSxlOwBl21V/3SuviSxO7KVOwXw+KgvZO/8D X-Received: by 2002:a17:902:9698:: with SMTP id n24mr29490098plp.118.1558798792669; Sat, 25 May 2019 08:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558798792; cv=none; d=google.com; s=arc-20160816; b=RXBNHoA5QxIg5YIQ264BkiomF/OQkrZBXtxEKqBuJ78PBdVqbt8l3voQ7LgVenu2WF IBD3WNFpGVa1PZO1izHRDDvYl/DdZAUpAnCmLP9WHApm3kyviNAaPHqRL65C7ukv3n0S 3Jjki0dr7asJLtCjl2n1JBehT0QuCTomBNORsj/wjrvJuHqmzGOBvm8q2edviKpDEKZr 7B/+Ni7FinqtFZB52wK+3nNgHLH+IwtYgXEqZTnuSuGx/3gPbh0IErvX/0sI6sXhFYfd ENaOMXxCqAMSHLH+6XzDtSN2s55/BqloAg5ApdrMRWzwqf+C56EFWSBoux5tgEhEiLiz 8VmQ== 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:message-id:subject:cc :to:from:date; bh=WK5YMCmbrutKYK2y8og+u6jyp7U4m0cf7ziKUsdY1BY=; b=CAT4xPay24SzP1IpdR3iW+yghNfWjvqT1d/FGU71V79awlFtXvnCW3z2o30F3e22PM PduqOt+WNddRRVQ52Tz/p/p81GbkyPvycvmHvjbimcsW6KnnF0mRgARHZTpeq0GCKoRn nTTv3r2DXT8yRYCduVnG9GahfLRNDUIB8S8hvQiLowIsmT3tuFiVLeFmkSKqjuoU/gF6 r1zPIbsFkPx+1CYBLWC51rdc6oLHjbfcdTOvzXTzkjmpJlWNDvFTV1gkPoxQKWNMLCSJ x8lRJbNr2sA8nyCPN7MeyVix0W6Ld+9387KMV40LUJ76U6vOEE8QUG33vUU6kYCpHRRm +lrg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z27si8619865pga.47.2019.05.25.08.39.37; Sat, 25 May 2019 08:39:52 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727096AbfEYPid (ORCPT + 99 others); Sat, 25 May 2019 11:38:33 -0400 Received: from asavdk3.altibox.net ([109.247.116.14]:41204 "EHLO asavdk3.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbfEYPic (ORCPT ); Sat, 25 May 2019 11:38:32 -0400 Received: from ravnborg.org (unknown [158.248.194.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk3.altibox.net (Postfix) with ESMTPS id 8CEE0200EF; Sat, 25 May 2019 17:38:27 +0200 (CEST) Date: Sat, 25 May 2019 17:38:26 +0200 From: Sam Ravnborg To: Daniel Vetter Cc: LKML , Prarit Bhargava , Kees Cook , Bartlomiej Zolnierkiewicz , Intel Graphics Development , DRI Development , Yisheng Xie , Hans de Goede , Daniel Vetter , Konstantin Khorenko Subject: Re: [PATCH 09/33] fbcon: Remove fbcon_has_exited Message-ID: <20190525153826.GA8661@ravnborg.org> References: <20190524085354.27411-1-daniel.vetter@ffwll.ch> <20190524085354.27411-10-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190524085354.27411-10-daniel.vetter@ffwll.ch> User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=dqr19Wo4 c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=e5mUnYsNAAAA:8 a=DzVgexfn9IsVGKuEcHIA:9 a=mS0BKyo6H8Xd97p-:21 a=5wqHtdtA96AT7Bqp:21 a=CjuIK1q_8ugA:10 a=Vxmtnl_E_bksehYqCbjh:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel. One detail I noticed while brosing the changes. > > @@ -1064,9 +1062,13 @@ static void fbcon_init(struct vc_data *vc, int init) > int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256; > int cap, ret; > > - if (info_idx == -1 || info == NULL) > + if (WARN_ON(info_idx == -1)) > return; > > + if (con2fb_map[vc->vc_num] == -1) > + con2fb_map[vc->vc_num] = info_idx; > + > + info = registered_fb[con2fb_map[vc->vc_num]]; > cap = info->flags; When info is defined it is also assigned: struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; As the test for info is gone this assignment is no longer requrired and can be deleted. The code now assumes that there is always an fb_info if con2fb_map[] is not set to -1. I could not determine if this is OK, but this likely boils down to your locking concern of registered_fb. Sam > > if (logo_shown < 0 && console_loglevel <= CONSOLE_LOGLEVEL_QUIET) > @@ -3336,14 +3338,6 @@ static int fbcon_event_notify(struct notifier_block *self, > struct fb_blit_caps *caps; > int idx, ret = 0; > > - /* > - * ignore all events except driver registration and deregistration > - * if fbcon is not active > - */ > - if (fbcon_has_exited && !(action == FB_EVENT_FB_REGISTERED || > - action == FB_EVENT_FB_UNREGISTERED)) > - goto done; > - > switch(action) { > case FB_EVENT_SUSPEND: > fbcon_suspended(info); > @@ -3396,7 +3390,6 @@ static int fbcon_event_notify(struct notifier_block *self, > fbcon_remap_all(idx); > break; > } > -done: > return ret; > } > > @@ -3443,9 +3436,6 @@ static ssize_t store_rotate(struct device *device, > int rotate, idx; > char **last = NULL; > > - if (fbcon_has_exited) > - return count; > - > console_lock(); > idx = con2fb_map[fg_console]; > > @@ -3468,9 +3458,6 @@ static ssize_t store_rotate_all(struct device *device, > int rotate, idx; > char **last = NULL; > > - if (fbcon_has_exited) > - return count; > - > console_lock(); > idx = con2fb_map[fg_console]; > > @@ -3491,9 +3478,6 @@ static ssize_t show_rotate(struct device *device, > struct fb_info *info; > int rotate = 0, idx; > > - if (fbcon_has_exited) > - return 0; > - > console_lock(); > idx = con2fb_map[fg_console]; > > @@ -3514,9 +3498,6 @@ static ssize_t show_cursor_blink(struct device *device, > struct fbcon_ops *ops; > int idx, blink = -1; > > - if (fbcon_has_exited) > - return 0; > - > console_lock(); > idx = con2fb_map[fg_console]; > > @@ -3543,9 +3524,6 @@ static ssize_t store_cursor_blink(struct device *device, > int blink, idx; > char **last = NULL; > > - if (fbcon_has_exited) > - return count; > - > console_lock(); > idx = con2fb_map[fg_console]; > > @@ -3668,9 +3646,6 @@ static void fbcon_exit(void) > struct fb_info *info; > int i, j, mapped; > > - if (fbcon_has_exited) > - return; > - > #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER > if (deferred_takeover) { > dummycon_unregister_output_notifier(&fbcon_output_nb); > @@ -3695,7 +3670,7 @@ static void fbcon_exit(void) > for (j = first_fb_vc; j <= last_fb_vc; j++) { > if (con2fb_map[j] == i) { > mapped = 1; > - break; > + con2fb_map[j] = -1; > } > } > > @@ -3718,8 +3693,6 @@ static void fbcon_exit(void) > info->queue.func = NULL; > } > } > - > - fbcon_has_exited = 1; > } > > void __init fb_console_init(void) > -- > 2.20.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel