From patchwork Wed Jun 27 08:06:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien DESSENNE X-Patchwork-Id: 10490781 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 95732602B3 for ; Wed, 27 Jun 2018 08:07:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89074285F9 for ; Wed, 27 Jun 2018 08:07:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D8A528A42; Wed, 27 Jun 2018 08:07:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 539B6285F9 for ; Wed, 27 Jun 2018 08:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933124AbeF0IG7 (ORCPT ); Wed, 27 Jun 2018 04:06:59 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:7011 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933046AbeF0IG7 (ORCPT ); Wed, 27 Jun 2018 04:06:59 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w5R83o9S031223; Wed, 27 Jun 2018 10:06:55 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2jv6pxr10n-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 27 Jun 2018 10:06:55 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A5C984D; Wed, 27 Jun 2018 08:06:54 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8E35712B3; Wed, 27 Jun 2018 08:06:54 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 27 Jun 2018 10:06:54 +0200 Received: from localhost (10.201.23.25) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 27 Jun 2018 10:06:52 +0200 From: Fabien Dessenne To: Bjorn Andersson , , Arnaud Pouliquen , Loic Pallardy , "Oleksij Rempel" CC: Fabien Dessenne , Suman Anna , "Alex Elder" Subject: [RFC v2 4/5] remoteproc: probe the system resource manager Date: Wed, 27 Jun 2018 10:06:21 +0200 Message-ID: <1530086782-5046-5-git-send-email-fabien.dessenne@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530086782-5046-1-git-send-email-fabien.dessenne@st.com> References: <1530086782-5046-1-git-send-email-fabien.dessenne@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.25] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-27_02:, , signatures=0 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When a remote processor registers, populate the device tree to probe the SRM core driver Signed-off-by: Fabien Dessenne Signed-off-by: Arnaud Pouliquen Signed-off-by: Loic Pallardy --- drivers/remoteproc/remoteproc_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 283b258..a67f918 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include "remoteproc_internal.h" @@ -1485,6 +1486,11 @@ int rproc_add(struct rproc *rproc) return ret; } + /* add resource manager device */ + ret = devm_of_platform_populate(dev->parent); + if (ret < 0) + return ret; + /* expose to rproc_get_by_phandle users */ mutex_lock(&rproc_list_mutex); list_add(&rproc->node, &rproc_list); @@ -1705,6 +1711,8 @@ int rproc_del(struct rproc *rproc) list_del(&rproc->node); mutex_unlock(&rproc_list_mutex); + of_platform_depopulate(rproc->dev.parent); + device_del(&rproc->dev); return 0;