From patchwork Fri Jun 6 09:43:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 4310881 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2A306BEEAA for ; Fri, 6 Jun 2014 09:43:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6484F201DD for ; Fri, 6 Jun 2014 09:43:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8C331201D3 for ; Fri, 6 Jun 2014 09:43:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8BCEF6EA3C; Fri, 6 Jun 2014 02:43:11 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B7296EA44 for ; Fri, 6 Jun 2014 02:43:10 -0700 (PDT) Received: by mail-we0-f169.google.com with SMTP id q58so2337763wes.0 for ; Fri, 06 Jun 2014 02:43:09 -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:in-reply-to:references; bh=HswLQpfEZYqBRl/yzSQVBvYoL5K+a3cIZYb8uwhbT1Q=; b=jUvFvFvezmdLuSRQDZKd8OW25taRBw4QsTrXPbLIVCkmwHkbCsk+IQC2ceULA+MwGM VkN2s9Hydg7HC3Bx9WAs2wf2yA9TwBy2Rf8kxpOlJC57jQBRlvtl6OjGN+TtsglfIZce Is+WeQIzazoDjJBDHWhRu0INiYo1cHn5R5zCA= 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:in-reply-to :references; bh=HswLQpfEZYqBRl/yzSQVBvYoL5K+a3cIZYb8uwhbT1Q=; b=DvjZs/mxE2iZrgOu69jMgfCYN35tPjwo2bVAl8mYJ3MAn4PWp2qE7QGcsklbN4AfA1 jDTQlCQ1Y5KGKFfeXQwICb7n9zQfJ0hXYTRqpF2Qo9xlsFr2TAXig6yVT0V586UCj8fz zN0+liQLszYabdk0GWnyeUt+H92ilnnnKF74HskQeIPgT2b09bnbu2EGFzIK5okNgDVw UtHmF8vhby/AuBw+QLve3LIuemgDSt0a5ZFmkyXxleVxB6h4+7AXVMreQrI70mX4WFud gCIuvcNprFHAx6quU9JvKfp8wut0XH+rjWqsxOMxA588pqTZEUvCv94pLZ23mHEq0y51 I5sg== X-Gm-Message-State: ALoCoQml3e5k6ksdH7CsGR+PPOrTtMLcPUKvNi+GRrlK8SeWBohwWNYTkRIZ9DHBrXGjCTc0frTa X-Received: by 10.180.37.198 with SMTP id a6mr23801248wik.58.1402047789181; Fri, 06 Jun 2014 02:43:09 -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 k2sm11609243wjq.20.2014.06.06.02.43.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jun 2014 02:43:08 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH] vt: Fix replacement console check when unbinding Date: Fri, 6 Jun 2014 11:43:01 +0200 Message-Id: <1402047781-7241-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1401980308-5116-1-git-send-email-daniel.vetter@ffwll.ch> References: <1401980308-5116-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Greg Kroah-Hartman , Daniel Vetter , LKML , DRI Development , Jiri Slaby 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 in most cases have the dummy console hanging around besides the boot console, so this test is fairly dubious. What we actually want is simply a different console than the one we want to unbind. v2: Correct the commit message to clarify that the dummy console isn't always around, but only in most cases (David). Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: David Herrmann Reviewed-by: David Herrmann Signed-off-by: Daniel Vetter --- 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;