From patchwork Mon Apr 13 09:16:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 6206721 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 131B49F313 for ; Mon, 13 Apr 2015 09:16:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A7972026C for ; Mon, 13 Apr 2015 09:16:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 40BD52021F for ; Mon, 13 Apr 2015 09:16:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C03B6E21D; Mon, 13 Apr 2015 02:16:32 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 772806E1DD for ; Mon, 13 Apr 2015 02:16:30 -0700 (PDT) Received: by widdi4 with SMTP id di4so44018603wid.0 for ; Mon, 13 Apr 2015 02:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=bVzLZlvy2BNGGSgO8DorPWMlMOY6sHjDy7VN7RejYn4=; b=YsXSbnJyH3U+BC7NxIkuqoYlAkrhxOquvppx8z7pHsY9ce+ApuNstayR8L+qWMpVy+ X0Wl4w+UFUU1lBiDy5g/3ZBwk/v3wFnNGSt96XXBWrpmOjfZKWArOWoBEpjJvTc78dVg wHpOSlT6UkdS7y5p2AxKtMIGNe9IR4G0PAfaQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bVzLZlvy2BNGGSgO8DorPWMlMOY6sHjDy7VN7RejYn4=; b=mWd0xNCQIUDCeDzL45P3ckPtWQYG/cS8iIgusb9QKZktO9nVsDzE36Z7GrkCuFfKRZ jw8+u+iB05XkqlGw1930WVZfelU96jwqqva2nE82jA5nyaxZphIWczCQxKXuFfSdNrn9 AvNyoHBuRJyMIgDMlNSl1PW2yrDoDtKF3MX6RgHEU7ue65i0yYqsMZequJ5Do9DIAbqJ 2NXIN++GGjaqZYIU3ur0/lB8S9EFeSpr0CEKCQs2eqizpayyEF0AZWBJAyne/eSwXEuA 9Mfu5qygk2VFGf8XJ2r+ooyFDSf2wQteNTskLHvu71RNY3RBNgEFqdR6zt0/IN1vSvyl zECQ== X-Gm-Message-State: ALoCoQkDd1xvKKK5xl9ZXX3ATOm/H7jDcg1FZ4RQhXMrf1/NTWFLEWkUPm5i8W8Hn6DpLhY68kFx X-Received: by 10.180.88.8 with SMTP id bc8mr19469868wib.19.1428916589444; Mon, 13 Apr 2015 02:16:29 -0700 (PDT) Received: from wespe.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by mx.google.com with ESMTPSA id mv11sm11822394wic.23.2015.04.13.02.16.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2015 02:16:28 -0700 (PDT) From: Daniel Vetter To: DRI Development , LKML Subject: [PATCH] vt: Don't check KD_GRAPHICS when binding/unbinding Date: Mon, 13 Apr 2015 11:16:21 +0200 Message-Id: <1428916581-13601-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.1.0 Cc: Peter Hurley , Greg Kroah-Hartman , Daniel Vetter , Intel Graphics Development , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This was introduced in commit 6db4063c5b72b46e9793b0f141a7a3984ac6facf Author: Antonino A. Daplas Date: Mon Jun 26 00:27:12 2006 -0700 [PATCH] VT binding: Add sysfs control to the VT layer with the justification "In addition, if any of the consoles are in KD_GRAPHICS mode, binding and unbinding will not succeed. KD_GRAPHICS mode usually indicates that the underlying console hardware is used for other purposes other than displaying text (ie X). This feature should prevent binding/unbinding from interfering with a graphics application using the VT." I think we should lift this artificial restriction though: - KD_GRAPHICS doesn't get cleaned up automatically, which means it's easy to have terminals stuck in KD_GRAPHICS when hacking around on X. - X doesn't really care, especially with drm where kms already blocks fbdev (and hence fbcon) when there's an active compositor. - This is a root-only interface with a separate .config option and it's possible to hang your machine already anyway if you unload/reload drivers and don't know what you're doing. With this patch i915.ko module reloading works again reliably, something in the recent fedora upgrades broke things. Cc: Greg Kroah-Hartman Cc: Antonino A. Daplas Cc: David Herrmann Cc: Peter Hurley Cc: Imre Deak Signed-off-by: Daniel Vetter Acked-by: David Herrmann --- drivers/tty/vt/vt.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 6e00572cbeb9..b84f7d80c8b4 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -3185,22 +3185,6 @@ err: #ifdef CONFIG_VT_HW_CONSOLE_BINDING -static int con_is_graphics(const struct consw *csw, int first, int last) -{ - int i, retval = 0; - - for (i = first; i <= last; i++) { - struct vc_data *vc = vc_cons[i].d; - - if (vc && vc->vc_mode == KD_GRAPHICS) { - retval = 1; - break; - } - } - - return retval; -} - /* unlocked version of unbind_con_driver() */ int do_unbind_con_driver(const struct consw *csw, int first, int last, int deflt) { @@ -3286,8 +3270,7 @@ static int vt_bind(struct con_driver *con) const struct consw *defcsw = NULL, *csw = NULL; int i, more = 1, first = -1, last = -1, deflt = 0; - if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) || - con_is_graphics(con->con, con->first, con->last)) + if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE)) goto err; csw = con->con; @@ -3338,8 +3321,7 @@ static int vt_unbind(struct con_driver *con) int i, more = 1, first = -1, last = -1, deflt = 0; int ret; - if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) || - con_is_graphics(con->con, con->first, con->last)) + if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE)) goto err; csw = con->con;