From patchwork Mon Oct 28 12:42:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 177926 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3340351ill; Mon, 28 Oct 2019 05:44:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8wHlREmIFvAorFUemuSdkS1IgzCzwBpGb+JcJ91aM9wh89bH8xngpVamxL+Sbzwli8HxE X-Received: by 2002:a50:8871:: with SMTP id c46mr19458540edc.24.1572266657311; Mon, 28 Oct 2019 05:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572266657; cv=none; d=google.com; s=arc-20160816; b=oDayMVCmoI5Lp1OZOu90eQWcOv/CqV9X1dQliB84vY8j02CFoV+1ONQSefy/WgvZ9b FxVYXgWlWzvKzbFVUntJLFrHbf5wh8mNMVc40295HjV4OM0qYKdoAqbbePJ3WLVGZf/D 0NnC57ncs2fyVCtl38qSAWSamf47QuqHdTMdCYF62Zvt9K7P8MY1pnjoXgxx2HgScC3X iX7kCTxpUTQ6JVvaxaXFY/NlDnAfW8hbImPFf1eHtD98RCsigZklrXM4QRREaThW7EnO AYirSWJB6arsZjGwHqEB9PUJvKd+0hfAKOZt0eK/tZsEDBr++t4Opq3JVfv9KH6pApz6 oB+g== 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=h71AZDQ2bHAHRihIGL9SD3KVSssjV5YZ19fAlli3XOs=; b=y5iS8+GJjSW5HivbCECvFHYaUPEzhvjstjuXo1mKhfekpUscBb0ff8ATgnwwoanhaz QXpvt1j4Rspua01sZPYzouYB7t9fFtHYGFDqBhzGDf6FabzKs9W+oYh6LqUfGEMSwTB0 WvubOIe6Rt4TUJ4sZritnCLYJTzWbWAENy2kl8kXP0SBSXZHBtVF8+ZCpFRPTqekfW0V KMgoN9kd7c2ntkQQhuEth/Waaw2ZS0EUX4BDTNrsQvqjWeBr1SWPc+83wFYI2xBudMyQ fKxANXfOCNhCB/ZsQNnYjOt8vnUo2mf921B4+E6E7hEe7uSkmW39+5QxQtXFanONnukX M8zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ei0EBSiT; 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 f7si4013312ejt.373.2019.10.28.05.44.17; Mon, 28 Oct 2019 05:44:17 -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=ei0EBSiT; 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 S2389337AbfJ1MnN (ORCPT + 26 others); Mon, 28 Oct 2019 08:43:13 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:37258 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389230AbfJ1MnJ (ORCPT ); Mon, 28 Oct 2019 08:43:09 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9SCh86d033895; Mon, 28 Oct 2019 07:43:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1572266588; bh=h71AZDQ2bHAHRihIGL9SD3KVSssjV5YZ19fAlli3XOs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ei0EBSiT52wY+TapJMoEsXSDbp7VsLw0WTyT/bXbw51s6voWITkVoPBvWivAsyVSY WBvNPR0REgYrORPe8qgt9eAierD+tv2PpYp8pAiKmKVZ30mWkjxez32WSKB8Q73pvP X6IxjNbHBeJSnE9tLF3GZ1mFWMQbhjBNzdaTWbXE= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9SCh87g075163 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 28 Oct 2019 07:43:08 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 28 Oct 2019 07:42:56 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 28 Oct 2019 07:43:08 -0500 Received: from sokoban.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9SCgogx063574; Mon, 28 Oct 2019 07:43:06 -0500 From: Tero Kristo To: , , CC: , , , Tero Kristo Subject: [PATCH 07/17] remoteproc/omap: Initialize and assign reserved memory node Date: Mon, 28 Oct 2019 14:42:28 +0200 Message-ID: <20191028124238.19224-8-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028124238.19224-1-t-kristo@ti.com> References: <20191028124238.19224-1-t-kristo@ti.com> MIME-Version: 1.0 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 --- drivers/remoteproc/omap_remoteproc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki Reviewed-by: Bjorn Andersson diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index 0524f7e0ffa4..0b80570effee 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -454,14 +455,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; @@ -473,6 +482,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; }