From patchwork Fri Apr 19 08:33:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 162523 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1750451jan; Fri, 19 Apr 2019 01:35:11 -0700 (PDT) X-Received: by 2002:a5d:6a0f:: with SMTP id m15mr1949606wru.309.1555662911234; Fri, 19 Apr 2019 01:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555662911; cv=none; d=google.com; s=arc-20160816; b=Gqv6/9Rc80ujfDeee6yjTmRRC8bYEEfuujTqo63mzVf0c71W33BNDxZD1z6DvV5wxt lud/KeJbUQE5FQ40cKPfXVlczHg+/SHWtRM17qOAuNpROs2gYnJGXjCyM/FF08LPNt+j x9MVzAwhPjIyLdTZTGSwskdWuUUmywtovTFQGbzOQGCWE3M9FwNLJ0oOUSmOdT5q8cjr ZMhrqkUhkcAyN+SYdP3KfRC6UMwO0EJDO/yvJKLc+umUSRWNOraw8yNEG5fW1Bi8n6zG 2f2rvvuPbLVlw86SlukIH6Ya0zCNrQvTCcec37M3w2TUS6DUzb6RBC2fsRaVL6aU2XFw bhxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ce+xsHXl4yFXBVy1VUWq5FJ/Ala/Os2pJsWh4xCgH2Q=; b=hd/vJKGRTPrvlcqmZOSL2UTkiMfD6Qfw+eHzdu8K9bEPXEJjfyjLi/kzJxg1nE+Dj7 5QGNk7D/khBbqUAeosVUK8p7IMy4LcNg4o9D3o8nq1EYwq1plm9XygEkvQfPvF/YxwOX 3ISXYToNN/AWOOpPGMm80nW430cfx8TKYzds2qqsA3xztVfcwUow/ucvArr+kNdcXIMZ TFe0p6Gvv09XrA2NKpHDJ9lzFvotf//84HqvsJNobqapDwQHYNh5SQQWn+Y37z5dNtpr gzKGltywmi/6sVew0Dm3UNhTiuZxNdSntRLe6fASOxESt1/8RlFGCnDAswqxE/t31A0X 8dGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IE8Ds0UE; spf=pass (google.com: domain of peter.griffin@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=peter.griffin@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g66sor2455921wmg.20.2019.04.19.01.35.11 for (Google Transport Security); Fri, 19 Apr 2019 01:35:11 -0700 (PDT) Received-SPF: pass (google.com: domain of peter.griffin@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IE8Ds0UE; spf=pass (google.com: domain of peter.griffin@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=peter.griffin@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ce+xsHXl4yFXBVy1VUWq5FJ/Ala/Os2pJsWh4xCgH2Q=; b=IE8Ds0UEUpH1f+3I6uwelgIIq26MWuAaBjFXVFvqp0hUyWENlu7GgR+VSATdjFczq+ a7vz1MIpVKHX767N8pRQovw7XNRECSOx5GUUC+8Ca/lQaopQ2l258H1JlwxoabzPtM8b grZPsuCzCqTQF7t2RnZrdh8zLjlUzal5b64UHYh7ZMwl1LxFjB6ZosWOkyJKEtlp0cYD GhKmw5IPZdB2ParXTexHcEYHUyrFVQEREIvKrUg2pDiJFmMfodtZ+ViIbxGt9J0dZpYl 3/Yl22r1W6/FAQdxpWIqafuO0evAhh6vdcygaSDBnqr4LbmAW7iFzUBtA1L89XigRGW/ /i9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ce+xsHXl4yFXBVy1VUWq5FJ/Ala/Os2pJsWh4xCgH2Q=; b=UclDwkLNYwiA+yRpgkcb4fQR7a1k+pYTB+weDdONdXwmOBhDX9FN0mQcs/iPnufr6p rXgpwPoMSN3WQLf5byYuZqYbdirczFVMh1ykBfiO9gtS3/OpJrzVCvgJBIEodfx6k9sn d17T1Cg4ZMdjzwJ54fMSNNZsSpg6tfR7qsR7Fv87e90ZeQSR/e6VmnqwAxMVNMb1sTPi oHROvE+gnGjEJWWvjnChJWcFcqlHd9rcmp9Bm9VHmV+KGWtpMt7XZOdKrnQGnQIsfF2B zzf6B20vL0NnfV8f6g09kgdw1deirm08obBcV48KztAU1+7OgE4i3F8NLILQBrryqwMM Do2w== X-Gm-Message-State: APjAAAVQEzHCn4Ug1PWl8DId90pJ66fbgOazx8FHsm98wCSvkTUq8ZRh LCPE/CoE+0ZknR0to4Svyjpsux2T X-Google-Smtp-Source: APXvYqxHCiejcT6tfcxtXdLG5uPOoyx8wHXcYqizHu+I/8l6MFuXaHqJKEsT1gnEHkdZKqtfL7vAoQ== X-Received: by 2002:a1c:185:: with SMTP id 127mr1758875wmb.145.1555662910901; Fri, 19 Apr 2019 01:35:10 -0700 (PDT) Return-Path: Received: from localhost.localdomain (cpc89244-aztw30-2-0-cust4998.18-1.cable.virginm.net. [86.31.179.135]) by smtp.gmail.com with ESMTPSA id t76sm5700147wmt.8.2019.04.19.01.35.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Apr 2019 01:35:10 -0700 (PDT) From: Peter Griffin To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, john.stultz@linaro.org, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, mark.rutland@arm.com, p.zabel@pengutronix.de, xuwei5@hisilicon.com, mturquette@baylibre.com, sboyd@kernel.org, yuq825@gmail.com Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, lima@lists.freedesktop.org, Rob Herring Subject: [PATCH v2 6/6] drm/lima: handle shared irq case for lima_pp_bcast_irq_handler Date: Fri, 19 Apr 2019 09:33:01 +0100 Message-Id: <1555662781-22570-7-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555662781-22570-1-git-send-email-peter.griffin@linaro.org> References: <1555662781-22570-1-git-send-email-peter.griffin@linaro.org> 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 --- drivers/gpu/drm/lima/lima_pp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c index d29721e..8fef224 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];