Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7153316ybi; Mon, 8 Jul 2019 15:43:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQTT3kefhQutK3kvcJ+0hpIKgyfnFm7Z2B+CwrSSHCjzqD4mSTSOw2+i13q35p5+SWejND X-Received: by 2002:a63:2252:: with SMTP id t18mr20614357pgm.5.1562625816107; Mon, 08 Jul 2019 15:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625816; cv=none; d=google.com; s=arc-20160816; b=m+LCyv1GrwpACNRG3BPVowpaJoo3l1QWcc2CBwHMu5bg6n+Y8Z0d//4RD9fXHjb8A7 kRiA8UWG3DlJb/br4vORjLNi3JFffcl8Wm4KKhWiloKP+4JJ4k8jviF8Zz1zcFXiGzBf Zn2SCInrhAfBisl+T2jezA6oNtVylp8KOpOTC2z/ViRgaEgX5YBi1DkvOXdpHLGkAiA+ y1lHotw6tIGrEY7GO0sEVpsIyTSlZP3mMisd1M7cfkVZPibdiVA8YHYSx9pDpZqDgvO1 LUWsouZzOt0O1IuvIaby+n4u7q7RLavMjNMcINZsQkPK+otQikZmM10BYzwRp9iuczVo uS4Q== 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=fDCoSY5K0ITJqQYvscwo5UxJiyuZc3RyIH7jJSLU88U=; b=GqLHZGQyVIpXhYT6mkETbLxka5t6tfFlM5U0CPMvLD/Bwy/n+jyc70wXVOFdCwMhoE 3SGU705ij8T9RXKcvUfQanTwQ0s3zD7/PMAqZQ+ooun1DPzfcw9LqfBwhDGkLVcVGQPl nDhR9G/4g3pFL69SWRCghxWdUIOAeG6k7p/9MAOLsTMox7s8f3D26IsOQvpOG6GtRMN/ UdwjvxSDOA6BreC1xHc8TiZvDOo+1ObG+NquZoiBzA6aVXKIP7nmUvQcoDXWIzvZSG2o IZpxbYS7uFu9X/HHhptJGMnchQOXQmUfSEZ2kXEFuAu5raJd2rGpApdWqsr592khhnk4 odig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CfLjv4t9; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z17si718601pjr.21.2019.07.08.15.43.21; Mon, 08 Jul 2019 15:43:36 -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=@linaro.org header.s=google header.b=CfLjv4t9; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391511AbfGHQKb (ORCPT + 99 others); Mon, 8 Jul 2019 12:10:31 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:34342 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729062AbfGHQKa (ORCPT ); Mon, 8 Jul 2019 12:10:30 -0400 Received: by mail-pl1-f196.google.com with SMTP id i2so8528296plt.1 for ; Mon, 08 Jul 2019 09:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fDCoSY5K0ITJqQYvscwo5UxJiyuZc3RyIH7jJSLU88U=; b=CfLjv4t9r4Kg2mSofS2nlQZMto3UY4mstJJjBcy91IFpxTd6+xOv3VwdVLcgFVUdVW j5PVsTuIkjKvjex7sWx70GltkB3B71Am79TnP0MeO+ihAkpGOpOQDafpfMi9i7wnEUUH 3OHP5VEf+64cy0LL8hikc/pn1wZ/KR2jge1woKA5a6tL1EGf27T4yOG48LdVyh8xewdi 4/+ddMjgJKskc5Ivy46J/G5z+QyT2ZWcf3TxK2wuJqimj0xykazxXmlcv65ZFjE1aIJl TYa/I2day1zmNig/jiZU9ScLfIp2yEcPl0pav2+YEs06oGpQ0n42my45uw5pfHQBvory TtXA== 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=fDCoSY5K0ITJqQYvscwo5UxJiyuZc3RyIH7jJSLU88U=; b=I7khg/GI/UATsDsH6/K6O76bSW4qAVrIJNO67SrPyEdCT5XGPkiNAiow8vYojAxnXJ qO5BArPFqyYrcgBGtwG3GB2yfufcOgExSieF+QULikAACC/F9y5Yzz5/pK84KCx9NQTE 641W/AcZtbt15e24FTP3lxvDde5HrtqgK6jltAOKKt2zOoV6NdjZrh9kgigWVi0KwGCI Oq1C4smCAa8fWEuV1saOkSp7DAET4KQMpmivrKmTuWTZ0m/8A3tUIdeRYMVJI/vnvYbN 90DDMjRkuWthkbuYGcWdUAGlw4ZHLrqViJZ+59BV7d75FnDkrRXfeL1n14a2XZjR5dSo TW9A== X-Gm-Message-State: APjAAAXgfOkIS/kVlICRhuF9A60yndEXS2jHiaM1svoCLsolsjdqnpXC nGUb6Awh/lAvc7dO3iUoigm/1g== X-Received: by 2002:a17:902:4623:: with SMTP id o32mr25633974pld.112.1562602229878; Mon, 08 Jul 2019 09:10:29 -0700 (PDT) Received: from builder (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id j20sm5476488pfr.113.2019.07.08.09.10.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Jul 2019 09:10:29 -0700 (PDT) Date: Mon, 8 Jul 2019 09:10:26 -0700 From: Bjorn Andersson To: Jeffrey Hugo Cc: robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] drm/msm/mdp5: Find correct node for creating gem address space Message-ID: <20190708161026.GB27383@builder> References: <20190708151224.22555-1-jeffrey.l.hugo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190708151224.22555-1-jeffrey.l.hugo@gmail.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 08 Jul 08:12 PDT 2019, Jeffrey Hugo wrote: > Creating the msm gem address space requires a reference to the dev where > the iommu is located. The driver currently assumes this is the same as > the platform device, which breaks when the iommu is outside of the > platform device (ie in the parent). Default to using the platform device, > but check to see if that has an iommu reference, and if not, use the parent > device instead. This should handle all the various iommu designs for > mdp5 supported systems. > > Signed-off-by: Jeffrey Hugo Tested-by: Bjorn Andersson > --- > > v2: It turns out there isn't a universal way to get the iommu device, so > check to see if its in the current node or parent > > drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c > index 4a60f5fca6b0..02dc7d426cb0 100644 > --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c > +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c > @@ -663,6 +663,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev) > struct msm_kms *kms; > struct msm_gem_address_space *aspace; > int irq, i, ret; > + struct device *iommu_dev; > > /* priv->kms would have been populated by the MDP5 driver */ > kms = priv->kms; > @@ -702,7 +703,11 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev) > mdelay(16); > > if (config->platform.iommu) { > - aspace = msm_gem_address_space_create(&pdev->dev, > + iommu_dev = &pdev->dev; > + if (!iommu_dev->iommu_fwspec) > + iommu_dev = iommu_dev->parent; > + > + aspace = msm_gem_address_space_create(iommu_dev, > config->platform.iommu, "mdp5"); > if (IS_ERR(aspace)) { > ret = PTR_ERR(aspace); > -- > 2.17.1 >