From patchwork Tue Aug 21 20:33:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Tettamanti X-Patchwork-Id: 1357511 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 B6DA43FD40 for ; Tue, 21 Aug 2012 20:33:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F25BA030C for ; Tue, 21 Aug 2012 13:33:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 936FC9F02A for ; Tue, 21 Aug 2012 13:33:43 -0700 (PDT) Received: by wgbdr1 with SMTP id dr1so170180wgb.12 for ; Tue, 21 Aug 2012 13:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=XTvfGCFEo0hA6s+ZUQ4Tslk6/1qVOXub8XfKS4DPT74=; b=W9K8wXLLq/Wav2mvetpQUYP5DIr8s6zfWJqrJO+GKWnkFPciR+BmEMc9NwkUaB3RNd 65QH7jASt76Nrgesb+84/eSIL6TQqD/Ze6PH+/VGhKFcEFCT66+LtigbzEI3C/N6x+QU HV1rKxpv96shKOdcRBSxdPGlTM+v9NpzlrXXhjle/PZCtUYPwaEttO1wfAuS0D8lZBx/ AcP5UQTFFkr505GiSZdi/cnDoi4Lx8mLKKjf6EuoOQK9lJ3QHUqE92siaMZQL4lscksr IrHNAUIeg67HMEeIuW4Y+txALlKKhY8NWvbWe1+f9Wrc2+VXqHbSy+18nMeAaVAW9LPb vaKw== Received: by 10.216.153.207 with SMTP id f57mr10089508wek.196.1345581222553; Tue, 21 Aug 2012 13:33:42 -0700 (PDT) Received: from growl (dynamic-adsl-78-14-228-115.clienti.tiscali.it. [78.14.228.115]) by mx.google.com with ESMTPS id el6sm35415542wib.8.2012.08.21.13.33.40 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 13:33:41 -0700 (PDT) Date: Tue, 21 Aug 2012 22:33:36 +0200 From: Luca Tettamanti To: Alex Deucher Subject: Re: radeon testing Message-ID: <20120821203336.GA5086@growl> References: <20120820123045.GA6212@growl> <20120820193057.GA5176@growl> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Mailing list - DRI developers 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: , 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 On Tue, Aug 21, 2012 at 09:51:46AM -0400, Alex Deucher wrote: > On Mon, Aug 20, 2012 at 3:30 PM, Luca Tettamanti wrote: > > Any printk between evergreen_mc_stop and evergreen_mc_resume locks up > > the machine. The likely culprit is commit 023e188e: > > yeah, vram is locked out at that point. I guess we probably need to > block anyone from trying to access it. I see; the 2 dev_warn would probably lock up the machine as well right? > > I haven't tried backing out the commit yet, but looking at the diff I > > see that you call radeon_wait_for_vblank and radeon_get_vblank_counter, > > but evergreen_mc_program is called way before IRQ is set up. Is the > > vblank counter running? Looks like we just hitting the timeout here... > > We aren't waiting for an interrupt, just polling the current crtc > status until it enters the vblank region. The status and counters > should be working as we only wait on displays that are enabled. It appears that all the crtcs are considered active: [ 4.260766] crtc 0 enabled 272696081 (this is the value of crtc_enabled) [ 4.260766] crtc 0 wait for vblank 0x1 (0x1 means no timeout) [ 4.260766] crtc 0: waited 33 [100000] (number of loops of radeon_get_vblank_counter) [ 4.260766] crtc 1 enabled 272630544 [ 4.260766] crtc 1 wait for vblank 0x1 [ 4.260766] crtc 1: waited 100000 [100000] [ 4.260766] crtc 2 enabled 4195088 [ 4.260766] crtc 2 wait for vblank 0x1 [ 4.260766] crtc 2: waited 100000 [100000] [ 4.260766] crtc 3 enabled 4195088 [ 4.260766] crtc 3 wait for vblank 0x1 [ 4.260766] crtc 3: waited 100000 [100000] [ 4.260766] crtc 4 enabled 4195088 [ 4.260766] crtc 4 wait for vblank 0x1 [ 4.260766] crtc 4: waited 100000 [100000] [ 4.260766] crtc 5 enabled 4195088 [ 4.260766] crtc 5 wait for vblank 0x1 [ 4.260766] crtc 5: waited 100000 [100000] Maybe the code should be checking EVERGREEN_CRTC_MASTER_EN? I'm testing this patch and the boot is fast again: Luca diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 2308c7d..72bf721 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -1251,7 +1251,8 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav WREG32(VGA_RENDER_CONTROL, 0); /* blank the display controllers */ for (i = 0; i < rdev->num_crtc; i++) { - crtc_enabled = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]); + crtc_enabled = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]) & + EVERGREEN_CRTC_MASTER_EN; if (crtc_enabled) { save->crtc_enabled[i] = true; if (ASIC_IS_DCE6(rdev)) {