From patchwork Tue Mar 28 13:08:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 9649399 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 E120F60113 for ; Tue, 28 Mar 2017 13:10:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9F1427F9F for ; Tue, 28 Mar 2017 13:10:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF0D328334; Tue, 28 Mar 2017 13:10:30 +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 7278A27F9F for ; Tue, 28 Mar 2017 13:10:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FC076E5EC; Tue, 28 Mar 2017 13:09:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0039C6E5CA for ; Tue, 28 Mar 2017 13:09:13 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v2SD9B5b009594; Tue, 28 Mar 2017 08:09:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1490706551; bh=vALCZH8oHlYUhy6RoTW+mOeVYFYEv3M2BuwpAH3k8Xs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=H9M69qnsnbQsJylIqpT9bLEpoUz7Nt9ywTprLzgc99gv1UxUaCKojbalUCkI/3loD KJG/Q+lYBgC+GI4XAd8NdVd31K4HxWW+dL+189suqYpGfeobApAU7ITjbLrCkR6FJK 9N4mQX76qIqhWRbLcKmKqW8CWveGqgAe0HBMwI+I= Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2SD9BoW006754; Tue, 28 Mar 2017 08:09:11 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Tue, 28 Mar 2017 08:09:10 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2SD8Lif008523; Tue, 28 Mar 2017 08:09:09 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCHv3 30/30] drm/omap: fix crash on module unload Date: Tue, 28 Mar 2017 16:08:16 +0300 Message-ID: <1490706496-4959-31-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490706496-4959-1-git-send-email-tomi.valkeinen@ti.com> References: <1490706496-4959-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Cc: Tomi Valkeinen , Jyri Sarha 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 When unloading omapdrm we get a NULL pointer deref in omap_drm_irq_uninstall(). This is caused by: 967dd48417874dd25491a4e933648f394a64f70f ("drm: remove drm_vblank_no_hw_counter assignment from driver code") We shut down all the crtcs at unload time before calling omap_drm_irq_uninstall, so the code in omap_drm_irq_uninstall() is unnecessary and can be removed. Signed-off-by: Tomi Valkeinen Cc: Daniel Vetter Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/omap_irq.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c index 26a3c06aa14d..115104cdcc59 100644 --- a/drivers/gpu/drm/omapdrm/omap_irq.c +++ b/drivers/gpu/drm/omapdrm/omap_irq.c @@ -285,25 +285,11 @@ int omap_drm_irq_install(struct drm_device *dev) void omap_drm_irq_uninstall(struct drm_device *dev) { struct omap_drm_private *priv = dev->dev_private; - unsigned long irqflags; - int i; if (!dev->irq_enabled) return; dev->irq_enabled = false; - /* Wake up any waiters so they don't hang. */ - if (dev->num_crtcs) { - spin_lock_irqsave(&dev->vbl_lock, irqflags); - for (i = 0; i < dev->num_crtcs; i++) { - wake_up(&dev->vblank[i].queue); - dev->vblank[i].enabled = false; - dev->vblank[i].last = - dev->driver->get_vblank_counter(dev, i); - } - spin_unlock_irqrestore(&dev->vbl_lock, irqflags); - } - priv->dispc_ops->free_irq(dev); }