Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7613123ybi; Mon, 22 Jul 2019 16:55:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhSHhpdIvM8s39XjdlhY0u07nAuUyBCNRoJbXRuD64u+weEew+0NpV2lgFfQqpQnSIC3Fb X-Received: by 2002:a63:550d:: with SMTP id j13mr10680244pgb.173.1563839700251; Mon, 22 Jul 2019 16:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563839700; cv=none; d=google.com; s=arc-20160816; b=nTAg8GhSlpyUE/x3mqVFd3IM+pqgZTNqgZH9f9hm1zAOBYpOJovcynNrbIRSdkt+Ax 94b83fQMQlCFkGvz7e3zLDb3WlB8FUcC0k3Sd5fjwnC5ZBhX2yasznnBWR5xUso4VQMf Bqk3gNA7PFuWJt8tmSlYJsoiqQCNYgBprE+IObPuS+raz7JNhP1MVrLIXRLn3wUmFecr fQ9uclZ9WRzWYDp/iFFx349mkI7btChIKW/ofH09xulNdEem3p5maXZhukG3i38D4mow 1YCBvjwggFo/x2fOynfXIzJAXy/LvHcje8bbkKtRNQCVVwEj+iUdtTHJeRWwODdrTDgY da4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nChDLJOZPg7dPTNM27Gi/1xsGavkYn+CO9mE5CxGd8w=; b=ElpTntRdvRsPK09GTeDsfvvqqCK0+W1JlME6uSvdktDlOGqUFi8EvyHpXbnk7J1xrp m2DDylXC/XNJezCP1TV1vUeCEch5iLppHvFcIWh7dRnuKDlNzOMqxgQi2n5vs7rssVba lEwP+we0p1ezlhkM2NsAHmZDPuaQgL2NjW+Ex6fI4a+jU9ubc8MOnp0qTpJFu/5H+0cf uD+n6gJOpcIer3OBm4n9P4AHz3mnaQtRWrWoPPsuhJTOTyPuALLe3jk+InsnFTwikHt6 R8Xec7NQxMw0NkIhPMuKpkjlW1RDz6P25+v39/qc5V6C5p+/wP1SN2DKsYuQ5+Btl4Wj tNHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=Vk0ki42H; 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 z7si11154571pfz.154.2019.07.22.16.54.22; Mon, 22 Jul 2019 16:55:00 -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=@poorly.run header.s=google header.b=Vk0ki42H; 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 S1731549AbfGVSWZ (ORCPT + 99 others); Mon, 22 Jul 2019 14:22:25 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:42119 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726652AbfGVSWY (ORCPT ); Mon, 22 Jul 2019 14:22:24 -0400 Received: by mail-yb1-f195.google.com with SMTP id f195so15287258ybg.9 for ; Mon, 22 Jul 2019 11:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nChDLJOZPg7dPTNM27Gi/1xsGavkYn+CO9mE5CxGd8w=; b=Vk0ki42HNnol9MsZVJosQk17CkKb6y36mdKMVgVZAn2LD6+9qeDwF4ob45XpGyYdLg p17NL9kJ0JMQGeO6qoaEOwfDtQetW9UoiFxjlSC6wgBXha+g+AY57eDWvRTKiV/03OGU u54O4ff4XDkRGhYb7gG2emESK74nvP5F/kUyT6CAIpj3B54NvkovkSku55PrwuVTkckT KnV7pSjg57YUvmmzFufiU3B43Oplk8wkzgentsMSbQNZ5lG8G+14hmrb5+07fm3NQnu0 AYyRduf5r7vrW3pgIBnEox0Hte4GItyMPvn6COmqz+hyyK60U0ys9Dc6cliaaLVcxX1F euGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nChDLJOZPg7dPTNM27Gi/1xsGavkYn+CO9mE5CxGd8w=; b=WPH4haJMFnwomwmDxJDc6AUvY0NJmXfd/TlensoHErafsdrv3mT0fBs65Vr7t+4Kkf FmpRyE0WgbV5Cn+2pHBaD5KxEyWZjRFJJ5Fc+7zmU7RRJDBQrkIP9bRnMUVYtuwPTtNB BYaZZN5AByPSilAkg3G+jcayHtLA3PueQPioa7rF3UDKcI+I3EO0vebnP5HpM3RHP9XZ NaD8J4Ei8h+rE4oanr1ELmqFhuPvjfwZsplilHCX6ixqMYyif2BlQ4zghTI1yxe/T8b0 VRoVTqN6/sxhgylJ2WUZrP/EDbhiwj3ZohxoiEJhQ4enyIgIw9r03sErPjn8+J0buhjN U2rA== X-Gm-Message-State: APjAAAWPeJShSFHcpKf/xD2FD4aqGm4xNNrYvND+kZ4+L1AwkPFpgux1 yukrt3vGrvsP4NWXTQkwX/ezCg== X-Received: by 2002:a25:7c05:: with SMTP id x5mr43951829ybc.358.1563819743691; Mon, 22 Jul 2019 11:22:23 -0700 (PDT) Received: from localhost ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id u123sm9932475ywu.75.2019.07.22.11.22.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 11:22:23 -0700 (PDT) Date: Mon, 22 Jul 2019 14:22:22 -0400 From: Sean Paul To: Rob Clark Cc: Brian Masney , Jordan Crouse , Rob Clark , Sean Paul , Jean-Philippe Brucker , linux-arm-msm , Douglas Anderson , dri-devel , Linux Kernel Mailing List , David Airlie , "Kristian H. Kristensen" , Daniel Vetter , freedreno Subject: Re: [Freedreno] [PATCH] drm/msm: correct NULL pointer dereference in context_init Message-ID: <20190722182222.GG104440@art_vandelay> References: <20190627020515.5660-1-masneyb@onstation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 28, 2019 at 05:57:26AM -0700, Rob Clark wrote: > On Wed, Jun 26, 2019 at 7:05 PM Brian Masney wrote: > > > > Correct attempted NULL pointer dereference in context_init() when > > running without an IOMMU. > > > > Signed-off-by: Brian Masney > > Fixes: 295b22ae596c ("drm/msm: Pass the MMU domain index in struct msm_file_private") > > --- > > The no IOMMU case seems like functionality that we may want to keep > > based on this comment: > > https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/msm/adreno/a3xx_gpu.c#L523 > > Once I get the msm8974 interconnect driver done, I'm going to look into > > what needs to be done to get the IOMMU working on the Nexus 5. > > > > Alternatively, for development purposes, maybe we could have a NOOP > > IOMMU driver that would allow us to remove these NULL checks that are > > sprinkled throughout the code. I haven't looked into this in detail. > > Thoughts? > > yeah, we probably want to keep !iommu support, it is at least useful > for bringup of new (or old) devices. But tends to bitrot a since it > isn't a case that gets tested much once iommu is in place. Perhaps > there is a way to have a null iommu/aspace, although I'm not quite > sure how that would work.. > > Anyways, > > Reviewed-by: Rob Clark > > (I guess this can go in via drm-misc-fixes unless we get some more > fixes to justify sending msm-fixes MR..) Applied to drm-misc-fixes for 5.3 Sean > > > > > drivers/gpu/drm/msm/msm_drv.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c > > index 451bd4508793..83047cb2c735 100644 > > --- a/drivers/gpu/drm/msm/msm_drv.c > > +++ b/drivers/gpu/drm/msm/msm_drv.c > > @@ -619,7 +619,7 @@ static int context_init(struct drm_device *dev, struct drm_file *file) > > > > msm_submitqueue_init(dev, ctx); > > > > - ctx->aspace = priv->gpu->aspace; > > + ctx->aspace = priv->gpu ? priv->gpu->aspace : NULL; > > file->driver_priv = ctx; > > > > return 0; > > -- > > 2.20.1 > > > > _______________________________________________ > > Freedreno mailing list > > Freedreno@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/freedreno -- Sean Paul, Software Engineer, Google / Chromium OS