From patchwork Thu May 24 22:06:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 10425653 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 6B11C6053B for ; Thu, 24 May 2018 22:07:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24A5D295ED for ; Thu, 24 May 2018 22:07:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16B8F295F7; Thu, 24 May 2018 22:07:58 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9655A295ED for ; Thu, 24 May 2018 22:07:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SJtVxyb/w1DMZ1s+SFE9sT2jkBXQYH4tB6ZvzLeBceE=; b=JBUQOCPOqNh9mF rK2zkzD82Iy2xJ01etKMi3GKwc2CLiMTKQMPJPbHIDFEpK3Xigg4o2k4mWYGisu57IYLSxpsEH5dU E9RuTsRe7urKc0hWZmliovw0BqYZg7uNIxFMTpH4DLPKc7Upgd9SqAiRWAU0qys+2ajTOlfOduQ4Z MR2T1USI2GYqwxuQQqJhWJBNG0KVsG5oz73/mryxDW76+sfBW0Gvqwxo7B0cOFLN14x7GZHBDVvKX hC5PPCqn5G8Y7RAJ0qVPjkJtGdXBtDd3nKsS590av3OWRHvrKKdB8MyyyyPzYKHvMzRIrJameXA66 QAzr3etsZeHIqttsrFFg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLyOn-00021M-1B; Thu, 24 May 2018 22:07:53 +0000 Received: from gloria.sntech.de ([95.129.55.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLyOD-0000MK-T7; Thu, 24 May 2018 22:07:48 +0000 Received: from ip9234b5ac.dynamic.kabel-deutschland.de ([146.52.181.172] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fLyNc-0000NV-Kt; Fri, 25 May 2018 00:06:40 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Ezequiel Garcia Subject: [PATCH] drm/rockchip: vop: fix irq disabled after vop driver probed Date: Fri, 25 May 2018 00:06:39 +0200 Message-ID: <25470133.K8n9sLBzRS@diego> In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180524_150718_101432_7B00AFAA X-CRM114-Status: GOOD ( 17.49 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xxm@rock-chips.com, Joerg Roedel , Jeffy Chen , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Tomeu Vizoso , jcliang@chromium.org, linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org, Enric =?ISO-8859-1?Q?Balletb=F2?= , tfiga@chromium.org, Robin Murphy , linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sandy Huang The vop irq is shared between vop and iommu and irq probing in the iommu driver moved to the probe function recently. This can in some cases lead to a stall if the irq is triggered while the vop driver still has it disabled. But there is no real need to disable the irq, as the vop can simply also track its enabled state and ignore irqs in that case. So remove the enable/disable handling and add appropriate condition to the irq handler. Signed-off-by: Sandy Huang [added an actual commit message] Signed-off-by: Heiko Stuebner --- Hi Ezequiel, this patch came from a discussion I had with Rockchip people over the iommu changes and resulting issues back in april, but somehow was forgotten and not posted to the lists. Correcting that now. So removing the enable/disable voodoo on the shared interrupt is the preferred way. drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 ++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 510cdf0..61493d4 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -549,8 +549,6 @@ static int vop_enable(struct drm_crtc *crtc) spin_unlock(&vop->reg_lock); - enable_irq(vop->irq); - drm_crtc_vblank_on(crtc); return 0; @@ -596,8 +594,6 @@ static void vop_crtc_atomic_disable(struct drm_crtc *crtc, vop_dsp_hold_valid_irq_disable(vop); - disable_irq(vop->irq); - vop->is_enabled = false; /* @@ -1168,6 +1164,13 @@ static irqreturn_t vop_isr(int irq, void *data) int ret = IRQ_NONE; /* + * since the irq is shared with iommu, iommu irq is enabled before vop + * enable, so before vop enable we do nothing. + */ + if (!vop->is_enabled) + return IRQ_NONE; + + /* * interrupt register has interrupt status, enable and clear bits, we * must hold irq_lock to avoid a race with enable/disable_vblank(). */ @@ -1586,9 +1588,6 @@ static int vop_bind(struct device *dev, struct device *master, void *data) if (ret) goto err_disable_pm_runtime; - /* IRQ is initially disabled; it gets enabled in power_on */ - disable_irq(vop->irq); - return 0; err_disable_pm_runtime: