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: 10908703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5D1617EE for ; Fri, 19 Apr 2019 08:36:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96DAA28D78 for ; Fri, 19 Apr 2019 08:36:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B2AB28D87; Fri, 19 Apr 2019 08:36:23 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0310C28D78 for ; Fri, 19 Apr 2019 08:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GGkronddysxNutL+sWznwpdSZ07ZnInQGUJ/991a1Cs=; b=ibf3nXtP5M4qevWt2CkXy4SWag 8GEa2jqI2z7i0q69g6ABtvYnNUCJ2PjOMpErP2L6+pHcSaHe2KOG33Fm69gTKfGJifSoZDiu7oker EuUJ9CLEIpvB9mNoVs09lZwqe+N520GGtduHLKUnRs2N7xwZD+VYolOUqW086GTsd4PeHgDOTbgW9 36q6lHQVYF3s6oSjIvJrJSjuhkMYUus3nNTOIgRZu68PILimKz6FUSxAX+zWuX13q/YlEHs5Ow2Jw onqWDJO9uQ++jkvCCqxRd8GRIgJIqSrXRTTMNPVEwSzJguWpiL91nPvVxfoLG5f4Li7FJBw/rkBkq 14FZD3RA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHP0N-00085L-02; Fri, 19 Apr 2019 08:36:19 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHOzJ-0006oa-3M for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2019 08:35:18 +0000 Received: by mail-wm1-x341.google.com with SMTP id q16so5493831wmj.3 for ; Fri, 19 Apr 2019 01:35:12 -0700 (PDT) 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=oX6ZfbPEOa04lSWS9aWvSKcenrotB787Skih7xAaBB3NzaQW2DlNPHqcjkvEguZYQy /rwPPToIxAk56xJ7HM0tRYZH0E4lAy9aBkZJ+1lq0TGSUhIdKpjjVKm3OnB6C3ebFly/ IWeZcIn7iq73liXEaHZWb7L/RE46poljV59gS74KYsd73H14GhwT/rwJv2nwZ52V8DBm GrkPrP0FeZIZPrwgD9kUMqkxYOc9wJFg85eLU/XDYpS9totqdJTMQLej5K9oOf18UD0t +qNgUQReK2/HGN7b+nZ32aT7wjO1WGsu36Ntx4tTUNBDvVOJTlPc5yRbH/V6wwaAdGrW zMrw== X-Gm-Message-State: APjAAAUwTO/pmzGw6bAKaYhL6pk2C/BbDn9ZtIZID0sfzVCijxvGFP3j x9Hklu2s8Wv+c5rmyVXKNq4j16iMTh0= 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) 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190419_013513_390304_899EF479 X-CRM114-Status: GOOD ( 14.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , devicetree@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Qiang Yu --- 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 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];