From patchwork Thu Jun 5 14:58:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 4306341 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 6106BBEEA7 for ; Thu, 5 Jun 2014 14:59:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D9F3B201EC for ; Thu, 5 Jun 2014 14:59:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C1DD22034E for ; Thu, 5 Jun 2014 14:59:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C58E46E96A; Thu, 5 Jun 2014 07:59:39 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C8536E96B for ; Thu, 5 Jun 2014 07:59:37 -0700 (PDT) Received: by mail-wi0-f175.google.com with SMTP id f8so10682594wiw.2 for ; Thu, 05 Jun 2014 07:59:33 -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=mgcieqE+B1c5lgstQS/ETuYjpZF/GweYfuxJ+7tTytg=; b=G8u6aosmcP0PICBbXEYpefNTUQg5x+008I3Hvhu121gql3IxB8glHWSt9iiQGxP8qN l7LJhgMtFaVOOf8KxgGT+mRFHgcIMzIiY1KqCqsheiipSaxz/J8Z6t0D/0VyHX7py/z0 4zcukrLUhjd8u0/SUBFS8X0KKV4jY4cOZ3124= 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=mgcieqE+B1c5lgstQS/ETuYjpZF/GweYfuxJ+7tTytg=; b=Ua9Y8pt6Fzvm9qv5jjtTbc1QWYpb0ajj8lfwPAR7Ubdn7HNLLI0Mm2tEDn5fJ9fncZ jibP2tNSzfekn/Sy5iV5Qqw2+1o99PgumSu/9KQqF5oCoX8Rj+XMoAddf9DUh+Qf7PXN 8pdN6hlW59gtUhmcvBhUJ8ZodpSnHGBnGX6HfZptM3dnv9Lo3ebbTo/bOx61W+NbE2+s Aj9DH/OJh4UcwaFSmz7jJa+0JA6Yr++LaE1YFWo3OlJbfdI99BYhoQ4eTAispgfi3Ei2 AJQD4S0pjv1ppbySRugh63a3DvUxRdrv8dnot6PsSWl5cbY3ktwx9kJnZB0BXJIsUj2f ZtRg== X-Gm-Message-State: ALoCoQnd5W0J/C6GLa6cLhFoj8IHzDjQtHw6gI0TtTRVi5LzuQYO39XGnYouxIwyVCeRrs0cBtl/ X-Received: by 10.180.108.51 with SMTP id hh19mr16450378wib.25.1401980372846; Thu, 05 Jun 2014 07:59:32 -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.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jun 2014 07:59:31 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH 3/5] vt: Don't ignore unbind errors in vt_unbind Date: Thu, 5 Jun 2014 16:58:26 +0200 Message-Id: <1401980308-5116-3-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: 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 Otherwise the loop will never stop since we don't make any forward progress. Noticed while breaking this accidentally in a painful attempt to make vga_con unregistering work. With this patch we'll bail out on the first attempt, which at least leaves a useful enough system behind for debugging. Livelocks on console_lock just aren't fun. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Daniel Vetter Reviewed-by: David Herrmann --- drivers/tty/vt/vt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 5077fe87324d..3c00dcb3b145 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -3260,6 +3260,7 @@ static int vt_unbind(struct con_driver *con) { const struct consw *csw = NULL; 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)) @@ -3285,8 +3286,10 @@ static int vt_unbind(struct con_driver *con) if (first != -1) { console_lock(); - do_unbind_con_driver(csw, first, last, deflt); + ret = do_unbind_con_driver(csw, first, last, deflt); console_unlock(); + if (ret != 0) + return ret; } first = -1;