Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2951725imm; Thu, 24 May 2018 19:45:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqbgyZM1Kxu4YkzynQFSSzLSziZwHqXru+7Roi/ucsj+A1XQ9qCaeG9sBhImT3bMyqjW2wn X-Received: by 2002:a63:7c04:: with SMTP id x4-v6mr465400pgc.67.1527216348920; Thu, 24 May 2018 19:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216348; cv=none; d=google.com; s=arc-20160816; b=ZCIXhlW6BtyuS9fX8TbfuSpeKzeF/TX7T2zN4QbAD137Qq8nZAMZXnqqiaysSaXo9G J+pNzmHqi44/nd6aFCxGP5WryqBmSrWTUiQC5ZKOmvjm5G9jfu6FlqoTBytGxiSg0sNp tG4EHXJsHyKJRjPJ6Vwb4lRQcaW5AR3H324w8KWVjCh9A/wNkF5THga8aOofwnzQb3O9 bTTHKPAtVN9iJqsKRW0793OLdtl9JKWLhOsWFnkvfkWN5OmHUhc64y0GEFSYfNrB+Qx1 OA7Z0KTUALwgCv+mPy1kWe59bNJDvO/1e+RDsY0ZbZpDZ+GEVVQs764Wd2tWVWSbfY4R z9XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3EOstB+zSvuECAjKvwQHSRUm4NOACiExdgr6F0h1apY=; b=b2dcyQuYXvE45I12hGfyy4r+dzjlU6LKQayplqyEKJ/mXu1aVjX8BlOQuPSE7cPasp DweF3t80hjRuUVPIU5mbjxnmhCF9fwNyTZ9+YK587TBOYbW4BS5ZSIY+R0DWgUSpdxIw gAUogQux8gob3wSs50TM9ZXsf0VVPckXrEhskJVcuKEIc1WTI7ICzefnqh0lYia6/wj3 KdNP2Tj0tUw14A3CoAaH9eMZ0rvrSOD8a32Ta/cNEm7L+w3HjQikoIHUOEaetFeGXHyw YmQpA4/bYJ+yik8uDrGOd0rR/6801dEVOHKV0HZ+o1WmY9p0XxztwA0RMd9eMj3oVWFl btbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8-v6si17857076pgo.311.2018.05.24.19.45.34; Thu, 24 May 2018 19:45:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034710AbeEXWHJ (ORCPT + 99 others); Thu, 24 May 2018 18:07:09 -0400 Received: from gloria.sntech.de ([95.129.55.99]:43056 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966031AbeEXWHD (ORCPT ); Thu, 24 May 2018 18:07:03 -0400 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 Cc: Jeffy Chen , Enric =?ISO-8859-1?Q?Balletb=F2?= , Tomeu Vizoso , Robin Murphy , jcliang@chromium.org, xxm@rock-chips.com, tfiga@chromium.org, linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org, Joerg Roedel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org 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 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: -- 2.7.4