From patchwork Sat Feb 10 14:20:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 10210513 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 671FC60329 for ; Sat, 10 Feb 2018 14:20:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 572D6291B1 for ; Sat, 10 Feb 2018 14:20:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BA26298E0; Sat, 10 Feb 2018 14:20: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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 F0DEE291B1 for ; Sat, 10 Feb 2018 14:20: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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To: References:List-Owner; bh=/1i9MrrTCTBTZl5ZTnk9hVZo6ex7zhNbb+uttf0sbvs=; b=LOt ImV8JOtg2tdfoni3PuGN6i9+dadoGGjh2gbfFcV8jxxmHi6ZV68jC18uCZ5VbOvJzgIkY8070vG9m hrX90P0sUcTJ22yadwfnBWzUYNSwpbpWSjBjVcmXL5PmbD5neYr9VeA2o6NDsPB+YoD9ymxfFnxtS S5ZTE8Dlqdwkdc3jOi187AK1RyLngwpHFjAHDM9SuUI9hWlg/O4XGW8IAqlSumk4FHiE9q2EEp+vy dtT5dZLbpk1rITaSAy16CzkzGHi5dk+ZT+x2TPccOAdLkLMzV+8WCsl5OpiUFKK6y+zFkpr42bhrl xb39tz37OP/oFZemXf7AFyE4LdUxqmg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ekW1P-0001pp-8A; Sat, 10 Feb 2018 14:20:55 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ekW1B-0001Z6-Sl; Sat, 10 Feb 2018 14:20:43 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2289980D; Sat, 10 Feb 2018 06:20:29 -0800 (PST) Received: from why.lan (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9E5383F487; Sat, 10 Feb 2018 06:20:27 -0800 (PST) From: Marc Zyngier To: Mark Yao , David Airlie , Heiko Stuebner Subject: [PATCH] drm/rockchip: Set IRQ_NOAUTOEN flag before requesting the interrupt Date: Sat, 10 Feb 2018 14:20:20 +0000 Message-Id: <20180210142020.30212-1-marc.zyngier@arm.com> X-Mailer: git-send-email 2.14.2 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: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Calling request_irq() followed by disable_irq() is usually a bad idea, specially if the interrupt can be pending, and you're not yet in a position to handle it. This is exactly what happens on my kevin system when rebooting in a second kernel using kexec: Some interrupt is left pending from the previous kernel, and we take it too early, before disable_irq() could do anything. A better way of ensuring safety is to set the IRQ_NOAUTOEN flag on the irq before requesting it. Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 19128b4dea54..72554f404b7e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -1569,14 +1570,12 @@ static int vop_bind(struct device *dev, struct device *master, void *data) mutex_init(&vop->vsync_mutex); + irq_set_status_flags(vop->irq, IRQ_NOAUTOEN); ret = devm_request_irq(dev, vop->irq, vop_isr, IRQF_SHARED, dev_name(dev), vop); if (ret) return ret; - /* IRQ is initially disabled; it gets enabled in power_on */ - disable_irq(vop->irq); - ret = vop_create_crtc(vop); if (ret) goto err_enable_irq;