From patchwork Wed Sep 14 12:54:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 9331339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A8DF60231 for ; Wed, 14 Sep 2016 12:55:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C3871FFC9 for ; Wed, 14 Sep 2016 12:55:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 607CE2921C; Wed, 14 Sep 2016 12:55:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 54E6A1FFC9 for ; Wed, 14 Sep 2016 12:55:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E7466E239; Wed, 14 Sep 2016 12:55:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) by gabe.freedesktop.org (Postfix) with ESMTPS id B555A6E239 for ; Wed, 14 Sep 2016 12:55:11 +0000 (UTC) Received: by mail-pa0-x22c.google.com with SMTP id wk8so5304854pab.1 for ; Wed, 14 Sep 2016 05:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ijrlzuwDZWYBIF1CIhVpSnT+75KFQsNi0pLqVPXr4+0=; b=g7Eu9Kq66rInU9SQzNVxoKtPTjEFn6LTO0VEHg5IyTjXEavou5MSTU78TrtgasCWok ykoHbTIVtnyPviRYjmeNgmj4uolSVhMwI2M93GXxDM6KB1x5V/tt5w0SftD4DZuWb4GG 7lGKsXTyMj9TJXRaVhKMedupA4iFSMh1thOsA= 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=ijrlzuwDZWYBIF1CIhVpSnT+75KFQsNi0pLqVPXr4+0=; b=lKnZF3Urcw3nZd1yzvpZA8aNnJTkWbGvfSromROxgKkKftQuMcd9vzLODIGVxKHTkP dw/nUQL3mSc+shWK2HNfJY3+Df6RtGTxzuCMXzbNWxzz6ut7VNqJrSCX9Po/yPrIvzX2 IZiauJkaD9yb6bFoy0eTvvswfHdQIeaL+tCsLVQ3CCqHfylkgOdcMaJ+rPCDzpaDZA6k FPMbkOfGqa0RQM+rDoe1+maAD+zlYFSH8zn9+ciRDppGuYwxd2DoGzY27/btCFGkf6Ib W++ZmCP9EXp+4gWuP2O0chws/SCqArQ8YdoTiH96eD8s0x2c+u3rS/mf6WNbzokpTxl5 eBFA== X-Gm-Message-State: AE9vXwM7RRfTLgfCpk08CeO6fl6D5LSmu9nCi1UIaUGNd/jdQ2jAtaS6Ro3E4byqxg+pQnVE X-Received: by 10.67.5.33 with SMTP id cj1mr4277582pad.120.1473857710392; Wed, 14 Sep 2016 05:55:10 -0700 (PDT) Received: from basement.tok.corp.google.com ([100.103.3.207]) by smtp.gmail.com with ESMTPSA id t7sm5601309paz.21.2016.09.14.05.55.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Sep 2016 05:55:09 -0700 (PDT) From: Tomasz Figa To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/8] drm/rockchip: Clear interrupt status bits before enabling Date: Wed, 14 Sep 2016 21:54:54 +0900 Message-Id: <1473857701-9250-2-git-send-email-tfiga@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1473857701-9250-1-git-send-email-tfiga@chromium.org> References: <1473857701-9250-1-git-send-email-tfiga@chromium.org> Cc: linux-kernel@vger.kernel.org, Tomasz Figa , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org 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-Virus-Scanned: ClamAV using ClamSMTP The enable register only masks the raw status bits to signal CPU interrupt only for enabled interrupts. The status bits are activated regardless of the enable register. This means that we might have an old interrupt event queued, which we are not interested in. To avoid getting a spurious interrupt signalled, we have to clear the old bit before we update the enable register. Signed-off-by: Tomasz Figa --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 209167b..7e811cf 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -414,6 +414,7 @@ static void vop_dsp_hold_valid_irq_enable(struct vop *vop) spin_lock_irqsave(&vop->irq_lock, flags); + VOP_INTR_SET_TYPE(vop, clear, DSP_HOLD_VALID_INTR, 1); VOP_INTR_SET_TYPE(vop, enable, DSP_HOLD_VALID_INTR, 1); spin_unlock_irqrestore(&vop->irq_lock, flags); @@ -479,6 +480,7 @@ static void vop_line_flag_irq_enable(struct vop *vop, int line_num) spin_lock_irqsave(&vop->irq_lock, flags); VOP_CTRL_SET(vop, line_flag_num[0], line_num); + VOP_INTR_SET_TYPE(vop, clear, LINE_FLAG_INTR, 1); VOP_INTR_SET_TYPE(vop, enable, LINE_FLAG_INTR, 1); spin_unlock_irqrestore(&vop->irq_lock, flags); @@ -921,6 +923,7 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc) spin_lock_irqsave(&vop->irq_lock, flags); + VOP_INTR_SET_TYPE(vop, clear, FS_INTR, 1); VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 1); spin_unlock_irqrestore(&vop->irq_lock, flags);