From patchwork Tue Apr 19 17:55:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 8882411 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 8FE6ABF29F for ; Tue, 19 Apr 2016 17:54:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BCBC9202E5 for ; Tue, 19 Apr 2016 17:54:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DFDB4200F0 for ; Tue, 19 Apr 2016 17:54:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10F1F6E80B; Tue, 19 Apr 2016 17:54:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kmu-office.ch (mail.kmu-office.ch [IPv6:2a02:418:6a02::a2]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7DDDC6E809 for ; Tue, 19 Apr 2016 17:54:25 +0000 (UTC) Received: from trochilidae.toradex.int (75-146-58-181-Washington.hfc.comcastbusiness.net [75.146.58.181]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 372845C0B44; Tue, 19 Apr 2016 19:52:48 +0200 (CEST) From: Stefan Agner To: dri-devel@lists.freedesktop.org, stefan@agner.ch, airlied@linux.ie Subject: [PATCH 6/6] drm/fsl-dcu: disable vblank events on CRTC disable Date: Tue, 19 Apr 2016 10:55:10 -0700 Message-Id: <1461088510-8512-7-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1461088510-8512-1-git-send-email-stefan@agner.ch> References: <1461088510-8512-1-git-send-email-stefan@agner.ch> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1461088369; bh=xZCixZuQqtoVsvgFf6fmGue7pC7MMnVVVMjnagoMLXU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=ZljgepjcKhJ4QWr88A1M+ZNqUcd6XtcTzqidrJI5VS2UgQxRe4v0blQMuBOIowwCFMt9TQwl9x1e9VIz/e4mjWbMo9C9lghECXmWFUwXzvkt7zwfMbBUvNuMqfia8rYYvu8q/S5BFiczRscBdPP62E9sWNVDNVATkFyqxOP3v60= Cc: jianwei.wang.chn@gmail.com, meng.yi@nxp.com, alexander.stein@systec-electronic.com, linux-kernel@vger.kernel.org, alison.wang@freescale.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=-5.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 Disable vblank events when CRTC gets disabled. This avoids an external abort when entering suspend while disable_timer is still active: On resume the timer might fire immediately and cause a register access in fsl_dcu_drm_disable_vblank before clocks get enabled by the resume function. Signed-off-by: Stefan Agner --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c index ca0f7d83..36df2eb 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c @@ -43,6 +43,8 @@ static void fsl_dcu_drm_disable_crtc(struct drm_crtc *crtc) struct drm_device *dev = crtc->dev; struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; + drm_crtc_vblank_off(crtc); + regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE, DCU_MODE_DCU_MODE_MASK, DCU_MODE_DCU_MODE(DCU_MODE_OFF)); @@ -60,6 +62,8 @@ static void fsl_dcu_drm_crtc_enable(struct drm_crtc *crtc) DCU_MODE_DCU_MODE(DCU_MODE_NORMAL)); regmap_write(fsl_dev->regmap, DCU_UPDATE_MODE, DCU_UPDATE_MODE_READREG); + + drm_crtc_vblank_on(crtc); } static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)