From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 1/5] vt: Fix replacement console check when unbinding Date: Fri, 6 Jun 2014 09:49:53 +0200 Message-ID: <20140606074953.GB7416@phenom.ffwll.local> References: <1401980308-5116-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by gabe.freedesktop.org (Postfix) with ESMTP id C32616E2E1 for ; Fri, 6 Jun 2014 00:49:57 -0700 (PDT) Received: by mail-wg0-f47.google.com with SMTP id k14so1449636wgh.30 for ; Fri, 06 Jun 2014 00:49:57 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: David Herrmann Cc: Daniel Vetter , Intel Graphics Development , LKML , DRI Development , Greg Kroah-Hartman , Jiri Slaby List-Id: dri-devel@lists.freedesktop.org On Fri, Jun 06, 2014 at 09:16:13AM +0200, David Herrmann wrote: > Hi > > On Thu, Jun 5, 2014 at 4:58 PM, Daniel Vetter wrote: > > 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. > > For unknown reasons, you can disable the dummy console via Kconfig, so > it's not guaranteed to be around. But your comment is still valid. Right, I'll reword this a bit to clarify. > > > > > Cc: Greg Kroah-Hartman > > Cc: Jiri Slaby > > 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) { > > Funny thing is, if you run do_bind_con_driver() on the range first, > you kick out the existing driver and can then unload it regardless > whether the fallback was FLAG_MODULE or not. Therefore, I think that > change is safe. This is: > > Reviewed-by: David Herrmann > > Thanks > David > > > defcsw = con_back->con; > > retval = 0; > > break; > > -- > > 1.8.1.4 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch