Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17428771ybl; Thu, 2 Jan 2020 05:21:01 -0800 (PST) X-Google-Smtp-Source: APXvYqx3YcogiSuEV+AwHLPIia3CUg19LLqGtgmZWAqlOJqYFQQnz6dp6Lf988a31vdLXJgqB+w3 X-Received: by 2002:a05:6830:18e9:: with SMTP id d9mr82502950otf.332.1577971261024; Thu, 02 Jan 2020 05:21:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577971261; cv=none; d=google.com; s=arc-20160816; b=lxD1gPbHNuKCMWeuh8rMZZYSGWm+7lbFahNHZOvKZk+ZFl2ReVb+DI6qguj2PY19fj XbSPJ/BZ4isRFzWVHBXUJuIiI28GuAgrNn268IvQPMEWDYOiUa+op7rwtdvzKKimO48o KZEI6CYLXxa0gLjNr+Av2IA/UE6h9JZ4zHwQd2yx58bvyP0RKcnm3Lgz8mZP72TKQtgF MJJNBs24EQknic6quvE9ucZdvxREbxTttVp7vdWldgdaJFtG78PX9c/LKO6C9j4LiPsx iR2A/NCdkXH3CISozI6BWvoiQhQoAUK+ioFeCYsFFFB5Bjw8UNhfv980y5V0cIhChL/p lDTg== 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=mEbH+4b+oEMVJDIZSWRNmHp3wFNUhyd0VWS7r1xzf8c=; b=YG3BcmBUu7PLNhhQSJSYS69YGH0RLO8eRgzUIeNpafaskCDWchV+lgUoYtHwuqQOB+ Rbv5VOSxzEzDsA4tWXXv0XodI/t1+ggiujz8FkOh2uC4j7q4yranQ688VMEVjci3NXmj P2UWpAPOJFAQIRFUUWPpJUEKeZwgZgdKoYW5o+ZDJqr3B5Pg7GQnMJ5lWhSyFVjbOmFK 5ufdoyIDJcz12JOOgBQkSe+hoQk9n4xg/AXrhynGscayP0gHUSdM9o2tPLPC6uZd06gK o5OziYqKsVLuPfftPWO8ttB3tgFpua5QCy0xuFh9uPrTYaqsHHPgqEwX04dzo9TKv/NG NYVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JV3JWnqq; 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 n11si28215147otk.290.2020.01.02.05.20.49; Thu, 02 Jan 2020 05:21:01 -0800 (PST) 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=JV3JWnqq; 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 S1728410AbgABNTK (ORCPT + 99 others); Thu, 2 Jan 2020 08:19:10 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:42516 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728398AbgABNTI (ORCPT ); Thu, 2 Jan 2020 08:19:08 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 002DJ7vL071423; Thu, 2 Jan 2020 07:19:07 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577971147; bh=mEbH+4b+oEMVJDIZSWRNmHp3wFNUhyd0VWS7r1xzf8c=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=JV3JWnqq9qeaCsiN4G7zsNCJgrUAKlcBrYJpe2keD6E9TbAA1Dfv6BvSVLxfAwIwW CTo8wpz1Gm28pFu7y69+hQJeVL+PZR4UJHR7eXv11S5EUrh7uz2sLfbsKz3XaEEVdn 2PVl5I99h0XG6AHpb7XSWWOkwotrtZ4hIsSAKqPk= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 002DJ7dU035256 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 2 Jan 2020 07:19:07 -0600 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 2 Jan 2020 07:19:06 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE102.ent.ti.com (157.170.170.32) 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; Thu, 2 Jan 2020 07:19:06 -0600 Received: from sokoban.bb.dnainternet.fi (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 002DIp3X075354; Thu, 2 Jan 2020 07:19:04 -0600 From: Tero Kristo To: , , CC: , , , , Tero Kristo Subject: [PATCHv4 06/14] remoteproc/omap: Initialize and assign reserved memory node Date: Thu, 2 Jan 2020 15:18:37 +0200 Message-ID: <20200102131845.12992-7-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200102131845.12992-1-t-kristo@ti.com> References: <20200102131845.12992-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 --- drivers/remoteproc/omap_remoteproc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index 9ca337f18ac2..8a6dd742a8b1 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -480,14 +481,22 @@ 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_err(&pdev->dev, "device does not have specific CMA pool\n"); + goto free_rproc; + } + 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; @@ -499,6 +508,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