From patchwork Fri Jan 22 07:53:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 8088161 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7F627BEEE5 for ; Fri, 22 Jan 2016 07:53:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E8A220454 for ; Fri, 22 Jan 2016 07:53:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C3F7020443 for ; Fri, 22 Jan 2016 07:53:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63BA76EB8F; Thu, 21 Jan 2016 23:53:44 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 74E936EB92 for ; Thu, 21 Jan 2016 23:53:43 -0800 (PST) Received: by mail-wm0-f49.google.com with SMTP id l65so250027398wmf.1 for ; Thu, 21 Jan 2016 23:53:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=sv8oDHlJ22zo0Q+XrE5MOXjCJzHsdNT/n2FMkqkHXrQ=; b=LT09wNZXWCLNBxZLJzDoeq6T63AV/8p2sqKEIKmEFH00tYRSRNlgnLCUu614tbzHIu 0xItJNF3jJwxyXKy3KcGVOyCDy7UuNz9CJ65LZ7rmV6v+djKuGhLocx51pMLv6yfAqoP G+Blu2cXNaa90dgHz3qbb66WvjQAHSiXzrvkw= 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=sv8oDHlJ22zo0Q+XrE5MOXjCJzHsdNT/n2FMkqkHXrQ=; b=F94OPfd9qUKlZC9iOfb3pWNf2FCVqwyWuv0GfJdW/gwpWSEeQMBQIeMELK6SVzVViW woK6n47O+iakm8mI89N0jZStruFG0iRuM9rY1NlXngUDUBdLTwzaAvfdDbFu/myW+sV0 BpBzOI03cWMgyoREiF5RSSOhqpdGckg5SFnHz3acV7CSzrLqDr+N20TZmOqIdXMP/aCG RsUdBLpJBW++JtsUYGbi/dTVyBO/CYTO8sMoW0HWYRQ/1oDYtRi+wDqmFcOE6qusJond v4YlkzRat6p2yd02a4Oi354DTdpSwNciwvL7e5ERufDPmQFiGdB4A1CTdnrzSuqG3/hd h4ow== X-Gm-Message-State: AG10YOQgUFcGSkgmbEbcyxDJSjAp06aIrPz2Pk2Yu0v1T9gUz2YsrFCGWigL7abDx8CxZw== X-Received: by 10.194.123.167 with SMTP id mb7mr1973937wjb.0.1453449221842; Thu, 21 Jan 2016 23:53:41 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:56c9:0:22cf:30ff:fe4c:37d6]) by smtp.gmail.com with ESMTPSA id cv10sm4699581wjb.17.2016.01.21.23.53.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Jan 2016 23:53:41 -0800 (PST) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH] drm/fbdev-helper: Explain how to debug console_lock fun Date: Fri, 22 Jan 2016 08:53:45 +0100 Message-Id: <1453449225-10954-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.7.0.rc3 Cc: Daniel Vetter , Carlos Palminha , DRI Development , laurent.pinchart@ideasonboard.com, 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,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 Every new KMS driver writer seems to run into this and wonder how exactly drm_fb_helper_initial_config can die doing nothing at all. Set up some big warnings signs around this newbie trap to avoid future frustration and wasting everyone's time. Cc: Carlos Palminha Cc: Xinliang Liu Cc: laurent.pinchart@ideasonboard.com Signed-off-by: Daniel Vetter Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/drm_fb_helper.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 1e103c4c6ee0..9bf84b227613 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -2091,6 +2091,28 @@ out: * drm_fb_helper_fill_fix() are provided as helpers to setup simple default * values for the fbdev info structure. * + * HANG DEBUGGING: + * + * When you have fbcon support built-in or already loaded, this function will do + * a full modeset to setup the fbdev console. And due to locking misdesign in + * the VT/fbdev subsystem that entire modeset sequence has to be done while + * holding console_lock. And until console_unlock is called no dmesg lines will + * be sent out to consoles, not even serial console. Which means when your + * driver crashes, you will see absolutely nothing else but a system stuck in + * this function, with no further output. And any kind of printk() you place + * within your own driver or in the drm core modeset code will also never show + * up. + * + * Standard debug practice is to run the fbcon setup without taking the + * console_lock as a hack, to be able to see backtraces and crashes on the + * serial line. This can be done by setting the fb.lockless_register_fb=1 kernel + * cmdline option. + * + * The other option is to just disable fbdev emulation since very likely the + * first modest from userspace will crash in the same way, and is even easier to + * debug. This can be done by setting the drm_kms_helper.fbdev_emulation=0 + * kernel cmdline option. + * * RETURNS: * Zero if everything went ok, nonzero otherwise. */