From patchwork Thu Jun 5 14:58:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 4306301 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C09BE9F26E for ; Thu, 5 Jun 2014 14:59:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED37E20107 for ; Thu, 5 Jun 2014 14:59:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2D27220375 for ; Thu, 5 Jun 2014 14:59:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A69A6E27E; Thu, 5 Jun 2014 07:59:36 -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 72FCD6E27E for ; Thu, 5 Jun 2014 07:59:32 -0700 (PDT) Received: by mail-wi0-f172.google.com with SMTP id hi2so10575447wib.17 for ; Thu, 05 Jun 2014 07:59:30 -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=XZ/37g+gvY/oqU07S42evQQSjDvxUyyM8CC4Tg08tnk=; b=P3JEq36PDZOgSZ0t/orHUGqhYYRJvmT/n7YGVbt3ylYgJ+SfqoBXkkPl+1yTnYdAl4 7DU1eN90fuCxs4oL0MtPxF64slQ+Fduyyg3Q/nerIKyCRvSPCQiYVpRlt/WvWjSLqdH0 1Q5PRsphhBbRHN0wI43MDqjngdA33FYUdkvrM= 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=XZ/37g+gvY/oqU07S42evQQSjDvxUyyM8CC4Tg08tnk=; b=iGeIO0Clo4kfNPtHA/Ds96iNdiZjTMylC0u/UOMCsMAcUSBT8FSz5iBTd8UJs76fKL LJYvBq0FyrhKqU0DOcIfWGmz2xxJNBE2m/D77XoQbM83Se+QufK//tETG44M7wjuvln7 Em5ARh/+a7EuAru+v/5qf6B75Jz3vswSg1fRRPZ2f7tmav82g+dlgnGETG9iRfK3UKNr aCKe/+8mjtJ5fPExEedARgp1GUnSZWO93ClipB+EXUiIoyswBubJcbGwUaTJWURG+lB8 gSHWUxmfMZM4lZjZshJ1T1PlYtfhGUS4BnjNYywoZ+2+ek/mL/7zRLERNtQAnJ0L1Y3Q a1LQ== X-Gm-Message-State: ALoCoQmaFX5fH+inol88lve85w4LxejG7Qty3cewIaYldf9lLRz2kphUsA90vx2u5grSMCu0PyV8 X-Received: by 10.180.76.6 with SMTP id g6mr16519568wiw.34.1401980369681; Thu, 05 Jun 2014 07:59:29 -0700 (PDT) Received: from biene.ffwll.local (84-73-67-144.dclient.hispeed.ch. [84.73.67.144]) by mx.google.com with ESMTPSA id do5sm54609673wib.16.2014.06.05.07.59.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jun 2014 07:59:28 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH 1/5] vt: Fix replacement console check when unbinding Date: Thu, 5 Jun 2014 16:58:24 +0200 Message-Id: <1401980308-5116-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.1.4 Cc: Daniel Vetter , Jiri Slaby , LKML , DRI Development , Greg Kroah-Hartman X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 I don't fully understand the magic of the vt register/unregister logic, but apparently everything but the inital console (as set in the conswitchp pointer) is marked with FLAG_MODULE. Which means if something unregistered the boot vt driver (e.g. i915.ko kicking out vga_con) there's nothing left when trying to unbind e.g. fbcon through sysfs. But we always have the dummy console hanging around, so this test is fairly dubious. What we actually want is simply a different console than the one we want to unbind. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Daniel Vetter Reviewed-by: David Herrmann --- drivers/tty/vt/vt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 3ad0b61e35b4..ea600f482eeb 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -3155,8 +3155,7 @@ int do_unbind_con_driver(const struct consw *csw, int first, int last, int deflt for (i = 0; i < MAX_NR_CON_DRIVER; i++) { con_back = ®istered_con_driver[i]; - if (con_back->con && - !(con_back->flag & CON_DRIVER_FLAG_MODULE)) { + if (con_back->con && con_back->con != csw) { defcsw = con_back->con; retval = 0; break;