Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp411942pxa; Wed, 19 Aug 2020 05:07:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7R9ExQ2/7+7kl8/g7rkorXHvV2sxhfY0hR0GzXMiAP/TNbPmxooqqALBgLjdvuxCkuVCU X-Received: by 2002:a17:906:f2cb:: with SMTP id gz11mr3753555ejb.58.1597838825885; Wed, 19 Aug 2020 05:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597838825; cv=none; d=google.com; s=arc-20160816; b=FIbViUi30okHmLRJCaLeg9o5PN42+YSjlTaChuIF7PSt7YgBl67MjJX6F0AJPhBKNU h4xxDayBAVOJ2NziMxgU5ajbtB1tNqbxsbWfphJjBrqOe54Lfj21JldgwpIZVwkyU7mU anJazVBOW8dbyVLVQ0QTSI+RF0cz3WgVY1RRjQjzw2y4LrCoJTsM9fgbFOB9qLpqxxB1 OMqoeUrMBkTeGoeRN7swcp5XlejwsbnFJTWn++GIVl0rEZ3uJyNZX5DBj/1fqFjpuPSU ry3OkfTZD0aIyHPZCXXV/OKkOBK/rZskMa8cV2IdfixGtPFRecqQLylHMX7hs+7tF4CZ qgrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/bV0bib97enLOBK4GLE1yJNxbZX9EmhgXv7EO151/I0=; b=j9uxcGpZwoJ5wwXdhEwtJCYIjyxlp03/RMPZqCud4cFRrD9mq1HAOSTOYrPRcoSkEj CoY8pGfH5E/I1ZlMquAozV8ovJDZjrwddytgPClL1vi7vvuGzROF3qaP/RUo48Wuu/+5 Ip8hOjKVM0cELUuwPZNH80IlZ7745jIv85zNsfBgUzCIBeCXCnaZzgkPC3qI5tbQ4Jgs FyCNKAmiQ0u4//KURncKBWvK1uKsX1cFerHlTE0IQBwOLsUuwP4F5tJ4BPUr3cSDNo3u xNlKb8hxwCtwB2arIsMpB7i7EHOkzdcwr5Nr1/K760w+A/inEfwovVUadbM2IyA/Ta+S sJOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lqYhiCf4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si15332395ejg.29.2020.08.19.05.06.41; Wed, 19 Aug 2020 05:07:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lqYhiCf4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728173AbgHSMF6 (ORCPT + 99 others); Wed, 19 Aug 2020 08:05:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:47550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728223AbgHSLrn (ORCPT ); Wed, 19 Aug 2020 07:47:43 -0400 Received: from mail.kernel.org (ip5f5ad5a3.dynamic.kabel-deutschland.de [95.90.213.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 093342310C; Wed, 19 Aug 2020 11:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597837583; bh=zHf77lVLfTNqIaF9sRrNbaiO3qYSqs9jubzcWDx1ovA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lqYhiCf4WYrkZPL2mxfY4LFdgDMcf0IqacgkYiFAinHtvsLLw3nGvlRlGBuq2tExC sceu3WD8kEwqxZtiHI9Du/wNwhm5UOIo8sSpTykX26dS1KpIiBGQ9TGW+NSCHCDqFT NvrVXGF9PpS3l24SHgKq/HPA5yjH1dbBZKrVZ1yM= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1k8MXt-00Eubj-0d; Wed, 19 Aug 2020 13:46:21 +0200 From: Mauro Carvalho Chehab To: Greg Kroah-Hartman Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , John Stultz , Manivannan Sadhasivam , Daniel Vetter , dri-devel , Xiubin Zhang , Liwei Cai , Wanchun Zheng , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 37/49] staging: hikey9xx/gpu: don't use iommu code Date: Wed, 19 Aug 2020 13:46:05 +0200 Message-Id: <0230300d41aaa80f27aeeeafe585b8d19b4d5146.1597833138.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While this driver apparently supports both IOMMU and no-IOMMU access, it always enable the IOMMU via some code, at the downstream version. Apparently, the downstream iommu is there just to get the physical address of the logical IOMMU address. Based on the downstream code, it sounds that the IOMMU would be an specific one for the GPU. Anyway, right now, the driver is set to not use the IOMMU at all. So, let's comment out the code which allocates IOMMU pages, and the code that would try to use it to setup a register, as, without the IOMMU, this would cause an OOPS. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c | 12 ++++++++++-- .../hikey9xx/gpu/kirin9xx_drm_overlay_utils.c | 10 ++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c index e3bb0a32dddf..546da775f2fb 100644 --- a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c +++ b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_dss.c @@ -769,6 +769,14 @@ static int dss_plane_init(struct drm_device *dev, struct dss_plane *aplane, static int dss_enable_iommu(struct platform_device *pdev, struct dss_hw_ctx *ctx) { +#if 0 +/* + * FIXME: + * + * Right now, the IOMMU support is actually disabled. See the caller of + * hisi_dss_smmu_config(). Yet, if we end enabling it, this should be + * ported to use io-pgtable directly. + */ struct device *dev = NULL; dev = &pdev->dev; @@ -781,7 +789,7 @@ static int dss_enable_iommu(struct platform_device *pdev, struct dss_hw_ctx *ctx } iommu_attach_device(ctx->mmu_domain, dev); - +#endif return 0; } @@ -934,7 +942,7 @@ static int dss_dts_parse(struct platform_device *pdev, struct dss_hw_ctx *ctx) DSS_MAX_PXL0_CLK_144M, (uint64_t)clk_get_rate(ctx->dss_pxl0_clk)); } - /* regulator enable */ + /* enable IOMMU */ dss_enable_iommu(pdev, ctx); return 0; diff --git a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_overlay_utils.c b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_overlay_utils.c index 9113937478f5..6b6774b8d903 100644 --- a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_overlay_utils.c +++ b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_overlay_utils.c @@ -1333,8 +1333,17 @@ static void hisi_dss_mif_on(struct dss_hw_ctx *ctx) set_reg(dss_base + MIF_CH11_OFFSET + MIF_CTRL0, 0x1, 1, 0); } + void hisi_dss_smmu_on(struct dss_hw_ctx *ctx) { +#if 0 +/* + * FIXME: + * + * Right now, the IOMMU support is actually disabled. See the caller of + * hisi_dss_smmu_config(). Yet, if we end enabling it, this should be + * ported to use io-pgtable directly. + */ void __iomem *smmu_base; struct iommu_domain_data *domain_data = NULL; u32 phy_pgd_base = 0; @@ -1374,6 +1383,7 @@ void hisi_dss_smmu_on(struct dss_hw_ctx *ctx) phy_pgd_base = (uint32_t)(domain_data->phy_pgd_base); DRM_DEBUG("fama_phy_pgd_base = %llu, phy_pgd_base =0x%x \n", fama_phy_pgd_base, phy_pgd_base); set_reg(smmu_base + SMMU_CB_TTBR0, phy_pgd_base, 32, 0); +#endif } void hisifb_dss_on(struct dss_hw_ctx *ctx) -- 2.26.2