From patchwork Wed Aug 9 17:17:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinclair Yeh X-Patchwork-Id: 9891341 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 EE2DD60384 for ; Wed, 9 Aug 2017 17:18:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D530D28A64 for ; Wed, 9 Aug 2017 17:18:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6E6028A96; Wed, 9 Aug 2017 17:18:22 +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, RCVD_IN_DNSWL_MED 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 9DC0728A64 for ; Wed, 9 Aug 2017 17:18:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 22D926E378; Wed, 9 Aug 2017 17:18:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EX13-EDG-OU-002.vmware.com (ex13-edg-ou-002.vmware.com [208.91.0.190]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4CE6B6E378 for ; Wed, 9 Aug 2017 17:18:17 +0000 (UTC) Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Wed, 9 Aug 2017 10:17:35 -0700 Received: from vmware.com (promb-2n-dhcp29.eng.vmware.com [10.20.88.29]) by sc9-mailhost2.vmware.com (Postfix) with SMTP id 5ACE0B053D; Wed, 9 Aug 2017 10:18:14 -0700 (PDT) Received: by vmware.com (sSMTP sendmail emulation); Wed, 09 Aug 2017 19:18:16 +0200 From: Sinclair Yeh To: Subject: [PATCH] drm: Support drivers with threaded irqs Date: Wed, 9 Aug 2017 19:17:54 +0200 Message-ID: <1502299074-62988-1-git-send-email-syeh@vmware.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-002.vmware.com: syeh@vmware.com does not designate permitted sender hosts) Cc: Thomas Hellstrom 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Thomas Hellstrom See LWN article at https://lwn.net/Articles/302043/ Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Singh Rawat Reviewed-by: Sinclair Yeh --- drivers/gpu/drm/drm_irq.c | 6 ++++-- include/drm/drm_drv.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 3b04c2510..ef9b4be 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -127,8 +127,10 @@ int drm_irq_install(struct drm_device *dev, int irq) if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED)) sh_flags = IRQF_SHARED; - ret = request_irq(irq, dev->driver->irq_handler, - sh_flags, dev->driver->name, dev); + ret = request_threaded_irq(irq, + dev->driver->irq_handler, + dev->driver->irq_thread_fn, + sh_flags, dev->driver->name, dev); if (ret < 0) { dev->irq_enabled = false; diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 81971dc..c47abbf 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -333,6 +333,7 @@ struct drm_driver { * drivers which implement their own interrupt handling. */ irqreturn_t(*irq_handler) (int irq, void *arg); + irqreturn_t (*irq_thread_fn)(int irq, void *arg); /** * @irq_preinstall: