Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1446976ybz; Thu, 16 Apr 2020 09:18:16 -0700 (PDT) X-Google-Smtp-Source: APiQypLGy4oG4s976+19O4IXbfnKJLn6SX4zUFlwaJi3UNKOS3R5JiojUHv7vL4L3DrnFY6plytH X-Received: by 2002:a17:906:cec5:: with SMTP id si5mr10451409ejb.267.1587053896782; Thu, 16 Apr 2020 09:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587053896; cv=none; d=google.com; s=arc-20160816; b=F3cqA6sC7frRHFT3pQzKoXNWPolgHv3GYMWI7AFgyJUFU8PPOn6YNpRJVVGkMryJZT MDjHK4WD9rO06ZZ2do2FhHnRiGnKKiXtfQhZL095UhbxFRk1rYfrWA8c2FGZtnpQPgzc xOPwHtmHM4oAldDU/IKPAr2m+n7czrPT/M2fMfGbL5+xK20zsZ602m0efYz6cDVCfc8u hAoLFJBzpxRBV6siL5Yor8tWGwhs8L3BESc3hjiKRAsQIAo0gAsfN7aCGPljRZSnu8NO tUChValccoYhVCayOVXylvr9wLiO26dvx54HQdOu5VpqhLjsr/eJ+0F6qpy+SQgfzTZL an3Q== 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=sTzUdiEhwGBva7XLbcJkZ9s5PAssf4muQMmT2uqz+CI=; b=XCuar6t6BIpfOG5jJajdGc+XLbw/ALFCXpI2p/HV2+e4BTrt5UIXtl22283HDXN9SK OiI6bXqOD7iC4pTzVfT3tQn1qLDXRFSpnr/lE7/96rfTcBwL3BMshJ/JLtoKy3LzGTzz wVI2luTwHNr/2tMNAl2kyQ2B51TTMATJQ3VJEEOq/QofGyKWr1SLSADqW5ZM/PbNgSlb W6Utb0X8L0Hc+BSS9X7szgYjZh9tsKJ82gOZnq7jfgUPBzO/4nvSiTJVNyZStQEzpWay /gorzkL18CpjtwdrUB7D6qMNlIREJZZqoxyG3YSne4leSjw5ONjgrHcOiTMIP7IFN6Dl Prlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=G0ZBoztV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si12579831ejv.507.2020.04.16.09.17.53; Thu, 16 Apr 2020 09:18:16 -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; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=G0ZBoztV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2442915AbgDPQP3 (ORCPT + 99 others); Thu, 16 Apr 2020 12:15:29 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:3984 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2636463AbgDPQO0 (ORCPT ); Thu, 16 Apr 2020 12:14:26 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03GGDTqq026413; Thu, 16 Apr 2020 18:14:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=sTzUdiEhwGBva7XLbcJkZ9s5PAssf4muQMmT2uqz+CI=; b=G0ZBoztVJpQ47jRS9QWRmzksdMPYQPCciv1bd9oV1Qmrp6aYGFpIHUI2Mlra29VIdRd4 i78j+rlLguqOfmveC60cPGKtXY8ATublAnNvY9bZYTvED60gcAHYgDgGZ7MZV8uFr/qX 99uIPgTke9cZz7PFd6m5uNg8KHzDSc0Im6JGDK0jVCzLIKo4rOJBAXeAoJiBmeTVXgrT uRt8UyQL48vR0b5tkVCDLS7pevHz5QXH45h8NTuLKvt11KVSF7D0kS+8qysB5i0K92t2 dWO0lAnqBAR+Fxv5zl0hpDI8dqLpehf/xb8mIIRnWL7J/WPolDvyBJAD5v/LpT6Le+Vv 7w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30dn8s3kn6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Apr 2020 18:14:23 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EDB9210002A; Thu, 16 Apr 2020 18:14:22 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E299F2B2D2A; Thu, 16 Apr 2020 18:14:22 +0200 (CEST) Received: from localhost (10.75.127.44) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 16 Apr 2020 18:14:22 +0200 From: Arnaud Pouliquen To: Bjorn Andersson , Ohad Ben-Cohen , Mathieu Poirier CC: , , , Subject: [RFC 11/18] remoteproc: Add child node component in rproc match list Date: Thu, 16 Apr 2020 18:13:24 +0200 Message-ID: <20200416161331.7606-12-arnaud.pouliquen@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200416161331.7606-1-arnaud.pouliquen@st.com> References: <20200416161331.7606-1-arnaud.pouliquen@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG1NODE1.st.com (10.75.127.1) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-16_06:2020-04-14,2020-04-16 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the components, associated to the child devices populated, in the match list for synchronization relying on bind/unbind mechanism. Signed-off-by: Arnaud Pouliquen --- drivers/remoteproc/remoteproc_core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 75f84fd3bd60..ecb36f64b1a0 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1608,6 +1608,8 @@ static void rproc_crash_handler_work(struct work_struct *work) static int rproc_platform_populate(struct rproc *rproc) { struct device *dev = rproc->dev.parent; + struct device_node *node = dev->of_node; + struct device_node *child_np; int ret; ret = of_platform_populate(dev->of_node, NULL, NULL, dev); @@ -1617,6 +1619,19 @@ static int rproc_platform_populate(struct rproc *rproc) goto depopulate; } + child_np = of_get_next_available_child(node, NULL); + + while (child_np) { + of_node_get(node); + component_match_add_release(dev, &rproc->match, + rproc_release_of, rproc_compare_of, + child_np); + child_np = of_get_next_available_child(node, child_np); + } + + if (!rproc->match) + dev_dbg(dev, "No available child\n"); + return 0; depopulate: -- 2.17.1