Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp254461yba; Sat, 20 Apr 2019 01:42:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgMDMSlLgm8h2z/71aHA7doVSREgle25gcWRX9rUYHra/2li9s7lts2jxKC+KiUI1S8O5z X-Received: by 2002:a65:6295:: with SMTP id f21mr8363141pgv.129.1555749764194; Sat, 20 Apr 2019 01:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555749764; cv=none; d=google.com; s=arc-20160816; b=u2l+EkxgHfQKG6qonZlwV1QEtTuEZUPiQKiBQhb8Ou09b/PM1WnqzdQoVxQBbeU4su d5uBtpWvt4L8puXJO8zpLo/mEbL2yRnyFhwL3whsgi0jWZui32t63Otxw9x/Yqt7SwDn VQBprRodhkBvZXAjj5+96vd7hSEgz8hqJIBR5iVvMB/a3hzJED7GjC045yUXJ67Bl9sn SkWp4ltG6VaQvXjOdn6jzqK4BUmR5diC1M4uZKHV7d1RNAp1gOU9JcB/BAJZ2LX/q1b9 /oEESFsC6aqEop+AxnemAwk0yVd+hJd2gLNX060gxOypeF8x3rcBt5L9QBaW74X5ShQ5 QyMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9+6dI8bBr5EeS01R3XrlVG0WXReduip9VKJvNOCigX8=; b=C4AfmzUox7yknFgE9RdB6BAg0yJR8boNLDKaREOOSif1KpOYGQGyDRbsJ6wLN2vgDD M/vrY+2iqcQhEJHaFKPvsGOtxWvFvmDS+FtDur3DpAVZ5bj1UedWMVnuvQECj8z9ZdHb 7J0qGpk3S4oThNJNDjWyxqZd0WMvhO7eK7xB0/89YymwGhfVaBC7tWKOOvNmg9U/FPi0 cvetz2UrPTTN8fq2n25gRbJuOKUUx48Gn/P53rGOKc4l+6cQ1UxjWHYh5/cFDQst4dSp nBimgNLiBv4TOB4v7GU/kB5dUNrw//ZeESOQgMIZVrbH9UNuC1iMtT/cp5xE/WeuB3Wi zTRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="oB/54gkH"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si863935plr.105.2019.04.20.01.42.15; Sat, 20 Apr 2019 01:42:44 -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=@gmail.com header.s=20161025 header.b="oB/54gkH"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726280AbfDTIkn (ORCPT + 99 others); Sat, 20 Apr 2019 04:40:43 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:46442 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbfDTIkm (ORCPT ); Sat, 20 Apr 2019 04:40:42 -0400 Received: by mail-io1-f68.google.com with SMTP id p23so5993106iol.13; Sat, 20 Apr 2019 01:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9+6dI8bBr5EeS01R3XrlVG0WXReduip9VKJvNOCigX8=; b=oB/54gkHzFqwNJbbheAcUbsymK8yFduJNw7HLVjuPtiv3AO+dVR+kBLarSdV2bS5vM TiHU6IrswBSZ6eqxzC2XfRgG6LoTzqxduxzhIxBQBf60/FKFD4y7cIIalwwz7FCBVg// DI4uUPmvcrF06dk6eZDGIxVoQvCE1aDfL+3Tb/WPxo3ktureghIy+CsWzMapL4RM77VF egMRc/Glyn5jnVXkrafAELTGQN8nInuyZk2pGhfrlFGYO2SZ1VH1TxbmuwMpVIx02YXb txthkm5APXQ2IlztE6zNzyzjpv6Rrntk9JqYhEemTmuypUwPvitA9c/BLaPbhQ6qE31j wCmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9+6dI8bBr5EeS01R3XrlVG0WXReduip9VKJvNOCigX8=; b=MiSPd4KQJlIaei/Fw0AEY19fXsIjOKj5DmQEt7yhs26hkTmzG0pozpGvokCtvRK2S8 au0NThFLWvEWo7q7zZuK4zILVPfUFsyfAr1eLoT5I2RW9Gvtwz0wdf7psemc9yv9bNS2 XNvA0ghayuZAPufvAqyXTo3oexWwPtX2R0gRf3WyUivhX3rGPAjriahDHM9dbXS4rRCn aQ5cCg/QztMUQCubGPPy/3raD1Nz5sFlXVR0GBnja5yJTo+KAvojZybmgTYOCc37h182 9zQdniOUt5Grm6H2TodkwlBFUGLLYKEw7pEvYSBoMKnA5WnwWNjlYhMwqQxA4vegeCo5 VOjg== X-Gm-Message-State: APjAAAXxJB440exJWrZT7oqtxUVfIc6zpuwq/uUQVlmUIQmeHCzDJGPj zB2h+2Hj88HtlhoziGXrjnI4NHRZuqvLNNlB5No= X-Received: by 2002:a6b:6405:: with SMTP id t5mr4561098iog.190.1555749642090; Sat, 20 Apr 2019 01:40:42 -0700 (PDT) MIME-Version: 1.0 References: <1555662781-22570-1-git-send-email-peter.griffin@linaro.org> <1555662781-22570-7-git-send-email-peter.griffin@linaro.org> In-Reply-To: <1555662781-22570-7-git-send-email-peter.griffin@linaro.org> From: Qiang Yu Date: Sat, 20 Apr 2019 16:40:30 +0800 Message-ID: Subject: Re: [PATCH v2 6/6] drm/lima: handle shared irq case for lima_pp_bcast_irq_handler To: Peter Griffin Cc: linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List , John Stultz , David Airlie , Daniel Vetter , robh+dt@kernel.org, mark.rutland@arm.com, p.zabel@pengutronix.de, xuwei5@hisilicon.com, Michael Turquette , sboyd@kernel.org, dri-devel , devicetree@vger.kernel.org, linux-clk@vger.kernel.org, lima@lists.freedesktop.org, Rob Herring 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 Pushed to drm-misc-next. Thanks, Qiang On Fri, Apr 19, 2019 at 4:35 PM Peter Griffin wrote: > > 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(-) > > 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]; > -- > 2.7.4 >