Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1453090ybh; Fri, 13 Mar 2020 01:20:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsOj7uhUs1ZPQqMSazWOlSIdVSp3obCqStQVJD0jRY86jB8ihyTH1y4vXAnQTaLu7/kCS31 X-Received: by 2002:a9d:8d0:: with SMTP id 74mr10003373otf.39.1584087619640; Fri, 13 Mar 2020 01:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584087619; cv=none; d=google.com; s=arc-20160816; b=kBRClZvq4Yz54e0k+TXiE6pllwGR7fQtTtFe1nnXGsOIcr54E6vg/UxOpqjzRhcyPi g07E//457BQ26UDosMUBJYusRcm5STVkoMs0IAwrqqyl9wVVridiXxLg6B3gHoA+CoTC tWWojw9EBxqXUboPdK1sg1ztgOOLNZcsjh0h2Hv8ub4o2OjWurq39mNCKV3c6opjtZon P7ZPdQWZAbf/ACk9ZhxFes5vxcYXh3CE4UAoqMkajvFoAYcTzbHSXh8yFRKAYjGKvtrd adbQKsTKlYqqZbmbw0T7Xn2dKrqJRt4pRgnbGxtv9Nq3UXTnu/MH3VjRbUnIvi2JC90p 3W0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=cR2auaaZnVvBiqCa7pzD+K3uPGgTnEYNRzfeAZy+KTw=; b=VSZ91ldVCM+klYG7ln2FNagjrPAbdvzDSHJy0qBZJsBSFlTLvEjmIBJkxGfCk7Eq4r 6nDJkIKuwh7g7LqhMuXMwsrh4K3HdukdVxXDZJJvrSaoZsTTeJ7kL+pSn5a9rK/kt0Ej oiYOSs4ZJiAyGA85UVOSpHDGoaVCIhs1G62yrqMlUmv8HfbOy+0/a/dfkJXLMJL6deKq US3rY3IjeKrwnGFddAg5ELCO+BrUJigcLp0Lxqf99FhyUh7DFzFHj6WYUG64UsodYD8b JRSDx9BcTSPgpYvDBmxjLOs1njU8dVIfy1k6pmWsSxiDsUIIh92jk3tY7tXowVtbUrGB k90w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mI100v4i; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h23si4900979otk.315.2020.03.13.01.20.07; Fri, 13 Mar 2020 01:20:19 -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=@ti.com header.s=ti-com-17Q1 header.b=mI100v4i; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbgCMISZ (ORCPT + 99 others); Fri, 13 Mar 2020 04:18:25 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:39366 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbgCMIRq (ORCPT ); Fri, 13 Mar 2020 04:17:46 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 02D8Hifs071929; Fri, 13 Mar 2020 03:17:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1584087465; bh=cR2auaaZnVvBiqCa7pzD+K3uPGgTnEYNRzfeAZy+KTw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mI100v4ipWTgkYhLpGjmRNpHdGYqOcaRWtQh/zfuh4LLXEmgE3JLjbw6egwgz0tdp av+hu2WY6ZcyizdKqMXlkqxZ8T9fRmVWdf0sqY8AISvzZgRah1CrwfLN6QV1y7F3an NRutpBsuqw9qmOjPzyRoA01pvl/IIa4wIPIrm3XQ= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 02D8Hing087897 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 13 Mar 2020 03:17:44 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Fri, 13 Mar 2020 03:17:42 -0500 Received: from localhost.localdomain (10.64.41.19) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Fri, 13 Mar 2020 03:17:42 -0500 Received: from sokoban.bb.dnainternet.fi (ileax41-snat.itg.ti.com [10.172.224.153]) by localhost.localdomain (8.15.2/8.15.2) with ESMTP id 02D8HQlc097835; Fri, 13 Mar 2020 03:17:40 -0500 From: Tero Kristo To: , , CC: , , , , Tero Kristo Subject: [PATCHv8 06/15] remoteproc/omap: Initialize and assign reserved memory node Date: Fri, 13 Mar 2020 10:17:09 +0200 Message-ID: <20200313081718.30612-7-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200313081718.30612-1-t-kristo@ti.com> References: <20200313081718.30612-1-t-kristo@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suman Anna The reserved memory nodes are not assigned to platform devices by default in the driver core to avoid the lookup for every platform device and incur a penalty as the real users are expected to be only a few devices. OMAP remoteproc devices fall into the above category and the OMAP remoteproc driver _requires_ specific CMA pools to be assigned for each device at the moment to align on the location of the vrings and vring buffers in the RTOS-side firmware images. So, use the of_reserved_mem_device_init/release() API appropriately to assign the corresponding reserved memory region to the OMAP remoteproc device. Note that only one region per device is allowed by the framework. Signed-off-by: Suman Anna Signed-off-by: Tero Kristo Reviewed-by: Bjorn Andersson Reviewed-by: Andrew F. Davis Acked-by: Mathieu Poirier --- drivers/remoteproc/omap_remoteproc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index 9a82d5c4a06b..b010e0607d5f 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -486,14 +487,23 @@ static int omap_rproc_probe(struct platform_device *pdev) if (ret) goto free_rproc; + ret = of_reserved_mem_device_init(&pdev->dev); + if (ret) { + dev_warn(&pdev->dev, "device does not have specific CMA pool.\n"); + dev_warn(&pdev->dev, "Typically this should be provided,\n"); + dev_warn(&pdev->dev, "only omit if you know what you are doing.\n"); + } + platform_set_drvdata(pdev, rproc); ret = rproc_add(rproc); if (ret) - goto free_rproc; + goto release_mem; return 0; +release_mem: + of_reserved_mem_device_release(&pdev->dev); free_rproc: rproc_free(rproc); return ret; @@ -505,6 +515,7 @@ static int omap_rproc_remove(struct platform_device *pdev) rproc_del(rproc); rproc_free(rproc); + of_reserved_mem_device_release(&pdev->dev); return 0; } -- 2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki