From patchwork Thu Nov 1 16:32:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel J Blueman X-Patchwork-Id: 1687611 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id E6FD73FE20 for ; Fri, 2 Nov 2012 09:44:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D36669F069 for ; Fri, 2 Nov 2012 02:44:12 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-da0-f49.google.com (mail-da0-f49.google.com [209.85.210.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 46A6E9E79D for ; Thu, 1 Nov 2012 09:33:18 -0700 (PDT) Received: by mail-da0-f49.google.com with SMTP id q27so1150240daj.36 for ; Thu, 01 Nov 2012 09:33:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=XVM5FqOSofYvIEOM7qaNDkn6WwtuhgXklzabv91NhJc=; b=jsgGLo9Q9ulcRViYzNMdDOhNdm7/brhhUGuEKr7A5iKa2Uf5ZyT1ssXH5tTLbdiu6s FoyLou05upt669zFgiTi0beOVdM7CQRIERLQcZhW8jRm9n1HQXowwNDRjy4ud97ZaqC0 iaHCwbBpkQFCyBeKCPJ153xNp26kLbi2E/RZ5J8He1rSTjprKTdYyM3Nf3XC/N8B3UFb 6txGV51ZiDnU3xaZNarOvVmOC4DqtZYu6fFeOcAqrmvUHEULB71z6i/MqeJ3pMRBt4a3 MAxO+xzK63Ut8p05BrkDLCwO69o22vWpIZDQBdbY2QUn7wooNrliDLENqkIgWGJz/Y3K bLmw== Received: by 10.68.230.10 with SMTP id su10mr16783324pbc.47.1351787597890; Thu, 01 Nov 2012 09:33:17 -0700 (PDT) Received: from localhost.localdomain (bb121-7-238-145.singnet.com.sg. [121.7.238.145]) by mx.google.com with ESMTPS id x6sm4189745pav.29.2012.11.01.09.33.14 (version=SSLv3 cipher=OTHER); Thu, 01 Nov 2012 09:33:17 -0700 (PDT) From: Daniel J Blueman To: David Airlie Subject: [PATCH] Fix nouveau hang after switcheroo Date: Fri, 2 Nov 2012 00:32:59 +0800 Message-Id: <1351787579-17313-1-git-send-email-daniel@quora.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQlP2dQCTwKQaoYIF4kCq24zG8TJYQkpn0lQa1qPJT6hCp/rbzuTk5Z+m2qvZ+/sS9heEDGr X-Mailman-Approved-At: Fri, 02 Nov 2012 02:18:07 -0700 Cc: nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel J Blueman , Ben Skeggs X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org After switcherooing to integrated and starting X, when X fails to start and causes a console switch, we get hit with a hanger (below). Fix by checking if we're already in D3. BUG: soft lockup - CPU#0 stuck for 22s! [Xorg:1703] [] nv04_timer_read+0x28/0x70 [nouveau] [] nouveau_timer_wait_eq+0x7c/0xe0 [nouveau] [] nvd0_sor_dpms+0xde/0x1a0 [nouveau] [] ? fb_set_var+0xe9/0x3a0 [] ? __pte_alloc+0xa9/0x160 [] ? nvd0_sor_dp_link_set+0x2c0/0x2c0 [nouveau] [] drm_helper_connector_dpms+0xbc/0x100 [drm_kms_helper] [] drm_fb_helper_dpms.isra.13+0xa5/0xf0 [drm_kms_helper] [] drm_fb_helper_blank+0x49/0x80 [drm_kms_helper] [] fb_blank+0x56/0xc0 [] do_fb_ioctl+0x59b/0x5f0 [] ? vma_interval_tree_insert+0x83/0x90 [] fb_ioctl+0x45/0x50 [] do_vfs_ioctl+0x8a/0x340 [] sys_ioctl+0x91/0xb0 Signed-off-by: Daniel J Blueman --- drivers/gpu/drm/nouveau/nvd0_display.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c index c402fca..c3285bf 100644 --- a/drivers/gpu/drm/nouveau/nvd0_display.c +++ b/drivers/gpu/drm/nouveau/nvd0_display.c @@ -1364,6 +1364,10 @@ nvd0_sor_dpms(struct drm_encoder *encoder, int mode) int or = nv_encoder->or; u32 dpms_ctrl; + /* prevent hanging after hardware is in D3 */ + if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) + return; + nv_encoder->last_dpms = mode; list_for_each_entry(partner, &dev->mode_config.encoder_list, head) {