Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp582920pxj; Thu, 13 May 2021 11:48:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPSvgjUh1zi2PxzWKPfc8lHWe7pf5BzJkGBHzpY/1AkQDwmBJR4h3qZW0l6y9hh0/MkKI1 X-Received: by 2002:a4a:ea2b:: with SMTP id y11mr11362980ood.42.1620931735427; Thu, 13 May 2021 11:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620931735; cv=none; d=google.com; s=arc-20160816; b=py/2xy9Tbx3qZaauOqiWdgOOO3kYB8nYqj2OLrTBi3Lq2n6FUQu7v0Xc8smgVGrFQq qFk9Nqfr6/QFHt/Il4tyh70oXaDdXDGn/PiwxEXV67FyBSPVJMfWrtVu+85w7kwUEkuY YrCZISyNqaFzVSXUKQWCalbiD918N9LwOCkeFmo5NziwRhAuhWt5IjP6mKPtfYTxFm4z 6v5D3wTMkpC0kafHwwdK5GF/Rh8SBBU6AF9Uoil+nX6TtrkKB5QJniQnd2h0PVxvqVIy ZrZmBMCHxQ7YYlo+qam17p57OBgIOVTm+5qrG7xeB4eczRMVPNjiek5PMKA8AEDwEFX4 r1rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=L3pZcqvtjRkm8e2BLXbExhHfK/5cmx/F0MXsUqWScMY=; b=FmI0S4rx+fLdp3eAIaKeCQwfeHxIEf4/k//MRydgBp50j4uj2UjiF0n1FHMy50K0LS StFfoNfxBpV3zwb88u9SbeqIrsYuhU0rdaXHiyUNKddW7XkpVPPC3pKTn6/UU68XdLoB 7PF1gOVHJ5HE8f+1v9fjStiZpKOYvk3D2Tk/nMkhOrVTkgPOBv1Ic0+HzgsMhPzDDsk4 Nd/KDfUrWjyyYZnwAKRVeydzjOQbf4D37+pXx3eLREli/tLYG2jeYDshsjB34I1Gjijf 1XtqxI2iWsEaOWv2UVnBzv8usw0x9kndByFev62UlrqN+jNJ+aAmKOOYm/qlqKAMbpx0 1YTA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j184si4331455oia.169.2021.05.13.11.48.42; Thu, 13 May 2021 11:48:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232970AbhEMLD3 (ORCPT + 99 others); Thu, 13 May 2021 07:03:29 -0400 Received: from mga02.intel.com ([134.134.136.20]:45141 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232940AbhEMLCU (ORCPT ); Thu, 13 May 2021 07:02:20 -0400 IronPort-SDR: poBYz2QKiyXRmgSDNuZgIUyT3hSDVvCbEKDDf1dcl0x5lboSnJH/WtZ/YWnY/saObQLZ+E9/rv Sl7jI9Y527gA== X-IronPort-AV: E=McAfee;i="6200,9189,9982"; a="187048298" X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="187048298" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 04:01:07 -0700 IronPort-SDR: oRrRNuMNPtq/+ZrkwyvS/ajAnIZybwfvicLx4XPNkqaaa3Durn/yvWi8qiBaIqoGX1iOxIn0yh Y14QTp808c2w== X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="625984040" Received: from gna-dev.igk.intel.com ([10.102.80.34]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 04:01:05 -0700 From: Maciej Kwapulinski To: Greg Kroah-Hartman , Arnd Bergmann , Jonathan Corbet , Derek Kiernan , Dragan Cvetic , Andy Shevchenko Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maciej Kwapulinski , Tomasz Jankowski , Savo Novakovic Subject: [PATCH v3 05/14] intel_gna: initialize mmu Date: Thu, 13 May 2021 13:00:31 +0200 Message-Id: <20210513110040.2268-6-maciej.kwapulinski@linux.intel.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210513110040.2268-1-maciej.kwapulinski@linux.intel.com> References: <20210513110040.2268-1-maciej.kwapulinski@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomasz Jankowski Setup mmu in the driver with a new memory component. Signed-off-by: Tomasz Jankowski Tested-by: Savo Novakovic Co-Developed-by: Maciej Kwapulinski Signed-off-by: Maciej Kwapulinski --- drivers/misc/intel/gna/device.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/misc/intel/gna/device.c b/drivers/misc/intel/gna/device.c index ed7d3c0223df..50cac8139dcc 100644 --- a/drivers/misc/intel/gna/device.c +++ b/drivers/misc/intel/gna/device.c @@ -59,6 +59,18 @@ int gna_probe(struct device *parent, struct gna_dev_info *dev_info, void __iomem bld_reg = gna_reg_read(gna_priv, GNA_MMIO_IBUFFS); gna_priv->hw_info.in_buf_s = bld_reg & GENMASK(7, 0); + ret = gna_mmu_alloc(gna_priv); + if (ret) { + dev_err(parent, "mmu allocation failed\n"); + return ret; + + } + dev_dbg(parent, "maximum memory size %llu num pd %d\n", + gna_priv->info.max_hw_mem, gna_priv->info.num_pagetables); + dev_dbg(parent, "desc rsvd size %d mmu vamax size %d\n", + gna_priv->info.desc_info.rsvd_size, + gna_priv->info.desc_info.mmu_info.vamax_size); + mutex_init(&gna_priv->mmu_lock); idr_init(&gna_priv->memory_idr); -- 2.28.0