Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3095894ybi; Thu, 18 Jul 2019 20:57:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKvypzOl11stsNVBJj4pTI72UmUlfOvDjvu7+DFMvgPgb5wMgZgPn5oqpB6jTWT7q6EdIX X-Received: by 2002:a17:902:d70a:: with SMTP id w10mr51486494ply.251.1563508641523; Thu, 18 Jul 2019 20:57:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563508641; cv=none; d=google.com; s=arc-20160816; b=aoRhxTi10V6eAp0H8rjgi3mQKEsG+FzEFqpFbtcxFbv9fbEnOWdHCLOB9r8UA3dh1f enQnPVPmXwTSFnmbRrFJ6yC0UqGlPZHlZVXPGMpN/OOtm0f8fsIIiss0mMHiQ9TY6GUZ edFG0rNmww06OdLPCRxqYgfWIVedQPV804SPks5fzZRkwKBWxxio3hSO7d7SDNniFXl5 5YQ+Jegc32nFIpF7UNA9qH5eObC3Qpgmo2inEFtUw/6A+XIS6qVBxkXj86WLSMOoVuoG 86yy2uZuc64i9rGIj7WWONObLu+0njC/vu0kuES6qJ5L127zcSjhdQEaCQGqAG7mhwps lBmg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=cmPG3CYaWRdriafdW7LxVA4fS/s988rKJUC8+Q7AhBE=; b=iwkoN1tADeNIDRFOaV3RqB8tyXN0BertiANmAG1mdEYKicHBvuT/yrW0FFry6/D6Zs fnREqJ1PQCx5wBkT08tZ2Gw9A86j0uJrr8lFZfHQxEcdau6fMwuY0vxuHikD+RhoQjij J+c1hZu/U4/PwxBIvS62Y2oNfEhsrE17z0lmt0STT5yqZRqpmcYdyojylzVNm0qg7dfR 4IYxipG0B67F/41kB3hWf6/FwCgKc7As/76Hqyldimsr3ow6BOpnVykaQ7pGPQfWdT14 obqlUOjGI6XQqtE0IXe4K+JwrmgZW8mPKlMtcVwSqXjl8d4eIZY18aFlMy3DXAvxFQ9D Mktg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="VFme/5Uj"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cn1si1808614plb.204.2019.07.18.20.57.04; Thu, 18 Jul 2019 20:57:21 -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; dkim=pass header.i=@kernel.org header.s=default header.b="VFme/5Uj"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbfGSD4q (ORCPT + 99 others); Thu, 18 Jul 2019 23:56:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:56068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbfGSD4q (ORCPT ); Thu, 18 Jul 2019 23:56:46 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5F11E2082E; Fri, 19 Jul 2019 03:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508605; bh=/bYiLhQ2bS9pcCsRPAJ+8A98ijnEbnaNzmUqu1Yf4og=; h=From:To:Cc:Subject:Date:From; b=VFme/5UjzcJLqJ50dGR1eQjs/VgmYIWJaMwCXIWWnrXP0l2u5Nv0Gf+E05Ra16G3e U+w02CX97sEPGDx9mc4K03siLpij+Ml2xkUrspEm4npxxgFlPvF9uqkSyxCIgYbPVN BtGdZO8qBMEtVUZPDXjCaT/lZpRkEZbF835KvLb0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Peter Griffin , Rob Herring , Daniel Vetter , Qiang Yu , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.2 001/171] drm/lima: handle shared irq case for lima_pp_bcast_irq_handler Date: Thu, 18 Jul 2019 23:53:52 -0400 Message-Id: <20190719035643.14300-1-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Griffin [ Upstream commit 409c53f07a81f8db122c461f3255c6f43558c881 ] On Hikey board all lima ip blocks are shared with one irq. This patch avoids a NULL ptr deref crash on this platform on startup. Tested with Weston and kmscube. Signed-off-by: Peter Griffin Cc: Rob Herring Cc: Daniel Vetter Cc: Qiang Yu Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/1555662781-22570-7-git-send-email-peter.griffin@linaro.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/lima/lima_pp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c index d29721e177bf..8fef224b93c8 100644 --- a/drivers/gpu/drm/lima/lima_pp.c +++ b/drivers/gpu/drm/lima/lima_pp.c @@ -64,7 +64,13 @@ static irqreturn_t lima_pp_bcast_irq_handler(int irq, void *data) struct lima_ip *pp_bcast = data; struct lima_device *dev = pp_bcast->dev; struct lima_sched_pipe *pipe = dev->pipe + lima_pipe_pp; - struct drm_lima_m450_pp_frame *frame = pipe->current_task->frame; + struct drm_lima_m450_pp_frame *frame; + + /* for shared irq case */ + if (!pipe->current_task) + return IRQ_NONE; + + frame = pipe->current_task->frame; for (i = 0; i < frame->num_pp; i++) { struct lima_ip *ip = pipe->processor[i]; -- 2.20.1