From patchwork Mon Feb 8 01:13:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 8246161 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 3939CBEEE5 for ; Mon, 8 Feb 2016 01:14:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72739200DB for ; Mon, 8 Feb 2016 01:14:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E39E6201ED for ; Mon, 8 Feb 2016 01:14:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F2266E32D; Sun, 7 Feb 2016 17:14:56 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 373CD6E32D for ; Sun, 7 Feb 2016 17:14:55 -0800 (PST) Received: by mail-wm0-f65.google.com with SMTP id g62so13234921wme.2 for ; Sun, 07 Feb 2016 17:14:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dIsr5+ceVYJzLr5hqtepMZoz/oSNFrZJvGSjEDcM5aU=; b=zcD/im4xeUU3KP+X6S953HlMM5sX8mtXKxjucSv0i8Mazh43nDzgCkymP18wALJQzE J4aTnvM/gDe4MMGoCGuW5cOKzDLpHL3vPJi08eBGDQdSZDx6BEo2GwPX/Z09CepsjKR/ WiNzahkwW7YlbdSihz3SCbeeZiqwNVl/pED2tKAmqauZh1TM4c2BQArgh3CNW9jf9wni YhFAjUJ5nTUvpaXJ2/nF/sYFseNhFuGz8zrvBdVAQ16bLmByEPEe2Wq8aPzPkRiSeRQj 3vjHXs5bAitpzOMg/CRsMuql64fOIFk8RUK+ytM63KTSkllurfdgRVVM9Pqap+xH05Iy Y25w== 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=dIsr5+ceVYJzLr5hqtepMZoz/oSNFrZJvGSjEDcM5aU=; b=XC2i8q29TbExWoEPlZtOfKc1LHmF5Rh3EhUeDQeVhHMKnrl1x1Ym+1sQF5PTtLGGkO D3TCDPPSxPmOzbw9GlzhPFu9+NEQ/KQssszcyZFiZb/KJYdswebrVaU3zVxdeBD2oQLd RYfj3ZTHDvkKL4CfiNBWkxi28Qhmgqlk5dA7M2Kyys9Dxt6XvfEiXTLRiBH4TMVyG++k ssmpMtfGoWz+dRF7PgGENKEc6lW4xs9ELDsF2vz03LKsyhYWkNNhP1tsIYaZUVSIyaQv dxB1hgoVhOh/VYRO0rbPpIPzEJsQ7nwIvE+rFvxL3J1i3J3AkA8S9i0NLEvuUpwgrWlL iR5w== X-Gm-Message-State: AG10YORYqXbCX1uNWhQ52MLjCzL2P945Hj9Px/LSF9WPfHV7Szfl3YCq3+Si+ZH8VfQcCw== X-Received: by 10.28.22.201 with SMTP id 192mr29876790wmw.1.1454894094049; Sun, 07 Feb 2016 17:14:54 -0800 (PST) Received: from twisty.fritz.box (x4d02db5e.dyn.telefonica.de. [77.2.219.94]) by smtp.gmail.com with ESMTPSA id b5sm9486380wmh.15.2016.02.07.17.14.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Feb 2016 17:14:53 -0800 (PST) From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/6] drm/radeon/pm: Handle failure of drm_vblank_get. Date: Mon, 8 Feb 2016 02:13:29 +0100 Message-Id: <1454894009-15466-7-git-send-email-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454894009-15466-1-git-send-email-mario.kleiner.de@gmail.com> References: <1454894009-15466-1-git-send-email-mario.kleiner.de@gmail.com> Cc: alexander.deucher@amd.com, linux@bernd-steinhauser.de, michel@daenzer.net, christian.koenig@amd.com 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.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 Make sure that drm_vblank_get/put() stay balanced in case drm_vblank_get fails, by skipping the corresponding put. Signed-off-by: Mario Kleiner Cc: michel@daenzer.net Cc: dri-devel@lists.freedesktop.org Cc: alexander.deucher@amd.com Cc: christian.koenig@amd.com Reviewed-by: Daniel Vetter --- drivers/gpu/drm/radeon/radeon_pm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 59abebd..339a6c5 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -276,8 +276,12 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) if (rdev->irq.installed) { for (i = 0; i < rdev->num_crtc; i++) { if (rdev->pm.active_crtcs & (1 << i)) { - rdev->pm.req_vblank |= (1 << i); - drm_vblank_get(rdev->ddev, i); + /* This can fail if a modeset is in progress */ + if (0 == drm_vblank_get(rdev->ddev, i)) + rdev->pm.req_vblank |= (1 << i); + else + DRM_DEBUG_DRIVER("crtc %d no vblank, can glitch\n", + i); } } }