Received: by 10.223.176.5 with SMTP id f5csp1037007wra; Fri, 2 Feb 2018 10:05:19 -0800 (PST) X-Google-Smtp-Source: AH8x227iFGIriAfqaNS5vIfIpkXmCMS3Xwxg6ikiVg0HyH24LBUgM91PxoASWyRSQ98DEM9D1VBo X-Received: by 10.99.145.66 with SMTP id l63mr31201529pge.273.1517594719644; Fri, 02 Feb 2018 10:05:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517594719; cv=none; d=google.com; s=arc-20160816; b=dDMEx1tnHJ88IZXCctpxYxIBrkOcBNT0S0l0eEpyAZV6FmDxmZmJ3SYCgM5SX97xrb GTPbV9P41Nqw3R3tad83sgMsw3kca83TnFmTSRLtpdH8UkNsbDE8dhcQ4rgqEp+ug4Ry 18hLVZPD/ugYFOjmnlO4mU+8wefiOjPmFDvrnhjEHQMrDz1+e9BI59TOWGNPYFkTHeXk p5G5m1sbGX+Ml3OuJcPG31bpdaP89aVQ2tO3m+gN7RZngoB1mObk1PoLwnLQhdG7/0IX 8odjDKCGS4AumJHK7ZFjXj/d+S4FfH9h/jemUdfu+yxp6/bzOlmysxTe26mpzy5lGNWG txAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=NIihBQelUkmaFIjcHYcIaZmC4jf+L2E1EgWZt06hYYo=; b=czljNcJWVEa+MkGPpdNj4eeW9j+Puvaq84YRl+TgEHQsmt8sKIkARWDQ0TGiv4NP4R yBbyu4pYtXvk67qojOiseMWGzGXqN6d+RSDmW9OGFSPK3QwhjKM3jbmyLagic9OS6as8 91dHf31jldi4DBnCwMASD0GQJrQ0kNN1UdhnpptOar8O8fLkPmWF0evV8nIjFYlDIibt i73vfZ3YDYbhOIxoqaPKzJoJ0Ag1NxsjlCQNGVPPH1vBTQwkzRKtJCknjadrTo9LendT RPfLpOnhlL1EUV7efARYtXgbh1clEJYRVZR0ysU1MRzE/99BWEVDcnDUsfJkA6xZFEd5 tgPQ== 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 z5-v6si2112079pln.677.2018.02.02.10.05.05; Fri, 02 Feb 2018 10:05:19 -0800 (PST) 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 S1753176AbeBBSDv (ORCPT + 99 others); Fri, 2 Feb 2018 13:03:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:37384 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752639AbeBBRIi (ORCPT ); Fri, 2 Feb 2018 12:08:38 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0AAF6F01; Fri, 2 Feb 2018 17:08:37 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Schake , Eric Anholt , Sasha Levin Subject: [PATCH 4.14 031/156] drm/vc4: Account for interrupts in flight Date: Fri, 2 Feb 2018 17:56:52 +0100 Message-Id: <20180202140841.741635524@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Schake [ Upstream commit 253696ccd613fbdaa5aba1de44c461a058e0a114 ] Synchronously disable the IRQ to make the following cancel_work_sync invocation effective. An interrupt in flight could enqueue further overflow mem work. As we free the binner BO immediately following vc4_irq_uninstall this caused a NULL pointer dereference in the work callback vc4_overflow_mem_work. Link: https://github.com/anholt/linux/issues/114 Signed-off-by: Stefan Schake Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.") Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/1510275907-993-2-git-send-email-stschake@gmail.com Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vc4/vc4_irq.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/gpu/drm/vc4/vc4_irq.c +++ b/drivers/gpu/drm/vc4/vc4_irq.c @@ -208,6 +208,9 @@ vc4_irq_postinstall(struct drm_device *d { struct vc4_dev *vc4 = to_vc4_dev(dev); + /* Undo the effects of a previous vc4_irq_uninstall. */ + enable_irq(dev->irq); + /* Enable both the render done and out of memory interrupts. */ V3D_WRITE(V3D_INTENA, V3D_DRIVER_IRQS); @@ -225,6 +228,9 @@ vc4_irq_uninstall(struct drm_device *dev /* Clear any pending interrupts we might have left. */ V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS); + /* Finish any interrupt handler still in flight. */ + disable_irq(dev->irq); + cancel_work_sync(&vc4->overflow_mem_work); }